Skip to content

Commit c8dae83

Browse files
authored
Merge branch 'main' into fix-azure-aks-example
2 parents 77b75d8 + 810156e commit c8dae83

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Read the [Gruntwork contribution guidelines](https://gruntwork.notion.site/Grunt
1414
- [ ] Run the relevant tests successfully, including pre-commit checks.
1515
- [ ] Ensure any 3rd party code adheres with our [license policy](https://www.notion.so/gruntwork/Gruntwork-licenses-and-open-source-usage-policy-f7dece1f780341c7b69c1763f22b1378) or delete this line if its not applicable.
1616
- [ ] Include release notes. If this PR is backward incompatible, include a migration guide.
17+
- [ ] Make a plan for release of the functionality in this PR. If it delivers value to an end user, you are responsible for ensuring it is released promptly, and correctly. If you are not a maintainer, you are responsible for finding a maintainer to do this for you.
1718

1819
## Release Notes (draft)
1920

modules/helm/template.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ func RenderRemoteTemplateE(t testing.TestingT, options *Options, chartURL string
110110

111111
// ... and add the helm chart name, the remote repo and chart URL at the end
112112
args = append(args, releaseName, "--repo", chartURL)
113+
if options.Version != "" {
114+
args = append(args, "--version", options.Version)
115+
}
113116

114117
// Finally, call out to helm template command
115118
return RunHelmCommandAndGetStdOutE(t, options, "template", args...)

modules/helm/template_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func TestRemoteChartRender(t *testing.T) {
2727
remoteChartSource = "https://charts.bitnami.com/bitnami"
2828
remoteChartName = "nginx"
2929
remoteChartVersion = "13.2.24"
30+
registry = "registry-1.docker.io"
3031
)
3132

3233
t.Parallel()
@@ -42,11 +43,12 @@ func TestRemoteChartRender(t *testing.T) {
4243
options := &Options{
4344
SetValues: map[string]string{
4445
"image.repository": remoteChartName,
45-
"image.registry": "",
46+
"image.registry": registry,
4647
"image.tag": remoteChartVersion,
4748
},
4849
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
4950
Logger: logger.Discard,
51+
Version: remoteChartVersion,
5052
}
5153

5254
// Run RenderTemplate to render the template and capture the output. Note that we use the version without `E`, since
@@ -62,10 +64,10 @@ func TestRemoteChartRender(t *testing.T) {
6264
require.Equal(t, namespaceName, deployment.Namespace)
6365

6466
// Finally, we verify the deployment pod template spec is set to the expected container image value
65-
expectedContainerImage := remoteChartName + ":" + remoteChartVersion
67+
expectedContainerImage := registry + "/" + remoteChartName + ":" + remoteChartVersion
6668
deploymentContainers := deployment.Spec.Template.Spec.Containers
6769
require.Equal(t, len(deploymentContainers), 1)
68-
require.Equal(t, deploymentContainers[0].Image, expectedContainerImage)
70+
require.Equal(t, expectedContainerImage, deploymentContainers[0].Image)
6971
}
7072

7173
// Test that we can dump all the manifest locally a remote chart (e.g bitnami/nginx)
@@ -81,15 +83,15 @@ func TestRemoteChartRenderDiff(t *testing.T) {
8183

8284
initialSnapshot := t.TempDir()
8385
updatedSnapshot := t.TempDir()
84-
renderChartDump(t, "5.0.0", initialSnapshot)
85-
output := renderChartDump(t, "5.1.0", updatedSnapshot)
86+
renderChartDump(t, "13.2.20", initialSnapshot)
87+
output := renderChartDump(t, "13.2.24", updatedSnapshot)
8688

8789
options := &Options{
8890
Logger: logger.Default,
8991
SnapshotPath: initialSnapshot,
9092
}
9193
// diff in: spec.initContainers.preserve-logs-symlinks.imag, spec.containers.nginx.image, tls certificates
92-
require.Equal(t, 5, DiffAgainstSnapshot(t, options, output, "nginx"))
94+
require.Equal(t, 4, DiffAgainstSnapshot(t, options, output, "nginx"))
9395
}
9496

9597
// render chart dump and return the rendered output
@@ -111,6 +113,7 @@ func renderChartDump(t *testing.T, remoteChartVersion, snapshotDir string) strin
111113
},
112114
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
113115
Logger: logger.Discard,
116+
Version: remoteChartVersion,
114117
}
115118

116119
// Run RenderTemplate to render the template and capture the output. Note that we use the version without `E`, since

0 commit comments

Comments
 (0)