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

Docs: Update Dex config, change misleading error message. #11208

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/operator-manual/user-management/google.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ Go through the same steps as in [OpenID Connect using Dex](#openid-connect-using
apiVersion: v1
kind: Secret
metadata:
labels:
Copy link
Member

Choose a reason for hiding this comment

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

Hi @EladLeev Can you please explain what was the impact of not having this before ?

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for taking a look at this PR @iam-veeramalla!

Without this label, ArgoCD won't consider this secret as part of ArgoCD, and won't read it at all.
Correct me if I'm wrong, but using this label, argo select and parse related secrets.
Without it, Argo will just use the default secret (argocd-secret).

This also relates to the rest of the changes that I've made - when this label is absent, and you are referring to a different secret (using $<k8s_secret_name>:<key>) the error that you'll get is -

config referenced '%s', but the key does not exist in secret

Which is a bit misleading as you are not really reading that secret and not finding the key.

side note: I think that it's better to add validations and a custom errors when referring to a secret that is not labelled, but I didn't want to make too many changes to settings.go on my first contribution 😅

app.kubernetes.io/part-of: argocd
name: argocd-google-groups-json
namespace: argocd
data:
Expand Down Expand Up @@ -211,7 +213,7 @@ Go through the same steps as in [OpenID Connect using Dex](#openid-connect-using
defaultMode: 420
secretName: argocd-google-groups-json

3. Edit `argocd-cm` and add the following `dex.config` to the data section, replacing `clientID` and `clientSecret` with the values you saved before, `adminEmail` with the address for the admin user you're going to impersonate, and editing `redirectURI` with your Argo CD domain:
3. Edit `argocd-cm` and add the following `dex.config` to the data section, replacing `clientID` and `clientSecret` with the oidc account values you saved before, `adminEmail` with the address for the admin user you're going to impersonate, and editing `redirectURI` with your Argo CD domain:

dex.config: |
connectors:
Expand Down
2 changes: 1 addition & 1 deletion docs/operator-manual/user-management/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Edit the argocd-cm configmap:
kubectl edit configmap argocd-cm -n argocd
```

* In the `url` key, input the base URL of Argo CD. In this example, it is `https://argocd.example.com`
* In the `url` key, input the base URL of Argo CD. In this example, it is `https://argocd.example.com`. This step is mandatory in order to enable Dex and load the configurations.
* In the `dex.config` key, add the `github` connector to the `connectors` sub field. See Dex's
[GitHub connector](https://github.com/dexidp/website/blob/main/content/docs/connectors/github.md)
documentation for explanation of the fields. A minimal config should populate the clientID,
Expand Down
2 changes: 1 addition & 1 deletion util/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -2077,7 +2077,7 @@ func ReplaceStringSecret(val string, secretValues map[string]string) string {
secretKey := val[1:]
secretVal, ok := secretValues[secretKey]
if !ok {
log.Warnf("config referenced '%s', but key does not exist in secret", val)
log.Warnf("config referenced '%s', but key does not exist in secret, or secret is not annotated as part of argocd.", val)
return val
}
return strings.TrimSpace(secretVal)
Expand Down