From 88f337386da3e5b1286b653a3f066ff23f9ff35c Mon Sep 17 00:00:00 2001 From: Jonatas Baldin Date: Thu, 7 Jan 2021 17:36:25 +0100 Subject: [PATCH] Add GetNamespacedName to GenericStore interface --- api/v1alpha1/generic_store.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/v1alpha1/generic_store.go b/api/v1alpha1/generic_store.go index 85d833aa8..0b4f9475d 100644 --- a/api/v1alpha1/generic_store.go +++ b/api/v1alpha1/generic_store.go @@ -15,6 +15,8 @@ limitations under the License. package v1alpha1 import ( + "fmt" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) @@ -30,6 +32,7 @@ type GenericStore interface { runtime.Object metav1.Object GetProvider() *SecretStoreProvider + GetNamespacedName() string } // +kubebuilder:object:root:false @@ -41,6 +44,10 @@ func (c *SecretStore) GetProvider() *SecretStoreProvider { return c.Spec.Provider } +func (c *SecretStore) GetNamespacedName() string { + return fmt.Sprintf("%s/%s", c.Namespace, c.Name) +} + // Copy returns a DeepCopy of the Store. func (c *SecretStore) Copy() GenericStore { return c.DeepCopy()