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

fix: Helm repository deleted from argocd-cm when deleted from UI (Github Issue #1399) #2970

Merged
merged 11 commits into from
Mar 17, 2023

Conversation

Ash-exp
Copy link
Contributor

@Ash-exp Ash-exp commented Feb 15, 2023

Description

  1. If any of the helm-repository stops responding from server side or if we block access to it from our cluster, Argocd blocks all helm chart deployments until access to that repository is resolved. Hence we also have to delete the repository from the Argocd config-map.

  2. When updating a helm repository the repository name is not updated at the DB record and also the a new repository gets created at Argocd config-map instead of updating the previous one. Hence I modified the related functions accordingly.

Ticket AB 342
Fixes #1399

How Has This Been Tested?

    • Create a temporary helm repo and add it on Devtron and then remove the repo so that the repo doesn't exist anymore or block access to any existing helm repository url from cluster
    • Argocd will respond with errors if you deploy or update and deploy any helm chart from any repo
    • Delete the repo from Devtron UI
    • The error from argocd should get resolved as we have already deleted the repository using Devtron
  • Tested Manually
    • Create a temporary helm repo and add it on Devtron and then try to update only the repo name from UI
    • The updated name should reflect on UI and also the Argocd Config map should update the previous repo with the new name instead of creating a new entry with the updated name.
  • Tested Manually

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?


@Ash-exp Ash-exp added the bug Something isn't working label Feb 15, 2023
@Ash-exp Ash-exp self-assigned this Feb 15, 2023
@Ash-exp Ash-exp changed the title Helm repo delete from argo-cm bug: Helm repository deleted from argocd-cm when deleted from UI (Github Issue #1399) Feb 15, 2023
@Ash-exp Ash-exp changed the title bug: Helm repository deleted from argocd-cm when deleted from UI (Github Issue #1399) fix: Helm repository deleted from argocd-cm when deleted from UI (Github Issue #1399) Feb 15, 2023
helmRepoStr := data["helm.repositories"]
helmRepoByte, err := yaml.YAMLToJSON([]byte(helmRepoStr))
if err != nil {
panic(err)
Copy link
Member

Choose a reason for hiding this comment

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

dont use panic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated 👍

iamayushm
iamayushm previously approved these changes Mar 16, 2023
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 19 Code Smells

No Coverage information No Coverage information
36.3% 36.3% Duplication

@iamayushm iamayushm merged commit 21ab861 into main Mar 17, 2023
@iamayushm iamayushm deleted the bug-delete-helm-repo branch March 17, 2023 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm repository doesn't get deleted from argocd-cm when deleted from UI.
3 participants