Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Annotations set in application-set not updating apps #156

Merged
merged 3 commits into from Mar 16, 2021

Conversation

jgwest
Copy link
Member

@jgwest jgwest commented Mar 15, 2021

Fixes #154

The fix for this bug is the change to createOrUpdateInCluster in pkg/controllers/applicationset_controller.go, everything else in this PR is test updates to ensure the correctness of the fix (for both unit and E2E tests).

The bug occurred because:

  • The mutateFunction of createOrUpdateInCluster was not copying metadata fields.
  • The call to c.Get(...) in CreateOrUpdate(...) in createOrUpdate.go was not replacing the existing fields of the Application parameter that was passed in, causing the objects to appear equal (when they were not). Fix is to pass in a preinitialized argov1alpha1.Application{} value into utils.CreateOrUpdate(...). (It's unclear whether this is only an issue with the fakeclient, or a general problem, but in any case this is the fix.)

@jgwest jgwest marked this pull request as ready for review March 15, 2021 08:29
Copy link
Collaborator

@wtam2018 wtam2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
thanks @jgwest !

@jgwest jgwest merged commit c006736 into argoproj:master Mar 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

annotations set in application-set not updating apps
2 participants