From b39509f874bbee8f86fa9e52384fd7832ceb968d Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 15 Apr 2024 16:44:34 +0200 Subject: [PATCH] Try using a clientset --- internal/controllers/environments.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/controllers/environments.go b/internal/controllers/environments.go index 3e8eed9..bf28567 100644 --- a/internal/controllers/environments.go +++ b/internal/controllers/environments.go @@ -154,7 +154,10 @@ func (env *Environemnt) ListEnvs(ctx context.Context) ([]string, error) { if err != nil { return []string{}, err } - secrets, err := clientset.CoreV1().Secrets("").List(context.TODO(), metav1.ListOptions{LabelSelector: "kind=environment" }) + secrets, err := clientset.CoreV1().Secrets(env.UserID).List(context.TODO(), metav1.ListOptions{LabelSelector: "kind=environment" }) + if err != nil { + return []string{}, err + } result := []string{} for _, env := range secrets.Items {