-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support rad install kubernetes --set values (#5243)
# Description Introduce rad install kubernetes --set which can set single or multiple comma separated values for helm chart. ex: rad install kubernetes --set global.ucp.image=radius.azurecr.io/ucpd,global.ucp.tag=latest rad install kubernetes --set global.tracerProvider.zipkin.url=http://jaeger-collector.radius-monitoring.svc.cluster.local:9411/api/v2/spans ## Issue reference Partially Fixes: #5173 based on discussion here : https://github.com/project-radius/radius/issues/5173#issuecomment-1452655212 ## Checklist Please make sure you've completed the relevant tasks for this PR, out of the following list: * [ ] Code compiles correctly * [ ] Adds necessary unit tests for change * [ ] Adds necessary E2E tests for change * [ ] Unit tests passing * [ ] Extended the documentation / Created issue for it
- Loading branch information
Showing
5 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// ------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// ------------------------------------------------------------ | ||
package helm | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
"helm.sh/helm/v3/pkg/chart" | ||
) | ||
|
||
func Test_AddRadiusValues(t *testing.T) { | ||
var helmChart chart.Chart | ||
helmChart.Values = map[string]any{} | ||
options := &RadiusOptions{ | ||
Image: "image", | ||
Values: "global.de.tag=de-tag,global.ucp.tag=ucp-tag,", | ||
} | ||
err := AddRadiusValues(&helmChart, options) | ||
values := helmChart.Values | ||
require.Equal(t, err, nil) | ||
|
||
_, ok := values["global"] | ||
assert.True(t, ok) | ||
global := values["global"].(map[string]any) | ||
_, ok = global["rp"] | ||
assert.True(t, ok) | ||
rp := global["rp"].(map[string]any) | ||
_, ok = rp["container"] | ||
assert.True(t, ok) | ||
assert.Equal(t, rp["container"], "image") | ||
|
||
_, ok = values["global"] | ||
assert.True(t, ok) | ||
global = values["global"].(map[string]any) | ||
_, ok = global["de"] | ||
assert.True(t, ok) | ||
de := global["de"].(map[string]any) | ||
_, ok = de["tag"] | ||
assert.True(t, ok) | ||
assert.Equal(t, de["tag"], "de-tag") | ||
|
||
_, ok = global["ucp"] | ||
assert.True(t, ok) | ||
ucp := global["ucp"].(map[string]any) | ||
_, ok = ucp["tag"] | ||
assert.True(t, ok) | ||
assert.Equal(t, ucp["tag"], "ucp-tag") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters