Comments (13)
In response to this:
/meow
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 sample-controller.
dep is unlike to be used anytime soon.
You might be surprised soon ;)
from sample-controller.
Another option is to create a dependency link between the generator and the sample repo with an empty import. Could that work?
import _ "k8s.io/code-generator"
from sample-controller.
Intentional?
Intentional? no. Known? yes. Godeps does not do it itself and the publisher does not fix it up (but could).
from sample-controller.
Yep this is a bit of a tricky one right now - does Godeps support explicitly vendoring a package that the project doesn't actually depend upon?
Even if we make the publisher do this, we need to make sure a godeps save ./...
in future doesn't wipe out the code-generator dependency (thinking about end-users who might copy and paste this repo to start their own)
from sample-controller.
(thinking about end-users who might copy and paste this repo to start their own)
An hack/update-godeps.sh could help I think. But I wonder whether we really have to protect the users from the vendoring tools so much. The published repo should of course work. But if users copy the code, they have to know their vendoring tool of choice. And yes, these are a pain in Goland.
from sample-controller.
Or hack/update-codegen.sh
can ensure the generator is cloned in the directory it expects to find it.
from sample-controller.
Or hack/update-codegen.sh can ensure the generator is cloned in the directory it expects to find it.
Which means it must be aware of its branch and pick the right version. Don't like that either. We need a sane vendoring tool like dep that can reference extra repos.
from sample-controller.
/meow
from sample-controller.
Which means it must be aware of its branch and pick the right version. Don't like that either. We need a sane vendoring tool like dep that can reference extra repos.
@sttts today code-generator
and sample-controller
follow the release branches of kubernetes/kubernetes
. Unless that is going to change in the future, I think hack/update-codegen.sh
should try to checkout the same branch in code-generator
that is already checkout out in sample-controller
when the script runs. Seems like a viable short-term fix, dep
is unlike to be used anytime soon.
from sample-controller.
I am using dep to get started on a fork of this repo. Here's my config for vendoring the code generator (relies on dep v0.4.1+):
required = [
"k8s.io/code-generator/cmd/client-gen"
]
[[constraint]]
name = "k8s.io/client-go"
version = "kubernetes-1.9.2"
[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.9.2"
[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.9.2"
[[constraint]]
name = "k8s.io/code-generator"
version = "kubernetes-1.9.2"
[prune]
non-go = true
go-tests = true
unused-packages = true
[[prune.project]]
name = "k8s.io/code-generator"
unused-packages = false
non-go = false
go-tests = false
[[prune.project]]
name = "k8s.io/gengo"
unused-packages = false
non-go = false
go-tests = false
I haven't gotten to the point where everything is working so that may need to change some more. 😀
from sample-controller.
I haven't gotten to the point where everything is working so that may need to change some more.
What is still missing?
Am surprised that we have to disable pruning for required packages, at least the unused-packages = false
part.
from sample-controller.
What I posted is a bit of a jenky hack to workaround golang/dep#1545 not being merged yet.
- The root of code-generator package doesn't contain go code, so dep is currently not letting me require it. As a workaround I am requiring a subpackage (cmd/codegen).
- The extra project level prune settings tell dep to not remove the root package contents. Dep thinks the root project is unused because I wasn't able to require the root project.
This is a temporary wart in dep hopefully. Long term, just the required should be sufficient.
from sample-controller.
Related Issues (20)
- Execute generate-groups.sh is failure HOT 6
- SharedInformer UpdateFunc triggers while Updating status HOT 4
- Got SECURITY ERROR when downloading k8s.io/client-go HOT 6
- Move CRD from `v1beta1` to `v1` HOT 3
- README is wrong on generating code when using Go modules HOT 5
- Please give a more detail readme, there are too many pitfall HOT 8
- `./hack/update-codegen.sh` fails on pristine checkout HOT 4
- go build with error sf.IsExported undefined HOT 8
- [enhancement] Move the code generator logic to a dockerfile HOT 2
- Generate the code with update-codegen.sh in a wrong path HOT 5
- Documentation error: example CRD already exists while trying to apply manually HOT 5
- How is the Deep Copy files are generated ? HOT 5
- Why has not the NewController use a leader election like leaderelection? HOT 4
- 无法执行生成 HOT 8
- How are the files crd.yaml and crd-status-subresource. yaml generated HOT 4
- State of the docs? HOT 4
- Why does fooInformer not register a delete event handling handler?
- code is not generated to correct dir HOT 4
- code generator errors HOT 6
- Some optimization suggestions for code generators HOT 1
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 sample-controller.