From 62cecfacf554b94a44ccd647b61a218ed1e27fec Mon Sep 17 00:00:00 2001 From: ntishchauhan0022 Date: Mon, 12 Jun 2023 14:51:54 +0530 Subject: [PATCH] adding the missed part Signed-off-by: ntishchauhan0022 --- pkg/k8s/serviceaccount.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pkg/k8s/serviceaccount.go diff --git a/pkg/k8s/serviceaccount.go b/pkg/k8s/serviceaccount.go new file mode 100644 index 0000000000..e1e344376b --- /dev/null +++ b/pkg/k8s/serviceaccount.go @@ -0,0 +1,19 @@ +package k8s + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func GetServiceAccount(ctx context.Context, referencedServiceAccount, namespace string) error { + k8sClient, err := NewKubernetesClientset() + if err != nil { + return err + } + _,err = k8sClient.CoreV1().ServiceAccounts(namespace).Get(ctx, referencedServiceAccount, metav1.GetOptions{}) + if err != nil { + return err + } + return nil +}