-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support code generation via kube_codegen.sh when the repository path is outside the package name #165
Comments
Workaround for multi-level packages (e.g. # TODO: remove the workaround when the issue is solved in code-generator
# (https://github.com/kubernetes/code-generator/issues/165).
# kube_codegen.sh expects this layout:
# .
# └── github.com
# └── sportshead
# └── codegen-demo
# We can use soft links in order to fake this layout, such that
# ./github.com/sportshead/codegen-demo resolves to ././../codegen-demo, or ./.
ln -s . github.com
ln -s .. sportshead
trap "rm github.com && rm sportshead" EXIT |
Hack `scripts/update_codegen.sh` script to continue to generate code using the deprecated scripts. The deprecated scripts now call into each other, and unfortunately, `go mod vendor` doesn't keep permission bits around. So, we need to update the execute permissions on a vendored script. The new `kube_codegen.sh` doesn't work when the repository path is outside the package name, see: kubernetes/code-generator#165 The workaround is to create symlinked directories to fool `kube_codegen.sh` into thinking the path is correct. But first we'd have to start using the new script. Once `kube_codegen.sh` is fixed, we should migrate to it (which is a non-trivial task). Signed-off-by: Todd Short <[email protected]>
Hack `scripts/update_codegen.sh` script to continue to generate code using the deprecated scripts. The deprecated scripts now call into each other, and unfortunately, `go mod vendor` doesn't keep permission bits around. So, we need to update the execute permissions on a vendored script. The new `kube_codegen.sh` doesn't work when the repository path is outside the package name, see: kubernetes/code-generator#165 The workaround is to create symlinked directories to fool `kube_codegen.sh` into thinking the path is correct. But first we'd have to start using the new script. Once `kube_codegen.sh` is fixed, we should migrate to it (which is a non-trivial task). Signed-off-by: Todd Short <[email protected]>
Hack `scripts/update_codegen.sh` script to continue to generate code using the deprecated scripts. The deprecated scripts now call into each other, and unfortunately, `go mod vendor` doesn't keep permission bits around. So, we need to update the execute permissions on a vendored script. The new `kube_codegen.sh` doesn't work when the repository path is outside the package name, see: kubernetes/code-generator#165 The workaround is to create symlinked directories to fool `kube_codegen.sh` into thinking the path is correct. But first we'd have to start using the new script. Once `kube_codegen.sh` is fixed, we should migrate to it (which is a non-trivial task). Signed-off-by: Todd Short <[email protected]>
* Update k8s to v0.28.5 This also updates to the latest operator-framework api and operator-registry kind is still at v0.20.0 (k8s 1.27.3) as it's the latest version Signed-off-by: Todd Short <[email protected]> * Update code for k8s v0.28.5 compatibility Fix unit-tests as well Signed-off-by: Todd Short <[email protected]> * Update codegen Hack `scripts/update_codegen.sh` script to continue to generate code using the deprecated scripts. The deprecated scripts now call into each other, and unfortunately, `go mod vendor` doesn't keep permission bits around. So, we need to update the execute permissions on a vendored script. The new `kube_codegen.sh` doesn't work when the repository path is outside the package name, see: kubernetes/code-generator#165 The workaround is to create symlinked directories to fool `kube_codegen.sh` into thinking the path is correct. But first we'd have to start using the new script. Once `kube_codegen.sh` is fixed, we should migrate to it (which is a non-trivial task). Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]>
* Update k8s to v0.28.5 This also updates to the latest operator-framework api and operator-registry kind is still at v0.20.0 (k8s 1.27.3) as it's the latest version Signed-off-by: Todd Short <[email protected]> * Update code for k8s v0.28.5 compatibility Fix unit-tests as well Signed-off-by: Todd Short <[email protected]> * Update codegen Hack `scripts/update_codegen.sh` script to continue to generate code using the deprecated scripts. The deprecated scripts now call into each other, and unfortunately, `go mod vendor` doesn't keep permission bits around. So, we need to update the execute permissions on a vendored script. The new `kube_codegen.sh` doesn't work when the repository path is outside the package name, see: kubernetes/code-generator#165 The workaround is to create symlinked directories to fool `kube_codegen.sh` into thinking the path is correct. But first we'd have to start using the new script. Once `kube_codegen.sh` is fixed, we should migrate to it (which is a non-trivial task). Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]>
* Update k8s to v0.28.5 This also updates to the latest operator-framework api and operator-registry kind is still at v0.20.0 (k8s 1.27.3) as it's the latest version Signed-off-by: Todd Short <[email protected]> * Update code for k8s v0.28.5 compatibility Fix unit-tests as well Signed-off-by: Todd Short <[email protected]> * Update codegen Hack `scripts/update_codegen.sh` script to continue to generate code using the deprecated scripts. The deprecated scripts now call into each other, and unfortunately, `go mod vendor` doesn't keep permission bits around. So, we need to update the execute permissions on a vendored script. The new `kube_codegen.sh` doesn't work when the repository path is outside the package name, see: kubernetes/code-generator#165 The workaround is to create symlinked directories to fool `kube_codegen.sh` into thinking the path is correct. But first we'd have to start using the new script. Once `kube_codegen.sh` is fixed, we should migrate to it (which is a non-trivial task). Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]>
* Update k8s to v0.28.5 This also updates to the latest operator-framework api and operator-registry kind is still at v0.20.0 (k8s 1.27.3) as it's the latest version Signed-off-by: Todd Short <[email protected]> * Update code for k8s v0.28.5 compatibility Fix unit-tests as well Signed-off-by: Todd Short <[email protected]> * Update codegen Hack `scripts/update_codegen.sh` script to continue to generate code using the deprecated scripts. The deprecated scripts now call into each other, and unfortunately, `go mod vendor` doesn't keep permission bits around. So, we need to update the execute permissions on a vendored script. The new `kube_codegen.sh` doesn't work when the repository path is outside the package name, see: kubernetes/code-generator#165 The workaround is to create symlinked directories to fool `kube_codegen.sh` into thinking the path is correct. But first we'd have to start using the new script. Once `kube_codegen.sh` is fixed, we should migrate to it (which is a non-trivial task). Signed-off-by: Todd Short <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 134cceeb21059dbcbcef68e95c623dc83fede4fe
All the PATH and GOPATH stuff should be resolved now! /close |
@thockin: Closing this issue. In response to this:
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. |
Hi, @thockin from which tag the issue is solved? Could you share any commit related to the fix? |
I thought it was fixed in v0.30.0-beta.0 but there are other issues with go.mod - it MIGHT work for you, else it should be fixed in beta.1 - let me know if not? |
In particular, the script only works when the kueue repository is cloned into the "sigs.k8s.io" folder, so that it matches its package name prefix : sigs.k8s.io/kueue.
See more details here: kubernetes-sigs/kueue#1151 (comment)
It was also reported as a complication for jobset: kubernetes-sigs/jobset#305
The text was updated successfully, but these errors were encountered: