goss.yaml 904 B

123456789101112131415161718
  1. # Copyright Broadcom, Inc. All Rights Reserved.
  2. # SPDX-License-Identifier: APACHE-2.0
  3. command:
  4. {{- $uid := .Vars.containerSecurityContext.runAsUser }}
  5. {{- $gid := .Vars.podSecurityContext.fsGroup }}
  6. check-user-info:
  7. # The UID and GID should always be either the one specified as vars (always a bigger number that the default)
  8. # or the one randomly defined by openshift (larger values). Otherwise, the chart is still using the default value.
  9. exec: if [ $(id -u) -lt {{ $uid }} ] || [ $(id -G | awk '{print $2}') -lt {{ $gid }} ]; then exit 1; fi
  10. exit-status: 0
  11. {{ if .Vars.automountServiceAccountToken }}
  12. check-sa:
  13. exec: cat /var/run/secrets/kubernetes.io/serviceaccount/token | cut -d '.' -f 2 | xargs -I '{}' echo '{}====' | fold -w 4 | sed '$ d' | tr -d '\n' | base64 -d
  14. exit-status: 0
  15. stdout:
  16. - /serviceaccount.*name.*{{.Env.BITNAMI_APP_NAME }}/
  17. {{ end }}