Skip to content

Commit

Permalink
Remove webhook capi Helm values (rancher#44710)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomleb authored Mar 19, 2024
1 parent 941d6d3 commit a6bb961
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
7 changes: 4 additions & 3 deletions pkg/controllers/dashboard/systemcharts/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ func (h *handler) getChartsToInstall() []*chart.Definition {
ExactVersionSetting: settings.RancherWebhookVersion,
Values: func() map[string]interface{} {
values := map[string]interface{}{
"capi": map[string]interface{}{
"enabled": false,
},
// This is no longer used in the webhook chart but previous values can still be found
// with `helm get values -n cattle-system rancher-webhook` which can be confusing. We
// completely remove the previous capi values by setting it to nil here.
"capi": nil,
"mcm": map[string]interface{}{
"enabled": features.MCM.Enabled(),
},
Expand Down
16 changes: 4 additions & 12 deletions pkg/controllers/dashboard/systemcharts/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ func Test_ChartInstallation(t *testing.T) {
settings.RancherWebhookVersion.Set("2.0.0")
expectedValues := map[string]interface{}{
"priorityClassName": priorityClassName,
"capi": map[string]interface{}{
"enabled": false,
},
"capi": nil,
"mcm": map[string]interface{}{
"enabled": features.MCM.Enabled(),
},
Expand Down Expand Up @@ -134,9 +132,7 @@ func Test_ChartInstallation(t *testing.T) {
mocks.configCache.EXPECT().Get(gomock.Any(), chart.CustomValueMapName).Return(nil, errTest).Times(4)
settings.RancherWebhookVersion.Set("2.0.0")
expectedValues := map[string]interface{}{
"capi": map[string]interface{}{
"enabled": false,
},
"capi": nil,
"mcm": map[string]interface{}{
"enabled": features.MCM.Enabled(),
},
Expand Down Expand Up @@ -183,9 +179,7 @@ func Test_ChartInstallation(t *testing.T) {
mocks.configCache.EXPECT().Get(gomock.Any(), chart.CustomValueMapName).Return(emptyConfig, nil).Times(4)
settings.RancherWebhookVersion.Set("2.0.1")
expectedValues := map[string]interface{}{
"capi": map[string]interface{}{
"enabled": false,
},
"capi": nil,
"mcm": map[string]interface{}{
"enabled": features.MCM.Enabled(),
},
Expand Down Expand Up @@ -242,9 +236,7 @@ func Test_ChartInstallation(t *testing.T) {
features.MCM.Set(true)
expectedValues := map[string]interface{}{
"priorityClassName": "newClass",
"capi": map[string]interface{}{
"enabled": false,
},
"capi": nil,
"mcm": map[string]interface{}{
"enabled": false,
},
Expand Down

0 comments on commit a6bb961

Please sign in to comment.