You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However ContainsFinalizer seems to be overkill as AddFinalizer function do the same check inside and it will not add the finalizer once it is already there:
func AddFinalizer(o client.Object, finalizer string) (finalizersUpdated bool) {
f := o.GetFinalizers()
for _, e := range f {
if e == finalizer {
return false
}
}
o.SetFinalizers(append(f, finalizer))
return true
}
I would like to remove ContainsFinalizer as it is not needed and update documentation. Before doing so please comment if my reasoning is fine.
Extra Labels
No response
The text was updated successfully, but these errors were encountered:
The CronJob examples should follow the same design approach as the Deploy Image plugin. That means they should be scaffolded in a similar way, with modifications to implement CronJob-specific logic instead of managing an image.
What do you want to happen?
I wonder why in the cronjob example there is a condition to check if cronjob contains finalizer and if so add it. See:
kubebuilder/docs/book/src/cronjob-tutorial/testdata/finalizer_example.go
Line 69 in 93a0823
However
ContainsFinalizer
seems to be overkill asAddFinalizer
function do the same check inside and it will not add the finalizer once it is already there:I would like to remove
ContainsFinalizer
as it is not needed and update documentation. Before doing so please comment if my reasoning is fine.Extra Labels
No response
The text was updated successfully, but these errors were encountered: