Skip to content

Commit

Permalink
Fix bug where ArgoCD removes nodePlacement stanza from configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Rizwana777 <[email protected]>
  • Loading branch information
Rizwana777 committed Jul 24, 2024
1 parent 13cd661 commit b4e2574
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions controllers/gitopsservice_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,12 @@ func (r *ReconcileGitopsService) reconcileDefaultArgoCDInstance(instance *pipeli
changed = true
}

if !reflect.DeepEqual(existingArgoCD.Spec.NodePlacement, defaultArgoCDInstance.Spec.NodePlacement) {
existingArgoCD.Spec.NodePlacement = defaultArgoCDInstance.Spec.NodePlacement
changed = true
// if user is patching nodePlacement through GitopsService CR, then existingArgoCD NodePlacement is updated.
if defaultArgoCDInstance.Spec.NodePlacement != nil {
if !reflect.DeepEqual(existingArgoCD.Spec.NodePlacement, defaultArgoCDInstance.Spec.NodePlacement) {
existingArgoCD.Spec.NodePlacement = defaultArgoCDInstance.Spec.NodePlacement
changed = true
}
}

if changed {
Expand Down

0 comments on commit b4e2574

Please sign in to comment.