diff --git a/pkg/utils/kube/kube.go b/pkg/utils/kube/kube.go index f7753a7c1..cca3419bd 100644 --- a/pkg/utils/kube/kube.go +++ b/pkg/utils/kube/kube.go @@ -137,6 +137,14 @@ func GetAppInstanceLabel(un *unstructured.Unstructured, key string) string { return "" } +// GetAppInstanceAnnotation returns the application instance name from annotations +func GetAppInstanceAnnotation(un *unstructured.Unstructured, key string) string { + if annotations := un.GetAnnotations(); annotations != nil { + return annotations[key] + } + return "" +} + // UnsetLabel removes our app labels from an unstructured object func UnsetLabel(target *unstructured.Unstructured, key string) { if labels := target.GetLabels(); labels != nil {