Add e2e tests for build/diff kustomization
Signed-off-by: Soule BA <soule@weave.works>
This commit is contained in:
78
cmd/flux/testdata/diff-kustomization/deployment.yaml
vendored
Normal file
78
cmd/flux/testdata/diff-kustomization/deployment.yaml
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
kustomize.toolkit.fluxcd.io/name: podinfo
|
||||
kustomize.toolkit.fluxcd.io/namespace: {{ .fluxns }}
|
||||
name: podinfo
|
||||
namespace: default
|
||||
spec:
|
||||
minReadySeconds: 3
|
||||
revisionHistoryLimit: 5
|
||||
progressDeadlineSeconds: 60
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxUnavailable: 0
|
||||
type: RollingUpdate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: podinfo
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "9797"
|
||||
labels:
|
||||
app: podinfo
|
||||
spec:
|
||||
containers:
|
||||
- name: podinfod
|
||||
image: ghcr.io/stefanprodan/podinfo:6.0.10
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 9898
|
||||
protocol: TCP
|
||||
- name: http-metrics
|
||||
containerPort: 9797
|
||||
protocol: TCP
|
||||
- name: grpc
|
||||
containerPort: 9999
|
||||
protocol: TCP
|
||||
command:
|
||||
- ./podinfo
|
||||
- --port=9898
|
||||
- --port-metrics=9797
|
||||
- --grpc-port=9999
|
||||
- --grpc-service-name=podinfo
|
||||
- --level=info
|
||||
- --random-delay=false
|
||||
- --random-error=false
|
||||
env:
|
||||
- name: PODINFO_UI_COLOR
|
||||
value: "#34577c"
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- podcli
|
||||
- check
|
||||
- http
|
||||
- localhost:9898/healthz
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 5
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- podcli
|
||||
- check
|
||||
- http
|
||||
- localhost:9898/readyz
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 5
|
||||
resources:
|
||||
limits:
|
||||
cpu: 2000m
|
||||
memory: 512Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 64Mi
|
||||
4
cmd/flux/testdata/diff-kustomization/diff-with-deployment.golden
vendored
Normal file
4
cmd/flux/testdata/diff-kustomization/diff-with-deployment.golden
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
► HorizontalPodAutoscaler/default/podinfo created
|
||||
► Service/default/podinfo created
|
||||
► Secret/default/podinfo-token-77t89m9b67 created
|
||||
► Secret/default/db-user-pass-bkbd782d2c created
|
||||
10
cmd/flux/testdata/diff-kustomization/diff-with-drifted-key-sops-secret.golden
vendored
Normal file
10
cmd/flux/testdata/diff-kustomization/diff-with-drifted-key-sops-secret.golden
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
► Deployment/default/podinfo created
|
||||
► HorizontalPodAutoscaler/default/podinfo created
|
||||
► Service/default/podinfo created
|
||||
► Secret/default/podinfo-token-77t89m9b67 drifted
|
||||
|
||||
data
|
||||
- one map entry removed: + one map entry added:
|
||||
drift-key: "*****" token: "*****"
|
||||
|
||||
► Secret/default/db-user-pass-bkbd782d2c created
|
||||
11
cmd/flux/testdata/diff-kustomization/diff-with-drifted-secret.golden
vendored
Normal file
11
cmd/flux/testdata/diff-kustomization/diff-with-drifted-secret.golden
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
► Deployment/default/podinfo created
|
||||
► HorizontalPodAutoscaler/default/podinfo created
|
||||
► Service/default/podinfo created
|
||||
► Secret/default/podinfo-token-77t89m9b67 created
|
||||
► Secret/default/db-user-pass-bkbd782d2c drifted
|
||||
|
||||
data.password
|
||||
± value change
|
||||
- ******
|
||||
+ *****
|
||||
|
||||
16
cmd/flux/testdata/diff-kustomization/diff-with-drifted-service.golden
vendored
Normal file
16
cmd/flux/testdata/diff-kustomization/diff-with-drifted-service.golden
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
► Deployment/default/podinfo created
|
||||
► HorizontalPodAutoscaler/default/podinfo created
|
||||
► Service/default/podinfo drifted
|
||||
|
||||
spec.ports
|
||||
⇆ order changed
|
||||
- http, grpc
|
||||
+ grpc, http
|
||||
|
||||
spec.ports.http.port
|
||||
± value change
|
||||
- 9899
|
||||
+ 9898
|
||||
|
||||
► Secret/default/podinfo-token-77t89m9b67 created
|
||||
► Secret/default/db-user-pass-bkbd782d2c created
|
||||
4
cmd/flux/testdata/diff-kustomization/diff-with-drifted-value-sops-secret.golden
vendored
Normal file
4
cmd/flux/testdata/diff-kustomization/diff-with-drifted-value-sops-secret.golden
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
► Deployment/default/podinfo created
|
||||
► HorizontalPodAutoscaler/default/podinfo created
|
||||
► Service/default/podinfo created
|
||||
► Secret/default/db-user-pass-bkbd782d2c created
|
||||
11
cmd/flux/testdata/diff-kustomization/key-sops-secret.yaml
vendored
Normal file
11
cmd/flux/testdata/diff-kustomization/key-sops-secret.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
drift-key: bXktc2VjcmV0LXRva2VuCg==
|
||||
kind: Secret
|
||||
metadata:
|
||||
labels:
|
||||
kustomize.toolkit.fluxcd.io/name: podinfo
|
||||
kustomize.toolkit.fluxcd.io/namespace: {{ .fluxns }}
|
||||
name: podinfo-token-77t89m9b67
|
||||
namespace: default
|
||||
type: Opaque
|
||||
11
cmd/flux/testdata/diff-kustomization/kustomization.yaml
vendored
Normal file
11
cmd/flux/testdata/diff-kustomization/kustomization.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ./deployment.yaml
|
||||
- ./hpa.yaml
|
||||
- ./service.yaml
|
||||
secretGenerator:
|
||||
- literals:
|
||||
- username=admin
|
||||
- password=1f2d1e2e67df
|
||||
name: secret-basic-auth
|
||||
5
cmd/flux/testdata/diff-kustomization/nothing-is-deployed.golden
vendored
Normal file
5
cmd/flux/testdata/diff-kustomization/nothing-is-deployed.golden
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
► Deployment/default/podinfo created
|
||||
► HorizontalPodAutoscaler/default/podinfo created
|
||||
► Service/default/podinfo created
|
||||
► Secret/default/podinfo-token-77t89m9b67 created
|
||||
► Secret/default/db-user-pass-bkbd782d2c created
|
||||
12
cmd/flux/testdata/diff-kustomization/secret.yaml
vendored
Normal file
12
cmd/flux/testdata/diff-kustomization/secret.yaml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
password: cGFzc3dvcmQK
|
||||
username: YWRtaW4=
|
||||
kind: Secret
|
||||
metadata:
|
||||
labels:
|
||||
kustomize.toolkit.fluxcd.io/name: podinfo
|
||||
kustomize.toolkit.fluxcd.io/namespace: {{ .fluxns }}
|
||||
name: db-user-pass-bkbd782d2c
|
||||
namespace: default
|
||||
type: Opaque
|
||||
21
cmd/flux/testdata/diff-kustomization/service.yaml
vendored
Normal file
21
cmd/flux/testdata/diff-kustomization/service.yaml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
kustomize.toolkit.fluxcd.io/name: podinfo
|
||||
kustomize.toolkit.fluxcd.io/namespace: {{ .fluxns }}
|
||||
name: podinfo
|
||||
namespace: default
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: podinfo
|
||||
ports:
|
||||
- name: http
|
||||
port: 9899
|
||||
protocol: TCP
|
||||
targetPort: http
|
||||
- port: 9999
|
||||
targetPort: grpc
|
||||
protocol: TCP
|
||||
name: grpc
|
||||
11
cmd/flux/testdata/diff-kustomization/value-sops-secret.yaml
vendored
Normal file
11
cmd/flux/testdata/diff-kustomization/value-sops-secret.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
token: ZHJpZnQtdmFsdWUK
|
||||
kind: Secret
|
||||
metadata:
|
||||
labels:
|
||||
kustomize.toolkit.fluxcd.io/name: podinfo
|
||||
kustomize.toolkit.fluxcd.io/namespace: {{ .fluxns }}
|
||||
name: podinfo-token-77t89m9b67
|
||||
namespace: default
|
||||
type: Opaque
|
||||
Reference in New Issue
Block a user