mirror of https://github.com/helm/helm
Merge pull request #12162 from mattfarina/fix-merge-values-ugh
Fix multiple bugs in values handlingpull/12253/head
commit
343389856b
@ -0,0 +1,32 @@
|
||||
---
|
||||
# Source: issue-9027/charts/subchart/templates/values.yaml
|
||||
global:
|
||||
hash:
|
||||
key3: 13
|
||||
key4: 4
|
||||
key5: 5
|
||||
key6: 6
|
||||
hash:
|
||||
key3: 13
|
||||
key4: 4
|
||||
key5: 5
|
||||
key6: 6
|
||||
---
|
||||
# Source: issue-9027/templates/values.yaml
|
||||
global:
|
||||
hash:
|
||||
key1: null
|
||||
key2: null
|
||||
key3: 13
|
||||
subchart:
|
||||
global:
|
||||
hash:
|
||||
key3: 13
|
||||
key4: 4
|
||||
key5: 5
|
||||
key6: 6
|
||||
hash:
|
||||
key3: 13
|
||||
key4: 4
|
||||
key5: 5
|
||||
key6: 6
|
@ -0,0 +1,122 @@
|
||||
---
|
||||
# Source: subchart/templates/subdir/serviceaccount.yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: subchart-sa
|
||||
---
|
||||
# Source: subchart/templates/subdir/configmap.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: subchart-cm
|
||||
data:
|
||||
value: qux
|
||||
---
|
||||
# Source: subchart/templates/subdir/role.yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: subchart-role
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["get","list","watch"]
|
||||
---
|
||||
# Source: subchart/templates/subdir/rolebinding.yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: subchart-binding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: subchart-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: subchart-sa
|
||||
namespace: default
|
||||
---
|
||||
# Source: subchart/charts/subcharta/templates/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: subcharta
|
||||
labels:
|
||||
helm.sh/chart: "subcharta-0.1.0"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: apache
|
||||
selector:
|
||||
app.kubernetes.io/name: subcharta
|
||||
---
|
||||
# Source: subchart/charts/subchartb/templates/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: subchartb
|
||||
labels:
|
||||
helm.sh/chart: "subchartb-0.1.0"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: nginx
|
||||
selector:
|
||||
app.kubernetes.io/name: subchartb
|
||||
---
|
||||
# Source: subchart/templates/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: subchart
|
||||
labels:
|
||||
helm.sh/chart: "subchart-0.1.0"
|
||||
app.kubernetes.io/instance: "release-name"
|
||||
kube-version/major: "1"
|
||||
kube-version/minor: "20"
|
||||
kube-version/version: "v1.20.0"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: nginx
|
||||
selector:
|
||||
app.kubernetes.io/name: subchart
|
||||
---
|
||||
# Source: subchart/templates/tests/test-config.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "release-name-testconfig"
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
data:
|
||||
message: Hello World
|
||||
---
|
||||
# Source: subchart/templates/tests/test-nothing.yaml
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "release-name-test"
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
containers:
|
||||
- name: test
|
||||
image: "alpine:latest"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: "release-name-testconfig"
|
||||
command:
|
||||
- echo
|
||||
- "$message"
|
||||
restartPolicy: Never
|
@ -0,0 +1,122 @@
|
||||
---
|
||||
# Source: subchart/templates/subdir/serviceaccount.yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: subchart-sa
|
||||
---
|
||||
# Source: subchart/templates/subdir/configmap.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: subchart-cm
|
||||
data:
|
||||
value: baz
|
||||
---
|
||||
# Source: subchart/templates/subdir/role.yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: subchart-role
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["get","list","watch"]
|
||||
---
|
||||
# Source: subchart/templates/subdir/rolebinding.yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: subchart-binding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: subchart-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: subchart-sa
|
||||
namespace: default
|
||||
---
|
||||
# Source: subchart/charts/subcharta/templates/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: subcharta
|
||||
labels:
|
||||
helm.sh/chart: "subcharta-0.1.0"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: apache
|
||||
selector:
|
||||
app.kubernetes.io/name: subcharta
|
||||
---
|
||||
# Source: subchart/charts/subchartb/templates/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: subchartb
|
||||
labels:
|
||||
helm.sh/chart: "subchartb-0.1.0"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: nginx
|
||||
selector:
|
||||
app.kubernetes.io/name: subchartb
|
||||
---
|
||||
# Source: subchart/templates/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: subchart
|
||||
labels:
|
||||
helm.sh/chart: "subchart-0.1.0"
|
||||
app.kubernetes.io/instance: "release-name"
|
||||
kube-version/major: "1"
|
||||
kube-version/minor: "20"
|
||||
kube-version/version: "v1.20.0"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: nginx
|
||||
selector:
|
||||
app.kubernetes.io/name: subchart
|
||||
---
|
||||
# Source: subchart/templates/tests/test-config.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "release-name-testconfig"
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
data:
|
||||
message: Hello World
|
||||
---
|
||||
# Source: subchart/templates/tests/test-nothing.yaml
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "release-name-test"
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
containers:
|
||||
- name: test
|
||||
image: "alpine:latest"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: "release-name-testconfig"
|
||||
command:
|
||||
- echo
|
||||
- "$message"
|
||||
restartPolicy: Never
|
@ -0,0 +1,122 @@
|
||||
---
|
||||
# Source: subchart/templates/subdir/serviceaccount.yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: subchart-sa
|
||||
---
|
||||
# Source: subchart/templates/subdir/configmap.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: subchart-cm
|
||||
data:
|
||||
value: bar
|
||||
---
|
||||
# Source: subchart/templates/subdir/role.yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: subchart-role
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["get","list","watch"]
|
||||
---
|
||||
# Source: subchart/templates/subdir/rolebinding.yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: subchart-binding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: subchart-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: subchart-sa
|
||||
namespace: default
|
||||
---
|
||||
# Source: subchart/charts/subcharta/templates/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: subcharta
|
||||
labels:
|
||||
helm.sh/chart: "subcharta-0.1.0"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: apache
|
||||
selector:
|
||||
app.kubernetes.io/name: subcharta
|
||||
---
|
||||
# Source: subchart/charts/subchartb/templates/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: subchartb
|
||||
labels:
|
||||
helm.sh/chart: "subchartb-0.1.0"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: nginx
|
||||
selector:
|
||||
app.kubernetes.io/name: subchartb
|
||||
---
|
||||
# Source: subchart/templates/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: subchart
|
||||
labels:
|
||||
helm.sh/chart: "subchart-0.1.0"
|
||||
app.kubernetes.io/instance: "release-name"
|
||||
kube-version/major: "1"
|
||||
kube-version/minor: "20"
|
||||
kube-version/version: "v1.20.0"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: nginx
|
||||
selector:
|
||||
app.kubernetes.io/name: subchart
|
||||
---
|
||||
# Source: subchart/templates/tests/test-config.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "release-name-testconfig"
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
data:
|
||||
message: Hello World
|
||||
---
|
||||
# Source: subchart/templates/tests/test-nothing.yaml
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "release-name-test"
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
containers:
|
||||
- name: test
|
||||
image: "alpine:latest"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: "release-name-testconfig"
|
||||
command:
|
||||
- echo
|
||||
- "$message"
|
||||
restartPolicy: Never
|
@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: issue-9027
|
||||
version: 0.1.0
|
||||
dependencies:
|
||||
- name: subchart
|
||||
version: 0.1.0
|
@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
name: subchart
|
||||
version: 0.1.0
|
@ -0,0 +1 @@
|
||||
{{ .Values | toYaml }}
|
@ -0,0 +1,17 @@
|
||||
global:
|
||||
hash:
|
||||
key1: 1
|
||||
key2: 2
|
||||
key3: 3
|
||||
key4: 4
|
||||
key5: 5
|
||||
key6: 6
|
||||
|
||||
|
||||
hash:
|
||||
key1: 1
|
||||
key2: 2
|
||||
key3: 3
|
||||
key4: 4
|
||||
key5: 5
|
||||
key6: 6
|
@ -0,0 +1 @@
|
||||
{{ .Values | toYaml }}
|
@ -0,0 +1,11 @@
|
||||
global:
|
||||
hash:
|
||||
key1: null
|
||||
key2: null
|
||||
key3: 13
|
||||
|
||||
subchart:
|
||||
hash:
|
||||
key1: null
|
||||
key2: null
|
||||
key3: 13
|
@ -0,0 +1,5 @@
|
||||
# This file is used to test values passed by file at the command line
|
||||
|
||||
configmap:
|
||||
enabled: true
|
||||
value: "qux"
|
@ -0,0 +1,8 @@
|
||||
{{ if .Values.configmap.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ .Chart.Name }}-cm
|
||||
data:
|
||||
value: {{ .Values.configmap.value }}
|
||||
{{- end }}
|
@ -0,0 +1,11 @@
|
||||
apiVersion: v2
|
||||
name: app3
|
||||
description: A Helm chart for Kubernetes
|
||||
type: application
|
||||
version: 0.1.0
|
||||
|
||||
dependencies:
|
||||
- name: library
|
||||
version: 0.1.0
|
||||
import-values:
|
||||
- defaults
|
@ -0,0 +1,5 @@
|
||||
apiVersion: v2
|
||||
name: library
|
||||
description: A Helm chart for Kubernetes
|
||||
type: library
|
||||
version: 0.1.0
|
@ -0,0 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
@ -0,0 +1,5 @@
|
||||
exports:
|
||||
defaults:
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 9090
|
@ -0,0 +1 @@
|
||||
{{- include "library.service" . }}
|
@ -0,0 +1,2 @@
|
||||
service:
|
||||
type: ClusterIP
|
@ -0,0 +1,9 @@
|
||||
apiVersion: v2
|
||||
name: app4
|
||||
description: A Helm chart for Kubernetes
|
||||
type: application
|
||||
version: 0.1.0
|
||||
|
||||
dependencies:
|
||||
- name: library
|
||||
version: 0.1.0
|
@ -0,0 +1,5 @@
|
||||
apiVersion: v2
|
||||
name: library
|
||||
description: A Helm chart for Kubernetes
|
||||
type: library
|
||||
version: 0.1.0
|
@ -0,0 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
@ -0,0 +1,5 @@
|
||||
exports:
|
||||
defaults:
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 9090
|
@ -0,0 +1 @@
|
||||
{{- include "library.service" . }}
|
@ -0,0 +1,3 @@
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 1234
|
Loading…
Reference in new issue