Skip to content
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

Open
jmeyers35 opened this issue Apr 1, 2024 · 4 comments
Open

controller-gen: webhook manifest order can change unexpectedly #900

jmeyers35 opened this issue Apr 1, 2024 · 4 comments

Comments

@jmeyers35
Copy link

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 and v1alpha1.

After adding an import of the v1alpha1 package in code unrelated to webhooks, controller-gen changed the order of the webhook definitions in manifests.yaml. I was able to trace this back to a difference in the order in which controller-gen traverses packages - with the new import, it visits v1alpha1 first; without the new import, it visits v1 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 how controller-gen visits packages.

@sbueringer
Copy link
Member

sbueringer commented Apr 3, 2024

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.

@sbueringer
Copy link
Member

cc @alvaroaleman @vincepri re: the trade-off between producing churn now vs. having the current behavior

@jmeyers35
Copy link
Author

@sbueringer @alvaroaleman @vincepri any updates on this?

@sbueringer
Copy link
Member

No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants