-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented optional use of existing secret for mgmt token
Signed-off-by: Amente Bekele <[email protected]>
- Loading branch information
1 parent
fbbb1ed
commit 07cba74
Showing
6 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{- if .Values.e2eMgmtTokenSecret -}} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: mgmt-token-secret | ||
type: Opaque | ||
stringData: | ||
mgmtToken: mgmt-token-secret-value | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
set -e | ||
set -x | ||
|
||
TOKEN="mgmt-token-secret-value" | ||
OPA="http --ignore-stdin --default-scheme=https --verify=no -A bearer -a ${TOKEN} :8443/v1" | ||
|
||
${OPA}/data | jq -e '.result.test_helm_kubernetes_quickstart|keys|length==3' | ||
|
||
kubectl apply -f "$(dirname $0)/../fixture.yaml" | ||
|
||
${OPA}/policies | jq -e '.result|any(.id=="default/policy-include/include.rego")==true' | ||
${OPA}/data/example/include/allow | jq -e '.result==true' | ||
|
||
${OPA}/data/default | jq -e '.result|keys==["data-include"]' | ||
${OPA}/data/default/data-include | jq -e '.result["include.json"].inKey=="inValue"' | ||
|
||
kubectl get cm -l openpolicyagent.org/policy=rego -ojson | \ | ||
jq -e '.items[].metadata.annotations["openpolicyagent.org/kube-mgmt-status"]|fromjson|.status=="ok"' | ||
|
||
kubectl get cm -l openpolicyagent.org/data=opa -ojson | \ | ||
jq -e '.items[].metadata.annotations["openpolicyagent.org/kube-mgmt-status"]|fromjson|.status=="ok"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
e2eMgmtTokenSecret: true | ||
opa: | ||
replicas: 2 | ||
authz: | ||
enabled: true | ||
mgmtToken: | ||
secretName: mgmt-token-secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters