Skip to content

Commit

Permalink
controllers/datadogagent: simplify needUpdate assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
davidor committed Aug 10, 2021
1 parent 355245f commit d50177b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions controllers/datadogagent/clusteragent.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ func (r *Reconciler) updateClusterAgentDeployment(logger logr.Logger, dda *datad
return reconcile.Result{}, err
}

var needUpdate bool
if !comparison.IsSameSpecMD5Hash(hash, dca.GetAnnotations()) {
needUpdate = true
}
needUpdate := !comparison.IsSameSpecMD5Hash(hash, dca.GetAnnotations())

updateStatusWithClusterAgent(dca, newStatus, nil)

Expand Down
5 changes: 1 addition & 4 deletions controllers/datadogagent/clusterchecksrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,7 @@ func (r *Reconciler) updateClusterChecksRunnerDeployment(logger logr.Logger, dda
return reconcile.Result{}, err
}

var needUpdate bool
if !comparison.IsSameSpecMD5Hash(hash, dep.GetAnnotations()) {
needUpdate = true
}
needUpdate := !comparison.IsSameSpecMD5Hash(hash, dep.GetAnnotations())

updateStatusWithClusterChecksRunner(dep, newStatus, nil)

Expand Down

0 comments on commit d50177b

Please sign in to comment.