GithubHelp home page GithubHelp logo

Comments (16)

mauri870 avatar mauri870 commented on July 1, 2024 3

Using tags would be a way to have more reproducible builds, they still need to be tagged from time to time tho. That is still better than using @latest or micro managing commit revisions.

from kubernetes.

mimowo avatar mimowo commented on July 1, 2024 2

Either that or we pin to a more recent commit, for example @835d969ad83a.

@mauri870 thanks for investigating.

Question, if we use @latest would this not cause problems in the future if we try to build a release branch from the past? Maybe this is not a big deal. OTOH if we hardcode a tag, it may create maintenance costs.

I'm wondering if there is a better way, say to version openapi-gen and use the corresponding tag, say 1.30.1?

from kubernetes.

mauri870 avatar mauri870 commented on July 1, 2024 1

/assign

from kubernetes.

mauri870 avatar mauri870 commented on July 1, 2024 1

I was able to reproduce, but just because I had an older version of kube-openapi in my GOPATH. Using the @latest prefix in the command fixed it.

$ GO111MODULE=on go install k8s.io/kube-openapi/cmd/openapi-gen
../../gopath/pkg/mod/k8s.io/[email protected]/pkg/common/common.go:23:2: missing go.sum entry for module providing package github.com/emicklei/go-restful/v3 (imported by k8s.io/kube-openapi/pkg/common); to add:
        go get k8s.io/kube-openapi/pkg/[email protected]

$ GO111MODULE=on go install k8s.io/kube-openapi/cmd/openapi-gen@latest
go: downloading k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a

$ GO111MODULE=on go install k8s.io/kube-openapi/cmd/openapi-gen@latest

I think line https://github.com/kubernetes/code-generator/blob/master/kube_codegen.sh#L330C45-L330C64 needs to be

GO111MODULE=on go install $(printf "k8s.io/kube-openapi/cmd/%s@latest" "${BINS[@]}")

from kubernetes.

mauri870 avatar mauri870 commented on July 1, 2024 1

Either that or we pin to a more recent commit, for example @835d969ad83a. For some reason if you ommit the version it is using a commit from Feb 27.

from kubernetes.

mbobrovskyi avatar mbobrovskyi commented on July 1, 2024 1

I can do it.

from kubernetes.

mbobrovskyi avatar mbobrovskyi commented on July 1, 2024

/cc @alculquicondor @mimowo @thockin

from kubernetes.

neolit123 avatar neolit123 commented on July 1, 2024

GO111MODULE=on go install k8s.io/kube-openapi/cmd/openapi-gen

/sig api-machinery

from kubernetes.

mbobrovskyi avatar mbobrovskyi commented on July 1, 2024

Yeah, with latest works for me too.

from kubernetes.

fedebongio avatar fedebongio commented on July 1, 2024

Thanks @mauri870 and @mimowo for the research. Is either of you thinking on submitting a fix for this? Thanks!

from kubernetes.

mauri870 avatar mauri870 commented on July 1, 2024

I can do it.

Thanks!

/assign mbobrovskyi

from kubernetes.

BenTheElder avatar BenTheElder commented on July 1, 2024

Yes, please don't use @latest

Generally instead we'd control the version of a tool in the hack/tools module and install it from there (see e.g.

go -C "${KUBE_ROOT}/hack/tools" install github.com/client9/misspell/cmd/misspell

from kubernetes.

BenTheElder avatar BenTheElder commented on July 1, 2024

github.com/client9/misspell v0.3.4

_ "github.com/client9/misspell/cmd/misspell"

This allows us to also gain go.sum for the package while not polluting the main module with dev-only dependencies.

from kubernetes.

mbobrovskyi avatar mbobrovskyi commented on July 1, 2024

Not sure if we need to make another go.mod. Because it's not just a dev-only dependency. I propose to add it to tools.go of code-generator.

from kubernetes.

mbobrovskyi avatar mbobrovskyi commented on July 1, 2024

This is about semversioning kubernetes/kube-openapi#421 (comment).

Note, and this is crucial for this repo, kube-openapi has a collection of very different functionality that is independently developed. Our go-openapi fork is very different from pkg/cached or pkg/builder. Semver for a collection repository like this is not a good strategy. We could apply semver to individual parts via nested go.mods. That would make a lot more sense.

from kubernetes.

seans3 avatar seans3 commented on July 1, 2024

/triage accepted

from kubernetes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.