Skip to content

Commit

Permalink
charts: Fix script to tests charts template
Browse files Browse the repository at this point in the history
This updates script to test template charts, this ensures when there is
new release, the expected templates are updated with the correct version
before comparison, avoiding test failures due to version mismatch.

Fixes: #2240
Signed-off-by: Kautilya Tripathi <[email protected]>
  • Loading branch information
knrt10 committed Aug 12, 2024
1 parent 9470913 commit b192cb2
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 54 deletions.
18 changes: 9 additions & 9 deletions charts/headlamp/tests/expected_templates/extra-args.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ kind: ServiceAccount
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
---
# Source: headlamp/templates/secret.yaml
Expand All @@ -25,10 +25,10 @@ kind: ClusterRoleBinding
metadata:
name: headlamp-admin
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -45,10 +45,10 @@ kind: Service
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
Expand All @@ -70,10 +70,10 @@ kind: Deployment
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
Expand All @@ -97,7 +97,7 @@ spec:
runAsGroup: 101
runAsNonRoot: true
runAsUser: 100
image: "ghcr.io/headlamp-k8s/headlamp:v0.24.1"
image: "ghcr.io/headlamp-k8s/headlamp:v0.25.0"
imagePullPolicy: IfNotPresent

env:
Expand Down
18 changes: 9 additions & 9 deletions charts/headlamp/tests/expected_templates/oidc-create-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ kind: ServiceAccount
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
---
# Source: headlamp/templates/secret.yaml
Expand All @@ -29,10 +29,10 @@ kind: ClusterRoleBinding
metadata:
name: headlamp-admin
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -49,10 +49,10 @@ kind: Service
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
Expand All @@ -74,10 +74,10 @@ kind: Deployment
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
Expand All @@ -101,7 +101,7 @@ spec:
runAsGroup: 101
runAsNonRoot: true
runAsUser: 100
image: "ghcr.io/headlamp-k8s/headlamp:v0.24.1"
image: "ghcr.io/headlamp-k8s/headlamp:v0.25.0"
imagePullPolicy: IfNotPresent

env:
Expand Down
18 changes: 9 additions & 9 deletions charts/headlamp/tests/expected_templates/oidc-directly-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ kind: ServiceAccount
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
---
# Source: headlamp/templates/secret.yaml
Expand All @@ -25,10 +25,10 @@ kind: ClusterRoleBinding
metadata:
name: headlamp-admin
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -45,10 +45,10 @@ kind: Service
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
Expand All @@ -70,10 +70,10 @@ kind: Deployment
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
Expand All @@ -97,7 +97,7 @@ spec:
runAsGroup: 101
runAsNonRoot: true
runAsUser: 100
image: "ghcr.io/headlamp-k8s/headlamp:v0.24.1"
image: "ghcr.io/headlamp-k8s/headlamp:v0.25.0"
imagePullPolicy: IfNotPresent

env:
Expand Down
18 changes: 9 additions & 9 deletions charts/headlamp/tests/expected_templates/oidc-directly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ kind: ServiceAccount
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
---
# Source: headlamp/templates/clusterrolebinding.yaml
Expand All @@ -17,10 +17,10 @@ kind: ClusterRoleBinding
metadata:
name: headlamp-admin
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -37,10 +37,10 @@ kind: Service
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
Expand All @@ -62,10 +62,10 @@ kind: Deployment
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
Expand All @@ -89,7 +89,7 @@ spec:
runAsGroup: 101
runAsNonRoot: true
runAsUser: 100
image: "ghcr.io/headlamp-k8s/headlamp:v0.24.1"
image: "ghcr.io/headlamp-k8s/headlamp:v0.25.0"
imagePullPolicy: IfNotPresent

env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ kind: ServiceAccount
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
---
# Source: headlamp/templates/clusterrolebinding.yaml
Expand All @@ -17,10 +17,10 @@ kind: ClusterRoleBinding
metadata:
name: headlamp-admin
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -37,10 +37,10 @@ kind: Service
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
Expand All @@ -62,10 +62,10 @@ kind: Deployment
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
Expand All @@ -89,7 +89,7 @@ spec:
runAsGroup: 101
runAsNonRoot: true
runAsUser: 100
image: "ghcr.io/headlamp-k8s/headlamp:v0.24.1"
image: "ghcr.io/headlamp-k8s/headlamp:v0.25.0"
imagePullPolicy: IfNotPresent

# Check if externalSecret is enabled
Expand Down
18 changes: 9 additions & 9 deletions charts/headlamp/tests/expected_templates/volumes-added.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ kind: ServiceAccount
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
---
# Source: headlamp/templates/secret.yaml
Expand All @@ -25,10 +25,10 @@ kind: ClusterRoleBinding
metadata:
name: headlamp-admin
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -45,10 +45,10 @@ kind: Service
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
Expand All @@ -70,10 +70,10 @@ kind: Deployment
metadata:
name: headlamp
labels:
helm.sh/chart: headlamp-0.23.0
helm.sh/chart: headlamp-0.24.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.24.1"
app.kubernetes.io/version: "0.25.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
Expand All @@ -97,7 +97,7 @@ spec:
runAsGroup: 101
runAsNonRoot: true
runAsUser: 100
image: "ghcr.io/headlamp-k8s/headlamp:v0.24.1"
image: "ghcr.io/headlamp-k8s/headlamp:v0.25.0"
imagePullPolicy: IfNotPresent

env:
Expand Down
Loading

0 comments on commit b192cb2

Please sign in to comment.