Skip to content

Commit

Permalink
Removed found
Browse files Browse the repository at this point in the history
Signed-off-by: PrimalPimmy <[email protected]>
  • Loading branch information
PrimalPimmy committed Jul 17, 2024
1 parent fbbc951 commit a9eb6e4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions controllers/pkg/reconcilers/spire-bootstrap/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,11 @@ func (r *reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
fmt.Println("Error creating K8s", err)
}

found := false
for _, secret := range secrets.Items {
if strings.Contains(secret.GetName(), cl.Name) {
secret := secret // required to prevent gosec warning: G601 (CWE-118): Implicit memory aliasing in for loop
clusterClient, ok := cluster.Cluster{Client: r.Client}.GetClusterClient(&secret)
if ok {
found = true
clusterClient, ready, err := clusterClient.GetClusterClient(ctx)
if err != nil {
msg := "cannot get clusterClient"
Expand Down Expand Up @@ -222,10 +220,7 @@ func (r *reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
}
}
}
if found {
// speeds up the loop
break
}

}

return reconcile.Result{}, nil
Expand Down

0 comments on commit a9eb6e4

Please sign in to comment.