-
Notifications
You must be signed in to change notification settings - Fork 3
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
Prevent chart CR creation if managed cm and secret are not ready #593
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serves the purpose from my perspective
@corest Thanks good to add this. My only query is whether we could use the This was added recently and executes first. If the CR is not valid it cancels the reconciliation and sets the reason field in the CR status. Resource is here. The logic is in the app library. As we will use the same validation rules in app-admission-controller. |
Let's merge giantswarm/apiextensions#629 first and use it here. |
But shouldn't admission controller allow the app without CM/Secret set? Otherwise we won't be able to create an App CR for the config-controller to reconcile. Am I missing sth? |
good catch. In general it is important to clarify what is validation in this case? Because App CR without cm/secret but with annotation that cm/secret are managed - is still valid CR. It is just that cm/secret are expected to be created later. And if we use e.g. this approach https://github.com/giantswarm/app/pull/52/files only in app-operator - that's gonna work. But if we put it into admission-webhook - so I don't know then - it is still valid CR, but what, we will block its creation? |
@corest @kopiczko I think this will be OK. The app CR will be created but not processed and the reason will be added to the status. I've been a bit stealthy with app-admission-controller. Full plan is here https://github.com/giantswarm/giantswarm/issues/11656 It's mainly to help with tenant app CRs. These are more complex than CP apps CRs with the kubeconfig secret etc. We also regularly get problems like user values configmaps that don't exist. We want to roll it out via platform releases. So the proposal is it will only apply when We can add that later if needed but I also want to try and avoid deadlock situations or having to delete the webhooks manually which would be a pain. |
Still it doesn't sound correct to me. As @corest said the App CR without CM/Secret set is valid. But if you prefer it that way I won't argue. |
The app CR is valid but we don't want to process it yet. Plus the reason it wasn't processed gets added to the app CR status which is important for trouble shooting. It also means if we add or change the other resources this check will persist. |
Sorry, I'm not deep into the details. app-admission-controller + validation sounds like it could prevent App CR from being created. If you say it will be ok after I pointed out my concerns - I'm fine. Let's proceed. |
Done here #598 |
Towards https://github.com/giantswarm/giantswarm/issues/14604
If app CR has annotation
config.giantswarm.io/version
- it means cm/secret will be configured by config-controller.And if those values are not set yet - it means config-controller didn't finish its job yet, so cancelling chart/cm/secret resources reconciliation
Checklist