Fix value precedence#10110
Conversation
Fix value precedence when importing values from child. Closes helm#9940 Signed-off-by: Aram Zegerius <[email protected]>
|
Can you please provide a test case to confirm #9940 has been fixed? |
|
@bacongobbler sure, I'll do that tomorrow together with my colleague @ankitabhopatkar13. This was tested against this repository https://github.com/ankitabhopatkar13/helm-values-issue. AFAIK no tests broke, I am not sure how often this code block is hit. |
Closes helm#9940 Signed-off-by: Aram Zegerius <[email protected]> Signed-off-by: Ankita Bhopatkar <[email protected]>
|
@bacongobbler - @ankitabhopatkar13 and I finalized the test. Output before and after the fix below: Before fix After fix |
|
Tested manually with chart from linked issue: https://github.com/ankitabhopatkar13/helm-values-issue Before fix:
$ helm upgrade --install umbrella umbrella --debug --dry-run
MANIFEST:
---
# Source: umbrella/charts/app1/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: umbrella-app1
labels:
helm.sh/chart: app1-0.1.0
app.kubernetes.io/name: app1
app.kubernetes.io/instance: umbrella
app.kubernetes.io/version: "1.16.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 1234
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: app1
app.kubernetes.io/instance: umbrella
---
# Source: umbrella/charts/app2/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: umbrella-app2
labels:
helm.sh/chart: app2-0.1.0
app.kubernetes.io/name: app2
app.kubernetes.io/instance: umbrella
app.kubernetes.io/version: "1.16.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: app2
app.kubernetes.io/instance: umbrella
$ helm upgrade --install umbrella umbrella --debug --dry-run --values umbrella/values.yaml
MANIFEST:
---
# Source: umbrella/charts/app1/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: umbrella-app1
labels:
helm.sh/chart: app1-0.1.0
app.kubernetes.io/name: app1
app.kubernetes.io/instance: umbrella
app.kubernetes.io/version: "1.16.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 9090
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: app1
app.kubernetes.io/instance: umbrella
---
# Source: umbrella/charts/app2/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: umbrella-app2
labels:
helm.sh/chart: app2-0.1.0
app.kubernetes.io/name: app2
app.kubernetes.io/instance: umbrella
app.kubernetes.io/version: "1.16.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 9090
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: app2
app.kubernetes.io/instance: umbrellaAfter fix:
$ helm upgrade --install umbrella umbrella --debug --dry-run
MANIFEST:
---
# Source: umbrella/charts/app1/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: umbrella-app1
labels:
helm.sh/chart: app1-0.1.0
app.kubernetes.io/name: app1
app.kubernetes.io/instance: umbrella
app.kubernetes.io/version: "1.16.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 1234
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: app1
app.kubernetes.io/instance: umbrella
---
# Source: umbrella/charts/app2/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: umbrella-app2
labels:
helm.sh/chart: app2-0.1.0
app.kubernetes.io/name: app2
app.kubernetes.io/instance: umbrella
app.kubernetes.io/version: "1.16.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: app2
app.kubernetes.io/instance: umbrella
$ helm upgrade --install umbrella umbrella --debug --dry-run --values umbrella/values.yaml
MANIFEST:
---
# Source: umbrella/charts/app1/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: umbrella-app1
labels:
helm.sh/chart: app1-0.1.0
app.kubernetes.io/name: app1
app.kubernetes.io/instance: umbrella
app.kubernetes.io/version: "1.16.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 1234
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: app1
app.kubernetes.io/instance: umbrella
---
# Source: umbrella/charts/app2/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: umbrella-app2
labels:
helm.sh/chart: app2-0.1.0
app.kubernetes.io/name: app2
app.kubernetes.io/instance: umbrella
app.kubernetes.io/version: "1.16.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: app2
app.kubernetes.io/instance: umbrellaNotice the I think this fixes the issue and test case passed during local run. |
|
I'll simplify the test data directory. There's a bit too many adjacent things going on there. |
Signed-off-by: Matthew Fisher <[email protected]>
Problem: the warnings don't give enough details about which values are problematic, only the name of the leaf key. This is all the more annoying when you have a chart depending on other charts. ``` mainchart | +- subchart1 +- subchart2 +- subchart3 ``` Here are some warnings I get before the change: ``` coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value coalesce.go:160: warning: skipped value for resources: Not a table. coalesce.go:160: warning: skipped value for googleSheetsServiceAccount: Not a table. coalesce.go:199: warning: destination for googleSheetsServiceAccount is a table. Ignoring non-table value coalesce.go:199: warning: destination for resources is a table. Ignoring non-table value [] coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value coalesce.go:160: warning: skipped value for resources: Not a table. coalesce.go:160: warning: skipped value for googleSheetsServiceAccount: Not a table. ``` with fix: ``` coalesce.go:162: warning: skipped value for subchart1.resources: Not a table. coalesce.go:162: warning: skipped value for subchart2.googleSheetsServiceAccount: Not a table. coalesce.go:211: warning: destination for subchart3.aws.credentials is a table. Ignoring non-table value () coalesce.go:211: warning: destination for mainchart.subchart3.aws.credentials is a table. Ignoring non-table value () coalesce.go:211: warning: destination for mainchart.subchart2.googleSheetsServiceAccount is a table. Ignoring non-table value () coalesce.go:211: warning: destination for mainchart.subchart1.resources is a table. Ignoring non-table value ([]) coalesce.go:162: warning: skipped value for subchart1.resources: Not a table. coalesce.go:162: warning: skipped value for subchart2.googleSheetsServiceAccount: Not a table. coalesce.go:211: warning: destination for subchart3.aws.credentials is a table. Ignoring non-table value () ``` Signed-off-by: Damien Nozay <[email protected]> add tests Signed-off-by: Damien Nozay <[email protected]>
Signed-off-by: Aram Zegerius <[email protected]> Signed-off-by: Ankita Bhopatkar <[email protected]>
Signed-off-by: Aram Zegerius <[email protected]> Signed-off-by: Ankita Bhopatkar <[email protected]>
|
Simplified test data. I think it can be merged @bacongobbler @zonggen |
|
Ran the test case and with |
|
Hi @mattfarina, I see this has been marked to 3.8.1 milestone instead of the 3.8.0. Is there anything pending on this MR? We have to workaround a lot because of this bug and would appreciate it released as soon as possible. Thanks! |
Fix value precedence when importing values from child, as described in issue #9940
What this PR does / why we need it:
Closes #9940
If applicable: