Skip to content

Commit

Permalink
Don't update status for default profile (#1434) (#1435)
Browse files Browse the repository at this point in the history
  • Loading branch information
khewonc authored Sep 24, 2024
1 parent 72adb95 commit 26596ea
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions internal/controller/datadogagent/controller_reconcile_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,14 @@ func (r *Reconciler) updateStatusIfNeededV2(logger logr.Logger, agentdeployment
}

func (r *Reconciler) updateDAPStatus(logger logr.Logger, profile *datadoghqv1alpha1.DatadogAgentProfile) {
if err := r.client.Status().Update(context.TODO(), profile); err != nil {
if apierrors.IsConflict(err) {
logger.V(1).Info("unable to update DatadogAgentProfile status due to update conflict")
// update dap status for non-default profiles only
if !agentprofile.IsDefaultProfile(profile.Namespace, profile.Name) {
if err := r.client.Status().Update(context.TODO(), profile); err != nil {
if apierrors.IsConflict(err) {
logger.V(1).Info("unable to update DatadogAgentProfile status due to update conflict")
}
logger.Error(err, "unable to update DatadogAgentProfile status")
}
logger.Error(err, "unable to update DatadogAgentProfile status")
}
}

Expand Down

0 comments on commit 26596ea

Please sign in to comment.