Add SOPS decryption e2e tests

This commit is contained in:
stefanprodan 2020-09-01 15:51:41 +03:00
parent c605ccf6d2
commit e2743c72f2
5 changed files with 44 additions and 0 deletions

View File

@ -71,6 +71,11 @@ jobs:
kubectl get ns
kubectl -n kustomize-system delete -k ./config/testdata/overlays
until kubectl get ns staging 2>&1 | grep NotFound ; do sleep 2; done
- name: Run SOPS tests
run: |
kubectl -n kustomize-system apply -k ./config/testdata/sops
kubectl -n kustomize-system wait kustomizations/sops --for=condition=ready --timeout=4m
kubectl -n test2 get secrets/test --template={{.data.password}} | base64 -D | grep test
- name: Logs
run: |
kubectl -n kustomize-system logs deploy/source-controller

8
config/testdata/sops/keys.yaml vendored Normal file

File diff suppressed because one or more lines are too long

16
config/testdata/sops/ks.yaml vendored Normal file
View File

@ -0,0 +1,16 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1alpha1
kind: Kustomization
metadata:
name: sops
spec:
interval: 5m
path: "./testdata/sops/"
prune: true
sourceRef:
kind: GitRepository
name: sops
decryption:
provider: sops
secretRef:
name: sops-pgp
validation: client

View File

@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- source.yaml
- keys.yaml
- ks.yaml

9
config/testdata/sops/source.yaml vendored Normal file
View File

@ -0,0 +1,9 @@
apiVersion: source.toolkit.fluxcd.io/v1alpha1
kind: GitRepository
metadata:
name: sops
spec:
interval: 10m
url: https://github.com/stefanprodan/kustomizer
ref:
tag: "v0.2.0"