Skip to content

Commit

Permalink
Addressing golint findings
Browse files Browse the repository at this point in the history
  • Loading branch information
locohamster committed Sep 3, 2024
1 parent 711d1f0 commit 0549051
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/controllers/issuer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (r *IssuerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
}
}

if err := NCMCfg.Validate(); err != nil {
if err = NCMCfg.Validate(); err != nil {
// if the resource contidion has not changed, stop reconciling until updated
if IssuerHasConditionAndReasonAndMessage(*issuerStatus, ncmv1.IssuerCondition{
Type: ncmv1.IssuerConditionReady,
Expand All @@ -135,7 +135,7 @@ func (r *IssuerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
}) {
return ctrl.Result{}, nil
}
_ = r.SetStatus(ctx, issuer, ncmv1.ConditionFalse, ncmv1.ReasonError, err.Error())
_ = r.SetStatus(ctx, issuer, ncmv1.ConditionFalse, ncmv1.ReasonError, "%s", err.Error())
return ctrl.Result{}, err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func IssuerHasCondition(status ncmv1.IssuerStatus, c ncmv1.IssuerCondition) bool

// IssuerHasCondition will return true if the given issuer has a
// condition matching the provided IssuerCondition.
// The Status, Reason and Message will be used for comparison
// The Status, Reason and Message will be used for comparison.
func IssuerHasConditionAndReasonAndMessage(status ncmv1.IssuerStatus, c ncmv1.IssuerCondition) bool {
existingConditions := status.Conditions
for _, cond := range existingConditions {
Expand Down

0 comments on commit 0549051

Please sign in to comment.