-
Notifications
You must be signed in to change notification settings - Fork 107
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
fix: don't delete coredns unless previously managed by kamaji #527
Conversation
✅ Deploy Preview for kamaji-documentation canceled.
|
Several adopters reported this, and it's a neat feature/bug. I'll be happy to have a different approach, tho: the Resource Handler is an interface with the following functions. kamaji/internal/resources/resource.go Lines 23 to 31 in d8dfc62
The function kamaji/internal/resources/addons/coredns.go Lines 77 to 79 in d8dfc62
For the given CoreDNS, we're just checking if the Specification addons are set to nil, but this is not efficient and not idempotent. Since the TenantControlPlane API is storing the status, we could rely on a different condition here, such as: return tcp.Spec.Addons.CoreDNS == nil && tcp.Status.Addons.CoreDNS.Enabled The said condition should be true when CoreDNS is disabled in the Upon completion of the deletion here with an kamaji/internal/resources/addons/coredns.go Lines 186 to 191 in d8dfc62
The same logic could be used for the other addons, maybe we could have some trouble with the konnectivity one since it is much more complicated. |
92914e0
to
9af6d24
Compare
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.
About the maps, you can take advantage of the utilities.MergeMaps
function:
e.g.:
d.SetLabels(utilities.MergeMaps(d.GetLabels(), map[string]string{"constants.ProjectNameLabelKey": constants.ProjectNameLabelValue}))
It must be applied to all the objects, but it's going to be a one-liner and much easier to read, IMO.
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.
LGTM, feel free to convert it to Ready for review so we can get this merged
A bug has been introduced with clastix#527 which doesn't handle properly all the required business logic, such as the application of customised labels, as well as the handling of the controller Resource. Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
A bug has been introduced with clastix#527 which doesn't handle properly all the required business logic, such as the application of customised labels, as well as the handling of the controller Resource. Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
A bug has been introduced with #527 which doesn't handle properly all the required business logic, such as the application of customised labels, as well as the handling of the controller Resource. Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
This is still a draft