-
Notifications
You must be signed in to change notification settings - Fork 554
fix: argocd-cm empty data label nil pointer fix #3443
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
Conversation
|
To fix the "nil pointer" issue related to the empty data label in ArgoCD ConfigMap (argocd-cm), you can follow these steps: Step1Locate the ConfigMap definition: Step2 Edit the ConfigMap YAML: Step3 Update the YAML file: Step4 Apply the updated ConfigMap: Please note that modifying the ArgoCD ConfigMap should be done with caution, as it can affect the behavior and configuration of your ArgoCD installation. It's recommended to back up the existing ConfigMap and test the changes in a non-production environment before applying them to a production cluster. |
|
Kudos, SonarCloud Quality Gate passed!
|
|
Thanks a lot |
* config map data nil pointer fix * check for nil config map * creating secret for public chart repo * delete chart repo based on it's presence in argocd-cm * code for unique chart name while adding a chart repo * secret creation doesn't support uppercase letters hence adding checks * minor change * minor fix








Description
When data label in argocd-cm is not present then a new chart repo is not getting added and throws nil pointer as we append the chart repo details in argocd-cm, cm.Data is nil and later this map was being used to set a value in one of it's key, hence throwing nil pointer
Fixes #3491
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Tested Locally
Tested by deploying in my cluster
Test Scenarios:-
Test Scenarios after code refactoring:-
1. Create new chart repo, check secret is being created or not, and it must not get stored in argocd-cm and check on argocd as well it must get registered there, also try saving same chart url and see if it affect the pre-deployed apps, in this case it's working fine.
2. Create new chart repo with same name as existing names, it should now show toast as this chart name exist.
3. After creating new public chart repo, check by deploying few charts from that repo, using gitops/helm both are working fine.
4. Check for private charts, existing behaviour is expected for private chart, except when new private chart with same name as existing ones is added it must throw toast error.
5. Update any pre-existing chart, it's updated value should get updated in argocd-cm, and after updating any newly added chart repo it's updated value should get patched in it's corresponding secret.
6. Try deleting chart repo, for pre-existing chart repos whose entry is in argocd-cm , that entry must get deleted and for newly added chart the corresponding secret should get deleted.
7. For pre-existing charts deployed, check it's behaviour if a new repo is added with the same url but with diff chart name.
8. Check an deployed chart behaviour via argocd after deleting the repo entry from argocd-cm and after deleting the secret as well (syncing must happen from github repo in argocd which is working correctly).
9. Try saving chart repo with uppercase names and lowercase names since secret creation doesn't support uppercase chart names.
Checklist:
Does this PR introduce a user-facing change?