From a2c229916aafb8fc672bb3c2b3fb1003d24084f7 Mon Sep 17 00:00:00 2001
From: Micah Nagel <micah.nagel@parsons.com>
Date: Fri, 1 Oct 2021 21:13:51 +0000
Subject: [PATCH] Go Template instead of grep/awk/xargs for Kiali Token

---
 docs/guides/using_bigbang/default_credentials.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/guides/using_bigbang/default_credentials.md b/docs/guides/using_bigbang/default_credentials.md
index 1955dfb800..9db4a96147 100644
--- a/docs/guides/using_bigbang/default_credentials.md
+++ b/docs/guides/using_bigbang/default_credentials.md
@@ -16,7 +16,7 @@ The applications in the table below provide both SSO and built in auth. The tabl
 
 | Package (Application) | Default Username | Default Password | Additional Notes |
 | --------------------- | ---------------- | ---------------- | ---------------- |
-| Kiali | N/A | (randomly generated) | Use `kubectl get secret -n kiali \| grep kiali-service-account-token \| awk '{print $1}' \| xargs kubectl get secret -n kiali -o go-template='{{.data.token \| base64decode}}'` to get the token |
+| Kiali | N/A | (randomly generated) | Use `kubectl get secret -n kiali -o go-template='{{range $secret := .items}}{{with $secret.metadata.annotations}}{{with (index . "kubernetes.io/service-account.name")}}{{if eq . "kiali-service-account"}}{{$secret.data.token \| base64decode}}{{end}}{{end}}{{end}}{{end}}'` to get the token |
 | Logging (Kibana) | `elastic` | (randomly generated) | Use `kubectl get secrets -n logging logging-ek-es-elastic-user -o go-template='{{.data.elastic \| base64decode}}'` to get the password |
 | Monitoring (Grafana) | `admin` | `prom-operator` | Default password can be overridden with Helm values `monitoring.values.grafana.adminPassword` |
 | Twistlock | N/A | N/A | Prompted to setup an admin account when you first hit the virtual service, no default user |
-- 
GitLab