Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change snapshot format as YAML #85

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ dynamicFields:
- /data/COOKIE_BLOCKKEY
- /data/COOKIE_HASHKEY
- /data/COOKIE_SESSION_NAME
base64: true
```

> NOTE:
Expand Down Expand Up @@ -232,20 +233,23 @@ testSpec:
jsonPath:
- /data/ca.crt
- /data/ca.key
base64: true
- apiVersion: v1
kind: Secret
name: hubble-server-certs
jsonPath:
- /data/ca.crt
- /data/tls.crt
- /data/tls.
- /data/tls.key
base64: true
- apiVersion: v1
kind: Secret
name: hubble-relay-client-certs
jsonPath:
- /data/ca.crt
- /data/tls.crt
- /data/tls.key
base64: true

# Others can be any of your chart values.
# ...
Expand Down
17 changes: 17 additions & 0 deletions example/app1/__snapshots__/default.snap
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ SnapShot = """
image: busybox
name: wget
restartPolicy: Never
- object:
apiVersion: v1
data:
ca.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURFRENDQWZpZ0F3SUJBZ0lSQUxFK1NwRWlFZ1RBMWZhRmkzTW5yYVV3RFFZSktvWklodmNOQVFFTEJRQXcKRWpFUU1BNEdBMVVFQXhNSFlYQndNUzFqWVRBZUZ3MHlOREEwTURjeE56TTNNakJhRncwek5EQTBNRFV4TnpNMwpNakJhTUJJeEVEQU9CZ05WQkFNVEIyRndjREV0WTJFd2dnRWlNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0SUJEd0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MDlMUTU0cHlXdUJXMDRURDVFV0JHNUxGWitVUmVrY0hkNDBJNEdTM0hpUmlWNU9ESTRnVlpJUmNKTklTM3RyCjUvcHc5U1VBZTZYQ3U0b2ZBeXNtVUdUeWlLTTIvL2Fwc1UvazNIOHZBb0dBV3NER1o4U3ZaUVNiTnhDWll1UkYKQmhWbHlOOFF1NDZzK2JLNnlkVWFEa0xCOEx6eWdKYm8vU2JaeGFPMWNvc1R0cVduSXNoU2MxUVlFZlFRaUtNNgpNNFJvaWxueVVsRjJZMUNjTmcvZnFaMDhBcjVLL25yanAxdmJOSEdKdWh6WEdQRWx3UDBkblJTT3RCREVrZjhUCjRtb2FDcGdLdmVZV1NHU2VmR0JoeDFFQ2dZQkVUUWpuUkMrWTRBR0pwTjRSY1ZISXBqRkFGK1hxWnhTTk40Q1IKWHZUamhpZktqRFdheVlEUkpDa0RaUmNxNjk0VzdIbHQrWVJuRWl2ZEJVSjZyREVaMDFHOWlNUjdIU25RZHZ5ZQoxNms0UU5YMFN4K25hTWdXdkVQNFdtelFOR2hKbTd2S1VPbi81czVsaWNuYmt3b2E0bHdkcTBmcHc1ZndTYk1ZCkxTZGNMd0tCZ0Voay83emdxK2tydnZCMkQreENPYjdVWkJqT1BuUVQ4eVdqRW1BWkVJNTNDTHVrRGkzckFwSnMKTDhUNTJDeFAvMHNkNWFkYzV2ZGhLVzduemdsUmNuMFI3a0hBSFhzdmRFbEJ4SVhXY0NjS29xblRjMk5OYjhsZQowejFvS0hWcnordTF2alAxUitaalMzUUdDWTNONGVXUVYwZkpaY21BRkZYSVkyM3daelpSCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
kind: Secret
metadata:
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
name: app1-cert
namespace: default
type: kubernetes.io/tls
- object:
apiVersion: v1
kind: Service
Expand Down
1 change: 1 addition & 0 deletions example/app1/test/.chartsnap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ dynamicFields:
- /data/ca.crt
- /data/tls.crt
- /data/tls.key
base64: true
238 changes: 117 additions & 121 deletions example/app1/test/__snapshots__/test_certmanager_enabled.snap
Original file line number Diff line number Diff line change
@@ -1,124 +1,120 @@
[test_certmanager_enabled]
SnapShot = """
- object:
apiVersion: apps/v1
kind: Deployment
apiVersion: v1
automountServiceAccountToken: true
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
name: chartsnap-app1
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
name: chartsnap-app1
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: http
selector:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/name: app1
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
name: chartsnap-app1
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/name: app1
template:
metadata:
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
name: chartsnap-app1
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/name: app1
template:
metadata:
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
spec:
containers:
- image: nginx:1.16.0
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /
port: http
name: app1
ports:
- containerPort: 80
name: http
protocol: TCP
readinessProbe:
httpGet:
path: /
port: http
resources: {}
securityContext: {}
securityContext: {}
serviceAccountName: chartsnap-app1
- object:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
name: app1-cert
namespace: default
spec:
dnsNames:
- chartsnap-app1.default.svc
- chartsnap-app1.default.svc.cluster.local
issuerRef:
kind: Issuer
name: nameOfClusterIssuer
secretName: app1-cert
- object:
apiVersion: v1
kind: Pod
metadata:
annotations:
helm.sh/hook: test
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
name: chartsnap-app1-test-connection
spec:
containers:
- args:
- chartsnap-app1:80
command:
- wget
image: busybox
name: wget
restartPolicy: Never
- object:
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
name: chartsnap-app1
spec:
ports:
- name: http
port: 80
containers:
- image: nginx:1.16.0
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /
port: http
name: app1
ports:
- containerPort: 80
name: http
protocol: TCP
targetPort: http
selector:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/name: app1
type: ClusterIP
- object:
apiVersion: v1
automountServiceAccountToken: true
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
name: chartsnap-app1
"""
readinessProbe:
httpGet:
path: /
port: http
resources: {}
securityContext: {}
securityContext: {}
serviceAccountName: chartsnap-app1
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
name: app1-cert
namespace: default
spec:
dnsNames:
- chartsnap-app1.default.svc
- chartsnap-app1.default.svc.cluster.local
issuerRef:
kind: Issuer
name: nameOfClusterIssuer
secretName: app1-cert
---
apiVersion: v1
kind: Pod
metadata:
annotations:
helm.sh/hook: test
labels:
app.kubernetes.io/instance: chartsnap
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: app1
app.kubernetes.io/version: 1.16.0
helm.sh/chart: app1-0.1.0
name: chartsnap-app1-test-connection
spec:
containers:
- args:
- chartsnap-app1:80
command:
- wget
image: busybox
name: wget
restartPolicy: Never
Loading
Loading