This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e: test upgrade of chart with nested HelmRelease
- Loading branch information
Showing
9 changed files
with
222 additions
and
15 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,4 @@ | ||
apiVersion: v1 | ||
description: Nested HelmRelease chart | ||
name: nested-helmrelease | ||
version: 0.1.0 |
14 changes: 14 additions & 0 deletions
14
test/e2e/fixtures/charts/nested-helmrelease/templates/helmrelease.yaml
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,14 @@ | ||
--- | ||
apiVersion: helm.fluxcd.io/v1 | ||
kind: HelmRelease | ||
metadata: | ||
name: {{ .Release.Name }}-child | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
releaseName: {{ .Release.Name }}-child | ||
chart: | ||
repository: https://stefanprodan.github.io/podinfo | ||
version: 3.2.0 | ||
name: podinfo | ||
values: | ||
{{- toYaml .Values.nested.deeper.deepest | nindent 4 }} |
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,6 @@ | ||
nested: | ||
deeper: | ||
deepest: | ||
image: | ||
name: some-other-image | ||
tag: 1.0.1 |
75 changes: 75 additions & 0 deletions
75
test/e2e/fixtures/kustom/base/chartmuseum/chartmuseum.yaml
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,75 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
name: chartmuseum | ||
name: chartmuseum | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: chartmuseum | ||
template: | ||
metadata: | ||
labels: | ||
name: chartmuseum | ||
spec: | ||
containers: | ||
- name: chartmuseum | ||
image: chartmuseum/chartmuseum:v0.11.0 | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: "LOG_JSON" | ||
value: "true" | ||
- name: "STORAGE" | ||
value: "local" | ||
args: | ||
- --port=8080 | ||
- --storage-local-rootdir=/storage | ||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
port: http | ||
failureThreshold: 3 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
port: http | ||
failureThreshold: 3 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
ports: | ||
- containerPort: 8080 | ||
name: http | ||
protocol: TCP | ||
volumeMounts: | ||
- mountPath: /storage | ||
name: storage-volume | ||
securityContext: | ||
fsGroup: 1000 | ||
volumes: | ||
- name: storage-volume | ||
emptyDir: {} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
name: chartmuseum | ||
name: chartmuseum | ||
spec: | ||
ports: | ||
- name: http | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: http | ||
selector: | ||
name: chartmuseum | ||
type: ClusterIP |
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,2 @@ | ||
resources: | ||
- chartmuseum.yaml |
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,19 @@ | ||
--- | ||
apiVersion: helm.fluxcd.io/v1 | ||
kind: HelmRelease | ||
metadata: | ||
name: nested-helmrelease | ||
namespace: demo | ||
spec: | ||
releaseName: nested-helmrelease | ||
chart: | ||
repository: http://chartmuseum:8080 | ||
name: nested-helmrelease | ||
version: 0.1.0 | ||
values: | ||
nested: | ||
deeper: | ||
deepest: | ||
image: | ||
name: some-other-image | ||
tag: 1.0.1 |
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,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
# shellcheck disable=SC1090 | ||
source "${E2E_DIR}/lib/defer.bash" | ||
|
||
function package_and_upload_chart() { | ||
local chart=${1} | ||
local chart_repository=${2} | ||
|
||
gen_dir=$(mktemp -d) | ||
defer rm -rf "'$gen_dir'" | ||
|
||
# Package | ||
if [ "$HELM_VERSION" == "v3" ]; then | ||
helm3 package --destination "$gen_dir" "$chart" | ||
else | ||
helm2 package --destination "$gen_dir" "$chart" | ||
fi | ||
|
||
# Upload | ||
chart_tarbal=$(find "$gen_dir" -type f -name "*.tgz" | head -n1) | ||
curl --data-binary "@$chart_tarbal" "$chart_repository/api/charts" | ||
} |
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