-
Notifications
You must be signed in to change notification settings - Fork 605
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: Dex resource cleanup when .spec.dex & DISABLE_DEX is set #922
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The secret reconciliation code doesn't respect DISABLE_DEX env var causing the entire resource reconciliation loop to break sometimes due to which the dex resources are not cleaned up properly. Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
ishitasequeira
approved these changes
Jun 1, 2023
jaideepr97
reviewed
Jun 1, 2023
Great catch @svghadi ! |
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
svghadi
added a commit
to svghadi/argocd-operator
that referenced
this pull request
Jun 12, 2023
…oj-labs#922) * Fix reconciliation when deprecated DISABLE_DEX & .spec.dex are set The secret reconciliation code doesn't respect DISABLE_DEX env var causing the entire resource reconciliation loop to break sometimes due to which the dex resources are not cleaned up properly. --------- Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
svghadi
added a commit
to svghadi/argocd-operator
that referenced
this pull request
Jun 12, 2023
…oj-labs#922) * Fix reconciliation when deprecated DISABLE_DEX & .spec.dex are set The secret reconciliation code doesn't respect DISABLE_DEX env var causing the entire resource reconciliation loop to break sometimes due to which the dex resources are not cleaned up properly. --------- Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
This was referenced Jun 12, 2023
jaideepr97
pushed a commit
that referenced
this pull request
Jun 13, 2023
…931) * Fix reconciliation when deprecated DISABLE_DEX & .spec.dex are set The secret reconciliation code doesn't respect DISABLE_DEX env var causing the entire resource reconciliation loop to break sometimes due to which the dex resources are not cleaned up properly. --------- Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
jaideepr97
pushed a commit
that referenced
this pull request
Jun 13, 2023
…932) * Fix reconciliation when deprecated DISABLE_DEX & .spec.dex are set The secret reconciliation code doesn't respect DISABLE_DEX env var causing the entire resource reconciliation loop to break sometimes due to which the dex resources are not cleaned up properly. --------- Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind bug
What does this PR do / why we need it:
The secret reconciliation code doesn't respect
DISABLE_DEX
env var causing the entire resource reconciliation loop to sometimes break due to which the dex resources are not cleaned up properly. This happens mainly when a dex deployment exists(configured using.spec.dex
) and is disabled usingDISABLE_DEX=true
. The sso reconciliation code doesn’t handle deletion in such case,argocd-operator/controllers/argocd/sso.go
Lines 133 to 136 in 19b9bdc
argocd-operator/controllers/argocd/util.go
Lines 717 to 771 in 19b9bdc
"error": "ServiceAccount \"argocd-argocd-dex-server\" not found"
causing entire loop to break.This PR fixes the issue by ensuring secret reconciliation considers
DISABLE_DEX
env var while reconciling secrets so that reconciliation loop doesn't break due to already deleted dex service account.Which issue(s) this PR fixes:
Fixes #920
How to test changes / Special notes to the reviewer:
Build operator image
Testing
k3d cluster create test --servers 3
make deploy IMG=quay.io/svghadi/argocd-operator:dex-fix
kubectl -n argocd-operator-system get all
DISABLE_DEX
env varDirectly patch operator controller to simulate update made by operator subscription
kubectl -n argocd-operator-system set env deployment.apps/argocd-operator-controller-manager DISABLE_DEX="true"
Should not contain
ServiceAccount \"argocd-argocd-dex-server\" not found
errors.kubectl get deployments,services,sa,roles,rolebindings