Skip to content

Commit

Permalink
fix: Dex resource cleanup when .spec.dex & DISABLE_DEX is set (#922)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
svghadi authored Jun 2, 2023
1 parent e09a8ee commit 9b15d52
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions controllers/argocd/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
argopass "github.com/argoproj/argo-cd/v2/util/password"
tlsutil "github.com/operator-framework/operator-sdk/pkg/tls"

"github.com/argoproj-labs/argocd-operator/api/v1alpha1"
argoprojv1a1 "github.com/argoproj-labs/argocd-operator/api/v1alpha1"
"github.com/argoproj-labs/argocd-operator/common"
"github.com/argoproj-labs/argocd-operator/controllers/argoutil"
Expand Down Expand Up @@ -184,7 +183,7 @@ func (r *ReconcileArgoCD) reconcileArgoSecret(cr *argoprojv1a1.ArgoCD) error {
common.ArgoCDKeyTLSPrivateKey: tlsSecret.Data[common.ArgoCDKeyTLSPrivateKey],
}

if cr.Spec.Dex != nil || (cr.Spec.SSO != nil && cr.Spec.SSO.Provider == v1alpha1.SSOProviderTypeDex) {
if UseDex(cr) {
dexOIDCClientSecret, err := r.getDexOAuthClientSecret(cr)
if err != nil {
return nil
Expand Down Expand Up @@ -334,7 +333,7 @@ func (r *ReconcileArgoCD) reconcileExistingArgoSecret(cr *argoprojv1a1.ArgoCD, s
changed = true
}

if cr.Spec.Dex != nil || (cr.Spec.SSO != nil && cr.Spec.SSO.Provider == v1alpha1.SSOProviderTypeDex) {
if UseDex(cr) {
dexOIDCClientSecret, err := r.getDexOAuthClientSecret(cr)
if err != nil {
return err
Expand Down

0 comments on commit 9b15d52

Please sign in to comment.