File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
pkg/reconciler/apis/apibinding Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,18 @@ func UnmarshalResourceBindingsAnnotation(ann string) (ResourceBindingsAnnotation
7575 return rbs , nil
7676}
7777
78+ // GetResourceBindings reads ResourceBindingsAnnotation from LogicalCluster's annotation.
79+ func GetResourceBindings (lc * corev1alpha1.LogicalCluster ) (ResourceBindingsAnnotation , error ) {
80+ const jsonEmptyObj = "{}"
81+
82+ ann := lc .Annotations [ResourceBindingsAnnotationKey ]
83+ if ann == "" {
84+ ann = jsonEmptyObj
85+ }
86+
87+ return UnmarshalResourceBindingsAnnotation (ann )
88+ }
89+
7890// WithLockedResources tries to lock the resources for the given binding. It
7991// returns those resources that got successfully locked. If a resource is already
8092// locked by another binding, it is skipped and returned in the second return
You can’t perform that action at this time.
0 commit comments