Skip to content

Commit a41e58e

Browse files
authored
Merge pull request #140 from fluxcd/chart-values-overwrite
2 parents fa37eea + eaec41f commit a41e58e

File tree

11 files changed

+256
-55
lines changed

11 files changed

+256
-55
lines changed

.github/workflows/e2e.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ jobs:
5757
kubectl -n source-system wait gitrepository/gitrepository-sample --for=condition=ready --timeout=1m
5858
kubectl -n source-system wait helmrepository/helmrepository-sample --for=condition=ready --timeout=1m
5959
kubectl -n source-system wait helmchart/helmchart-sample --for=condition=ready --timeout=1m
60-
kubectl -n source-system logs deploy/source-controller
60+
kubectl -n source-system delete -f ./config/samples
61+
- name: Run HelmChart values file tests
62+
run: |
63+
kubectl -n source-system apply -f ./config/testdata/helmchart-valuesfile
64+
kubectl -n source-system wait helmchart/mariadb --for=condition=ready --timeout=5m
65+
kubectl -n source-system wait helmchart/mariadb-git --for=condition=ready --timeout=5m
66+
kubectl -n source-system delete -f ./config/testdata/helmchart-valuesfile
6167
- name: Debug failure
6268
if: failure()
6369
run: |

api/v1alpha1/helmchart_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ type HelmChartSpec struct {
4141
// The interval at which to check the Source for updates.
4242
// +required
4343
Interval metav1.Duration `json:"interval"`
44+
45+
// Alternative values file to use as the default chart values, expected to be
46+
// a relative path in the SourceRef. Ignored when omitted.
47+
// +optional
48+
ValuesFile string `json:"valuesFile,omitempty"`
4449
}
4550

4651
// LocalHelmChartSourceReference contains enough information to let you locate the

config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ spec:
8585
- kind
8686
- name
8787
type: object
88+
valuesFile:
89+
description: Alternative values file to use as the default chart values,
90+
expected to be a relative path in the SourceRef. Ignored when omitted.
91+
type: string
8892
version:
8993
description: The chart version semver expression, ignored for charts
9094
from GitRepository sources. Defaults to latest when omitted.

config/samples/source_v1alpha1_helmchart_gitrepository.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ metadata:
44
name: helmchart-git-sample
55
spec:
66
chart: charts/podinfo
7-
version: '^2.0.0'
87
sourceRef:
98
kind: GitRepository
109
name: gitrepository-sample
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: source.toolkit.fluxcd.io/v1alpha1
2+
kind: GitRepository
3+
metadata:
4+
name: bitnami-charts
5+
spec:
6+
interval: 1m
7+
url: https://github.com/bitnami/charts
8+
ref:
9+
branch: master
10+
ignore:
11+
/*
12+
!/bitnami/
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: source.toolkit.fluxcd.io/v1alpha1
2+
kind: HelmChart
3+
metadata:
4+
name: mariadb-git
5+
spec:
6+
chart: bitnami/mariadb
7+
valuesFile: values-production.yaml
8+
sourceRef:
9+
kind: GitRepository
10+
name: bitnami-charts
11+
interval: 1m
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: source.toolkit.fluxcd.io/v1alpha1
2+
kind: HelmChart
3+
metadata:
4+
name: mariadb
5+
spec:
6+
chart: mariadb
7+
valuesFile: values-production.yaml
8+
sourceRef:
9+
kind: HelmRepository
10+
name: bitnami-charts
11+
interval: 1m
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: source.toolkit.fluxcd.io/v1alpha1
2+
kind: HelmRepository
3+
metadata:
4+
name: bitnami-charts
5+
spec:
6+
interval: 1m
7+
url: https://charts.bitnami.com/bitnami

0 commit comments

Comments
 (0)