Skip to content

Commit 0e288ea

Browse files
committed
Added note about passwords containing shell variables
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
1 parent edf7cc7 commit 0e288ea

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

docs/OpenShift GitOps CLI User Guide.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,11 @@ In the normal mode (default mode), the `argocd` CLI client makes API requests to
198198
```
199199
eg:
200200
```
201-
# argocd login --username admin --password ${ADMIN_PASSWD} openshift-gitops.openshift-gitops.apps-crc.testing
201+
# get the admin password and use it by enclosing in single quotes.
202+
# echo ${ADMIN_PASSWD}
203+
# argocd login --username admin --password '<password>' openshift-gitops.openshift-gitops.apps-crc.testing
202204
```
205+
**IMPORTANT** passwords can contain special characters like `$` which would be interpreted as shell variables. This can cause the command to fail as a wrong value (shell interpreted) of password would be sent to the server. Always use single quotes '' to enclose the actual value of the password to avoid such errors.
203206
3. Execute the argocd commands
204207
```
205208
# argocd [command or options] [arguments…​]
@@ -519,8 +522,11 @@ $ compinit
519522
```
520523
eg:
521524
```
522-
# argocd login --username admin --password ${ADMIN_PASSWD} openshift-gitops.openshift-gitops.apps-crc.testing
525+
# get the admin password and use it by enclosing in single quotes.
526+
# echo ${ADMIN_PASSWD}
527+
# argocd login --username admin --password '<password>' openshift-gitops.openshift-gitops.apps-crc.testing
523528
```
529+
**IMPORTANT** passwords can contain special characters like `$` which would be interpreted as shell variables. This can cause the command to fail as a wrong value (shell interpreted) of password would be sent to the server. Always use single quotes '' to enclose the actual value of the password to avoid such errors.
524530
3. Validate that you are able to run `argocd` commands in normal mode by executing the following command to list all Applications.
525531
```
526532
# argocd app list
@@ -626,8 +632,12 @@ $ compinit
626632
```
627633
eg:
628634
```
629-
# argocd login --username admin --password ${ADMIN_PASSWD} openshift-gitops.openshift-gitops.apps-crc.testing
635+
# get the admin password and use it by enclosing in single quotes.
636+
# echo ${ADMIN_PASSWD}
637+
# argocd login --username admin --password '<password>' openshift-gitops.openshift-gitops.apps-crc.testing
630638
```
639+
**IMPORTANT** passwords can contain special characters like `$` which would be interpreted as shell variables. This can cause the command to fail as a wrong value (shell interpreted) of password would be sent to the server. Always use single quotes '' to enclose the actual value of the password to avoid such errors.
640+
631641
3. If the argo application is created with manual sync policy, then the user has to trigger the sync operation manually. This can be done by using the `argocd` CLI in normal mode as below
632642
```
633643
# argocd app sync openshift-gitops/app-spring-petclinic
@@ -646,7 +656,7 @@ $ compinit
646656
```
647657
eg:
648658
```
649-
# oc login -u kubeadmin -p ${ADMIN_PASSWD} https://api.crc.testing:6443
659+
# oc login -u kubeadmin -p 'Qlr1Mq9y6bDHhB3F0JdCSXNAgjiTtG$X' https://api.crc.testing:6443
650660
```
651661
2. Check if the context is set correctly in the kubeconfig file
652662
```
@@ -686,8 +696,11 @@ $ compinit
686696
```
687697
eg:
688698
```
689-
# argocd login --username admin --password ${ADMIN_PASSWD} openshift-gitops.openshift-gitops.apps-crc.testing
699+
# get the admin password and use it by enclosing in single quotes.
700+
# echo ${ADMIN_PASSWD}
701+
# argocd login --username admin --password '<password>' openshift-gitops.openshift-gitops.apps-crc.testing
690702
```
703+
**IMPORTANT** passwords can contain special characters like `$` which would be interpreted as shell variables. This can cause the command to fail as a wrong value (shell interpreted) of password would be sent to the server. Always use single quotes '' to enclose the actual value of the password to avoid such errors.
691704
3. Validate that you are able to run `argocd` commands in normal mode by executing the following command to list all Applications.
692705
```
693706
# argocd app list
@@ -791,8 +804,11 @@ $ compinit
791804
```
792805
eg:
793806
```
794-
# argocd login --username admin --password ${ADMIN_PASSWD} openshift-gitops.openshift-gitops.apps-crc.testing
807+
# get the admin password and use it by enclosing in single quotes.
808+
# echo ${ADMIN_PASSWD}
809+
# argocd login --username admin --password '<password>' openshift-gitops.openshift-gitops.apps-crc.testing
795810
```
811+
**IMPORTANT** passwords can contain special characters like `$` which would be interpreted as shell variables. This can cause the command to fail as a wrong value (shell interpreted) of password would be sent to the server. Always use single quotes '' to enclose the actual value of the password to avoid such errors.
796812
3. If the argo application is created with manual sync policy, then the user has to trigger the sync operation manually. This can be done by using the `argocd` CLI in normal mode as below
797813
```
798814
# argocd app sync openshift-gitops/cluster-configs

0 commit comments

Comments
 (0)