We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ed1c5d9 + f53d2c3 commit 6bf7b0bCopy full SHA for 6bf7b0b
pkg/controller/types/types.go
@@ -37,5 +37,17 @@ type ReconcileKey struct {
37
}
38
39
func (r ReconcileKey) String() string {
40
+ if r.Namespace == "" {
41
+ return r.Name
42
+ }
43
return r.Namespace + "/" + r.Name
44
45
+
46
+// ParseReconcileKey returns the ReconcileKey that has been encoded into a string.
47
+func ParseReconcileKey(key string) (ReconcileKey, error) {
48
+ namespace, name, err := cache.SplitMetaNamespaceKey(key)
49
+ if err != nil {
50
+ return ReconcileKey{}, err
51
52
+ return ReconcileKey{Name: name, Namespace: namespace}, nil
53
+}
0 commit comments