Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added env variable to remove managed-by label on argocd instance deletion #650

Conversation

ciiay
Copy link
Collaborator

@ciiay ciiay commented May 13, 2022

What type of PR is this?
/kind enhancement

What does this PR do / why we need it:
This PR introduces a new environment variable "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION", and changes the default behave on namespace with "managed-by" label when the target Argo CD instance gets removed by the gitops-operator. By default, when the Argo CD instance with the target namespace gets deleted, the namespace keeps "managed-by" label value. Only when "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION" is set to "true" in the Subscription config, it will remove the "managed-by" label on Argo CD deletion.

Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/GITOPS-1826

How to test changes / Special notes to the reviewer:

Without "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION" set to "true" in argocd-operator Subscription

  1. Install argocd-operator with namespace A and create an Argo CD instance
  2. Create a new namespace B and set "argocd.argoproj.io/managed-by: " label
  3. Delete the Argo CD instance with namespace A
  4. Check the new namespace B and see if it still has the "managed-by" label which sets to namespace A

With "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION" set to "true" in argocd-operator Subscription

  1. Same as 1 from above process
  2. Edit Subscription of argocd-operator as below
...
spec:
...
  config:
    env:
      - name: REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION
        value: 'true'
...
  1. Same as 2 -3 from above process
  2. Check the new namespace B and see the "managed-by" label no longer exists

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.

Please update the documentation.

@ciiay ciiay requested a review from wtam2018 May 13, 2022 19:13
Copy link
Collaborator

@jannfis jannfis 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 @ciiay.

@jannfis jannfis changed the title GITOPS-1826: added env variable to remove managed-by label on argocd instance deletion feat added env variable to remove managed-by label on argocd instance deletion May 17, 2022
@jannfis jannfis changed the title feat added env variable to remove managed-by label on argocd instance deletion feat: added env variable to remove managed-by label on argocd instance deletion May 17, 2022
@jannfis jannfis merged commit b7e1d32 into argoproj-labs:master May 17, 2022
@ifaigenb
Copy link

In my org I do not have permissions to edit the subscription config but I need this fix as well.
Is it possible to add an option to edit this via the argocd instance object?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants