Skip to content

Commit 26596ea

Browse files
authoredSep 24, 2024··
Don't update status for default profile (#1434) (#1435)
1 parent 72adb95 commit 26596ea

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
 

Diff for: ‎internal/controller/datadogagent/controller_reconcile_v2.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,14 @@ func (r *Reconciler) updateStatusIfNeededV2(logger logr.Logger, agentdeployment
267267
}
268268

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

0 commit comments

Comments
 (0)
Please sign in to comment.