Git Product home page Git Product logo

Comments (15)

markmandel avatar markmandel commented on June 26, 2024 2

I worked out the issue - this doesn't work unless k8s.io/apimachinery is in the GOPATH, if it is just vendored, then deepcopy can't find it. At the very least, this needs to be documented somewhere, but it would be great if the vendored version worked as well.

Changed title to represent the actual issue.

from code-generator.

markmandel avatar markmandel commented on June 26, 2024 1

@sttts you can copy the above section into a Dockerfile and do a docker build . and see the failure in action 😄

from code-generator.

sttts avatar sttts commented on June 26, 2024 1

The cause for the issue described above is that the generators are not called from the sample-apiserver directory. Only then gengo (the Golang parsing library below) can pick up the vendor/ directory properly. The following Dockerfile passes the deepcopy-gen call, but fails at client-gen (compare kubernetes/kubernetes#57143 for a fix).

FROM golang:1.9.2

ENV PATH=$PATH:/go/bin
ENV GOPATH=/go
RUN go get -u k8s.io/code-generator/...
RUN go get -d k8s.io/sample-controller
RUN ls -l /go/src/k8s.io
RUN mkdir -p /go/src/k8s.io/kubernetes/hack/boilerplate && touch /go/src/k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt
WORKDIR /go/src/k8s.io/sample-controller
RUN CODEGEN_PKG=../../k8s.io/code-generator bash -xe hack/update-codegen.sh

from code-generator.

mattysweeps avatar mattysweeps commented on June 26, 2024 1

@markmandel please consider reopening this issue. I see no evidence that it has been solved, and users are still running into issues. Thank you.

from code-generator.

jinghzhu avatar jinghzhu commented on June 26, 2024

+1 for fix or documentation.

I encounter the same issue and only find the solution mentioned before by Google.

from code-generator.

sttts avatar sttts commented on June 26, 2024

@markmandel @jinghzhu do you have a small example repo where this can be seen?

from code-generator.

sttts avatar sttts commented on June 26, 2024

PR welcome to improve our codegen shell scripts to cope with out-of-dir invocations.

from code-generator.

sttts avatar sttts commented on June 26, 2024

Also note that the package is called k8s.io/sample-controller, not github.com/kubernetes/sample-controller.

from code-generator.

rahulkrishnanfs avatar rahulkrishnanfs commented on June 26, 2024

I am facing the same issue

from code-generator.

sttts avatar sttts commented on June 26, 2024

@rahulkrishnanfs compare my comment #21 (comment). You have to call the generator script with a relative CODEGEN_PKG. Does it help?

from code-generator.

fejta-bot avatar fejta-bot commented on June 26, 2024

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

from code-generator.

fejta-bot avatar fejta-bot commented on June 26, 2024

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

from code-generator.

fejta-bot avatar fejta-bot commented on June 26, 2024

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

from code-generator.

mattysweeps avatar mattysweeps commented on June 26, 2024

/reopen

See kubernetes/kubernetes#79149 (comment)
Code generator users are still running into this issue.

Either the documentation should inform users to prepare their GOPATHS with the necessary dependencies or the code-generator be improved so it no longer has this requirement.

from code-generator.

k8s-ci-robot avatar k8s-ci-robot commented on June 26, 2024

@mattysweeps: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen

See kubernetes/kubernetes#79149 (comment)
Code generator users are still running into this issue.

Either the documentation should inform users to prepare their GOPATHS with the necessary dependencies or the code-generator be improved so it no longer has this requirement.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from code-generator.

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.