Skip to content

Commit

Permalink
removed exists variable
Browse files Browse the repository at this point in the history
  • Loading branch information
iastewar committed Nov 29, 2022
1 parent d27107e commit 81aabd8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,15 @@ func createPullSecret(clientset *kubernetes.Clientset, ns *corev1.Namespace, cre
secrets := clientset.CoreV1().Secrets(ns.Name)

// check if gcp-auth secret already exists
exists := false
secList, err := secrets.List(context.TODO(), metav1.ListOptions{})
if err != nil {
return err
}
for _, s := range secList.Items {
if s.Name == gcpAuth {
exists = true
break
return nil
}
}
if exists {
return nil
}

token, err := creds.TokenSource.Token()
if err != nil {
Expand Down

0 comments on commit 81aabd8

Please sign in to comment.