goss.yaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Copyright Broadcom, Inc. All Rights Reserved.
  2. # SPDX-License-Identifier: APACHE-2.0
  3. http:
  4. # For this test to work, the pod should have the proper label to allow ingress
  5. # traffic as per the NetworkPolicy
  6. http://jupyterhub-hub:{{ .Vars.hub.service.ports.http }}/hub/health:
  7. status: 200
  8. http://jupyterhub-proxy-api:{{ .Vars.proxy.service.api.ports.http }}:
  9. status: 404
  10. file:
  11. /etc/jupyterhub:
  12. exists: true
  13. filetype: directory
  14. mode: "0755"
  15. owner: root
  16. /etc/jupyterhub/jupyterhub_config.py:
  17. exists: true
  18. filetype: file
  19. mode: "0644"
  20. owner: root
  21. contents:
  22. - /hub_container_port.*{{ .Vars.hub.containerPorts.http }}/
  23. /usr/local/etc/jupyterhub/secret/values.yaml:
  24. exists: true
  25. filetype: symlink
  26. mode: "0777"
  27. owner: root
  28. contents:
  29. - "postgresql://{{ .Vars.postgresql.auth.username }}@jupyterhub-postgresql:{{ .Vars.postgresql.service.ports.postgresql }}/{{ .Vars.postgresql.auth.database }}"
  30. - /type.*dynamic/
  31. command:
  32. {{- $uid := .Vars.hub.containerSecurityContext.runAsUser }}
  33. {{- $gid := .Vars.hub.podSecurityContext.fsGroup }}
  34. check-user-info:
  35. # The UID and GID should always be either the one specified as vars (always a bigger number that the default)
  36. # or the one randomly defined by openshift (larger values). Otherwise, the chart is still using the default value.
  37. exec: if [ $(id -u) -lt {{ $uid }} ] || [ $(id -G | awk '{print $2}') -lt {{ $gid }} ]; then exit 1; fi
  38. exit-status: 0
  39. {{ if .Vars.hub.serviceAccount.automountServiceAccountToken }}
  40. check-sa:
  41. 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
  42. exit-status: 0
  43. stdout:
  44. - /serviceaccount.*name.*{{.Env.BITNAMI_APP_NAME }}/
  45. {{ end }}