Skip to content

Commit

Permalink
Fix defaultOverride status update (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
clamoriniere committed Aug 3, 2021
1 parent 1ded384 commit 1e43add
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/datadogagent/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ type reconcileFuncInterface func(logger logr.Logger, dda *datadoghqv1alpha1.Data
func (r *Reconciler) updateOverrideIfNeeded(logger logr.Logger, agentdeployment *datadoghqv1alpha1.DatadogAgent, newOverride *datadoghqv1alpha1.DatadogAgentStatus, result reconcile.Result) (*datadoghqv1alpha1.DatadogAgent, reconcile.Result, error) {
// We returned the most up to date instance to avoid conflict during the updateStatusIfNeeded after all the reconcile cycles.
updateAgentDeployment := agentdeployment.DeepCopy()
if !apiequality.Semantic.DeepEqual(agentdeployment.Status.DefaultOverride, newOverride) {
if !apiequality.Semantic.DeepEqual(agentdeployment.Status.DefaultOverride, newOverride.DefaultOverride) {
updateAgentDeployment.Status.DefaultOverride = newOverride.DefaultOverride
if err := r.client.Status().Update(context.TODO(), updateAgentDeployment); err != nil {
if apierrors.IsConflict(err) {
Expand Down

0 comments on commit 1e43add

Please sign in to comment.