Comments (15)
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.
@sttts you can copy the above section into a Dockerfile
and do a docker build .
and see the failure in action 😄
from code-generator.
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.
@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.
+1 for fix or documentation.
I encounter the same issue and only find the solution mentioned before by Google.
from code-generator.
@markmandel @jinghzhu do you have a small example repo where this can be seen?
from code-generator.
PR welcome to improve our codegen shell scripts to cope with out-of-dir invocations.
from code-generator.
Also note that the package is called k8s.io/sample-controller
, not github.com/kubernetes/sample-controller
.
from code-generator.
I am facing the same issue
from code-generator.
@rahulkrishnanfs compare my comment #21 (comment). You have to call the generator script with a relative CODEGEN_PKG. Does it help?
from code-generator.
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.
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.
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.
/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.
@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)
- Informer gen creates duplicate definitions in SharedInformerFactory HOT 4
- code generator on windows os use backslash in import path HOT 6
- latest golangci-lint picking up discrepancies in auto-generated code
- generate-groups.sh failed with error obtaining VCS in Golang v1.19.5 container
- Specifying multiple group-version with script parameters does not work
- fake clients return nil on failed Get, real clients return an empty object HOT 2
- kube::codegen::gen_helpers errors out with 'fatal: Invalid path' error HOT 5
- [BUG]: go not found HOT 4
- ApplyScale requires a non exsiting package HOT 5
- [question] Does support generate code from crd files? HOT 1
- Allow to use the code-gen in vendorless projects HOT 11
- Make boilerplate optional HOT 4
- Support code generation via kube_codegen.sh when the repository path is outside the package name HOT 5
- applyconfiguration-gen do not handle slices of pointers correctly HOT 3
- client-gen generates empty "core" group clientsets when "api" package directory is in use for input APIs HOT 11
- --with-applyconfig creates import loop for some groupName values HOT 5
- Is there a specific reason why we exclude register-gen in kube_codegen.sh?
- applyconfiguration-gen generates an import cycle
- Conversion should allow explicit declaration of conversion funcs, beyond just naming convention HOT 9
- applyconfiguration-gen generates incorrect Extract...Status()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from code-generator.