Skip to content

Commit

Permalink
Adding logging for pullsecret controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanjana Lawande committed Jun 4, 2024
1 parent 6a973ea commit ad51756
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/operator/controllers/pullsecret/pullsecret_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,18 @@ func (r *Reconciler) ensureGlobalPullSecret(ctx context.Context, operatorSecret,
// allows for simpler logic flow, when delete and create are not handled separately
// this call happens only when there is a need to change, it has no significant impact on performance
err := r.client.Delete(ctx, secret)
r.log.Info("Pullsecret Not Found, Creating Again")
if err != nil && !kerrors.IsNotFound(err) {
return nil, err
}

err = r.client.Create(ctx, secret)
r.log.Info("Pullsecret Created")
return secret, err
}

err = r.client.Update(ctx, secret)
r.log.Info("Updating Existing Pullsecret")
return secret, err
}

Expand Down

0 comments on commit ad51756

Please sign in to comment.