test(gha-runner-scale-set): fix emptyDir tests to use ValuesFiles
Replace SetValues with ValuesFiles for tests that use emptyDir: {}
to avoid Helm CLI's --set limitation that misparses object syntax.
- Create values_k8s_novolume_custom_volumes.yaml
- Create values_k8s_novolume_custom_volume_mounts.yaml
- Update WithCustomVolumes and WithCustomVolumeMounts tests
Fixes test failures introduced in previous commit.
This commit is contained in:
@@ -1169,21 +1169,16 @@ func TestTemplateRenderedAutoScalingRunnerSet_EnableKubernetesModeNoVolume_WithC
|
|||||||
helmChartPath, err := filepath.Abs("../../gha-runner-scale-set")
|
helmChartPath, err := filepath.Abs("../../gha-runner-scale-set")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
testValuesPath, err := filepath.Abs("../tests/values_k8s_novolume_custom_volumes.yaml")
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
releaseName := "test-runners"
|
releaseName := "test-runners"
|
||||||
namespaceName := "test-" + strings.ToLower(random.UniqueId())
|
namespaceName := "test-" + strings.ToLower(random.UniqueId())
|
||||||
|
|
||||||
// Test that user-provided volumes are preserved even in kubernetes-novolume mode
|
// Test that user-provided volumes are preserved even in kubernetes-novolume mode
|
||||||
options := &helm.Options{
|
options := &helm.Options{
|
||||||
Logger: logger.Discard,
|
Logger: logger.Discard,
|
||||||
SetValues: map[string]string{
|
ValuesFiles: []string{testValuesPath},
|
||||||
"githubConfigUrl": "https://github.com/actions",
|
|
||||||
"githubConfigSecret.github_token": "gh_token12345",
|
|
||||||
"containerMode.type": "kubernetes-novolume",
|
|
||||||
"controllerServiceAccount.name": "arc",
|
|
||||||
"controllerServiceAccount.namespace": "arc-system",
|
|
||||||
"template.spec.volumes[0].name": "custom-volume",
|
|
||||||
"template.spec.volumes[0].emptyDir": "{}",
|
|
||||||
},
|
|
||||||
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
|
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1205,24 +1200,16 @@ func TestTemplateRenderedAutoScalingRunnerSet_EnableKubernetesModeNoVolume_WithC
|
|||||||
helmChartPath, err := filepath.Abs("../../gha-runner-scale-set")
|
helmChartPath, err := filepath.Abs("../../gha-runner-scale-set")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
testValuesPath, err := filepath.Abs("../tests/values_k8s_novolume_custom_volume_mounts.yaml")
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
releaseName := "test-runners"
|
releaseName := "test-runners"
|
||||||
namespaceName := "test-" + strings.ToLower(random.UniqueId())
|
namespaceName := "test-" + strings.ToLower(random.UniqueId())
|
||||||
|
|
||||||
// Test that user-provided volumeMounts are preserved in kubernetes-novolume runner container
|
// Test that user-provided volumeMounts are preserved in kubernetes-novolume runner container
|
||||||
options := &helm.Options{
|
options := &helm.Options{
|
||||||
Logger: logger.Discard,
|
Logger: logger.Discard,
|
||||||
SetValues: map[string]string{
|
ValuesFiles: []string{testValuesPath},
|
||||||
"githubConfigUrl": "https://github.com/actions",
|
|
||||||
"githubConfigSecret.github_token": "gh_token12345",
|
|
||||||
"containerMode.type": "kubernetes-novolume",
|
|
||||||
"controllerServiceAccount.name": "arc",
|
|
||||||
"controllerServiceAccount.namespace": "arc-system",
|
|
||||||
"template.spec.volumes[0].name": "custom-volume",
|
|
||||||
"template.spec.volumes[0].emptyDir": "{}",
|
|
||||||
"template.spec.containers[0].name": "runner",
|
|
||||||
"template.spec.containers[0].volumeMounts[0].name": "custom-volume",
|
|
||||||
"template.spec.containers[0].volumeMounts[0].mountPath": "/mnt/custom",
|
|
||||||
},
|
|
||||||
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
|
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
githubConfigUrl: https://github.com/actions
|
||||||
|
githubConfigSecret:
|
||||||
|
github_token: gh_token12345
|
||||||
|
containerMode:
|
||||||
|
type: kubernetes-novolume
|
||||||
|
controllerServiceAccount:
|
||||||
|
name: arc
|
||||||
|
namespace: arc-system
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
volumes:
|
||||||
|
- name: custom-volume
|
||||||
|
emptyDir: {}
|
||||||
|
containers:
|
||||||
|
- name: runner
|
||||||
|
volumeMounts:
|
||||||
|
- name: custom-volume
|
||||||
|
mountPath: /mnt/custom
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
githubConfigUrl: https://github.com/actions
|
||||||
|
githubConfigSecret:
|
||||||
|
github_token: gh_token12345
|
||||||
|
containerMode:
|
||||||
|
type: kubernetes-novolume
|
||||||
|
controllerServiceAccount:
|
||||||
|
name: arc
|
||||||
|
namespace: arc-system
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
volumes:
|
||||||
|
- name: custom-volume
|
||||||
|
emptyDir: {}
|
||||||
Reference in New Issue
Block a user