[eno] Adding logic for force cleanup composition#564
[eno] Adding logic for force cleanup composition#564ruinan-liu wants to merge 2 commits intomainfrom
Conversation
| } | ||
|
|
||
| // If a label is present, it must be "addon". Any non-addon value (e.g. "ccp") disqualifies. | ||
| if hasAKS && aksLabel != addOnLabelValue { |
There was a problem hiding this comment.
hasAKS can be removed here.
There was a problem hiding this comment.
Thanks Allan, I don't think we can safely remove hasAKS or hasOverlay here. Since a composition only has one of the two labels, the absent label will return "" from the map lookup. Without the guards, "" != addon and will return false even when the present label is correctly set to "addon".
However I have simplfied the helper function to only check
return labels[AKSComponentLabel] == addOnLabelValue || labels[OverlayComponentLabel] == addOnLabelValue
Which I think is sufficient and have updated the code.
Thanks
ruinan-liu
left a comment
There was a problem hiding this comment.
Replied to comment
| ) | ||
|
|
||
| const ( | ||
| AKSComponentLabel = "aks.azure.com/component-type" |
There was a problem hiding this comment.
These are aks specific labels. We shouldn't hard code it in the Eno platform which is supposed to be generic.
There was a problem hiding this comment.
I am thinking whether we should handle it in overlay-reconciler-synth instead of here.
we will force remove a finalizer of a composition if and only if
"aks.azure.com/component-type":addonor the composition has label"eno.azure.io/overlaymgr-component-type":addonAND