Try using a clientset
This commit is contained in:
parent
b39509f874
commit
43afce4b63
@ -154,12 +154,14 @@ func (env *Environemnt) ListEnvs(ctx context.Context) ([]string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return []string{}, err
|
return []string{}, err
|
||||||
}
|
}
|
||||||
secrets, err := clientset.CoreV1().Secrets(env.UserID).List(context.TODO(), metav1.ListOptions{LabelSelector: "kind=environment" })
|
//secrets, err := clientset.CoreV1().Secrets(env.UserID).List(ctx, metav1.ListOptions{LabelSelector: "kind=environment"})
|
||||||
|
secrets, err := clientset.CoreV1().Secrets(env.UserID).List(ctx, metav1.ListOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []string{}, err
|
return []string{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result := []string{}
|
result := []string{}
|
||||||
|
log.Println(secrets)
|
||||||
for _, env := range secrets.Items {
|
for _, env := range secrets.Items {
|
||||||
result = append(result, env.Name)
|
result = append(result, env.Name)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user