Skip to content

Commit

Permalink
Align finalizer with Custom Resource Definition doc
Browse files Browse the repository at this point in the history
Per Custom Resource Definition docs [1], custom finalizer names
are expected to be in format "consist of a domain name, a forward
slash and the name of the finalizer" (e.g. foo.bar/name).

This aligns the finalizer provided by the helper to follow this
definition and uses openstack.org/<gkv.kind> (all lower case) as the
finalizer.

[1] https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#finalizers:~:text=Identifiers%20of%20custom%20finalizers%20consist%20of%20a%20domain%20name%2C%20a%20forward%20slash%20and%20the%20name%20of%20the%20finalizer

Signed-off-by: Martin Schuppert <[email protected]>
  • Loading branch information
stuggi committed Jun 18, 2024
1 parent 24529fc commit 029756d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/common/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package helper
import (
"context"
"encoding/json"
"strings"

"github.com/go-logr/logr"
"github.com/pkg/errors"
Expand Down Expand Up @@ -72,7 +73,7 @@ func NewHelper(obj client.Object, crClient client.Client, kclient kubernetes.Int
before: unstructuredObj,
beforeObject: obj.DeepCopyObject().(client.Object),
logger: log,
finalizer: gvk.Kind,
finalizer: strings.ToLower("openstack.org/" + gvk.Kind),
}, nil
}

Expand Down

0 comments on commit 029756d

Please sign in to comment.