|
84 | 84 | exit 1 |
85 | 85 | fi |
86 | 86 | grep -q 'mcp.enabled requires database.existingSecret' /tmp/err |
| 87 | +
|
| 88 | + - name: helm lint (serviceAccount.create) |
| 89 | + run: helm lint chart/fleet-manager --set database.existingSecret=pg-dsn --set serviceAccount.create=true |
| 90 | + |
| 91 | + - name: helm lint (ingress.enabled) |
| 92 | + run: | |
| 93 | + helm lint chart/fleet-manager --set database.existingSecret=pg-dsn --set ingress.enabled=true \ |
| 94 | + --set ingress.className=nginx \ |
| 95 | + --set 'ingress.hosts[0].host=fleetos.example.org' \ |
| 96 | + --set 'ingress.hosts[0].paths[0].path=/' \ |
| 97 | + --set 'ingress.hosts[0].paths[0].pathType=Prefix' |
| 98 | +
|
| 99 | + - name: helm template omits the ServiceAccount and Ingress by default |
| 100 | + run: | |
| 101 | + out="$(helm template test chart/fleet-manager --set database.existingSecret=pg-dsn)" |
| 102 | + echo "$out" | grep -q 'kind: ServiceAccount' && { echo "ServiceAccount rendered with serviceAccount.create: false" >&2; exit 1; } |
| 103 | + echo "$out" | grep -q 'kind: Ingress' && { echo "Ingress rendered with ingress.enabled: false" >&2; exit 1; } |
| 104 | + echo "$out" | grep -q 'serviceAccountName: default' || { echo "pod does not explicitly run under the default ServiceAccount" >&2; exit 1; } |
| 105 | +
|
| 106 | + - name: helm template renders a dedicated ServiceAccount with automount off |
| 107 | + run: | |
| 108 | + out="$(helm template test chart/fleet-manager --set database.existingSecret=pg-dsn --set serviceAccount.create=true)" |
| 109 | + echo "$out" | grep -q 'kind: ServiceAccount' |
| 110 | + echo "$out" | grep -q 'automountServiceAccountToken: false' |
| 111 | + echo "$out" | grep -q 'serviceAccountName: fleet-manager' |
| 112 | +
|
| 113 | + - name: helm template renders the Ingress with the configured host and class |
| 114 | + run: | |
| 115 | + out="$(helm template test chart/fleet-manager --set database.existingSecret=pg-dsn --set ingress.enabled=true \ |
| 116 | + --set ingress.className=nginx \ |
| 117 | + --set 'ingress.hosts[0].host=fleetos.example.org' \ |
| 118 | + --set 'ingress.hosts[0].paths[0].path=/' \ |
| 119 | + --set 'ingress.hosts[0].paths[0].pathType=Prefix')" |
| 120 | + echo "$out" | grep -q 'kind: Ingress' |
| 121 | + echo "$out" | grep -q 'ingressClassName: nginx' |
| 122 | + echo "$out" | grep -q 'host: "fleetos.example.org"' |
| 123 | +
|
| 124 | + - name: helm template binds the memory-store Role to the pod's ServiceAccount |
| 125 | + run: | |
| 126 | + out="$(helm template test chart/fleet-manager --set storage.mode=memory --set serviceAccount.create=true)" |
| 127 | + subject="$(echo "$out" | sed -n '/kind: RoleBinding/,/^---/p' | sed -n '/^subjects:/,$p' | grep -m1 -E '^ +name:' | awk '{print $2}')" |
| 128 | + [ "$subject" = fleet-manager ] || { echo "RoleBinding binds '$subject', not the dedicated ServiceAccount" >&2; exit 1; } |
0 commit comments