-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Bug Report
What did you do?
Deploy a helm operator to manage a helm chart with a number of dependencies.
What did you expect to see?
Upgrades only when either the chart or the cr contained spec values change.
What did you see instead? Under which circumstances?
the isUpgrade method (in current master at)
internal/helm/release/manager.go:168
always returns true
.
after some debugging, i figured that this happens because the chart from the manager (m.chart
in that method) only contains Values coming from the main chart's values.yaml
; while the chart from the release (deployedRelease.Chart
in that code) contains (non-empty, non-null) defaults from the dependencies charts' values.yaml
files as well.
therefore ok, err := equalJSONStruct(m.chart, deployedRelease.Chart)
always sets ok to false
(Values never matches).
Environment
Operator type:
/language helm
$ operator-sdk version
v1.8.0
but v1.8.1 operator image, as well as current master build have the same behavior.
$ go version
(if language is Go)
go version go1.16.5 linux/amd64
Possible Solution
i don't have any experience with go (other than two or three debugging attempts).
am testing an approach where the manager_factory
enriches the manager
chart Values with the (non-null, non-empty) defaults from the dependencies charts as well. this does look promising. but having no knowledge in go, nor experience with helm apis, i find it very hard to determine whether that makes sense.
Additional context
something seems misaligned between the Values view of loader.LoadDir(f.chartDir)
in manager_factory vs those returned by m.getDeployedRelease()
if there is something i need to adjust in either my chart definition, or the way i deploy the operator to align the values, i would love to know. but couldn't find.