-
Notifications
You must be signed in to change notification settings - Fork 425
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
controller-gen: webhook manifest order can change unexpectedly #900
Comments
Also not sure where to fix this ideally, but sounds like something we should fix. Maybe it's easier in a place close to where we generate the output manifests to not affect other parts of the code. Ideally we would do it without producing churn compared to what we generate today. But I think that will be impossible. |
cc @alvaroaleman @vincepri re: the trade-off between producing churn now vs. having the current behavior |
@sbueringer @alvaroaleman @vincepri any updates on this? |
No |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". 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-sigs/prow repository. |
Took a quick look at the code. It seems like there is code to sort by name: controller-tools/pkg/webhook/parser.go Line 457 in 287a105
That's just not enough. I think we can fix this issue by sorting towards the end of this Generate func. Feel free to open a PR for it /reopen |
@sbueringer: Reopened 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-sigs/prow repository. |
/help |
@sbueringer: GuidelinesPlease ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met. If this request no longer meets these requirements, the label can be removed 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-sigs/prow repository. |
We ran into a case of
config/webhook/manifests.yaml
changing unexpectedly - that is, without any changes/additions to the existing webhooks.I can't share the source of our project and I don't have another repo at the moment, but I'll share one if I can reproduce this with sample code. For context, we have two API versions in our project:
v1
andv1alpha1
.After adding an import of the
v1alpha1
package in code unrelated to webhooks,controller-gen
changed the order of the webhook definitions inmanifests.yaml
. I was able to trace this back to a difference in the order in whichcontroller-gen
traverses packages - with the new import, it visitsv1alpha1
first; without the new import, it visitsv1
first.I would expect that
webhook/manifests.yaml
should be stable when there are no changes that involve webhooks. I'm not sure if the appropriate fix here would be in the webhook parser (e.g. an additional sort based on the API version) or in howcontroller-gen
visits packages.The text was updated successfully, but these errors were encountered: