Skip to content

Commit 2a9fb70

Browse files
committed
Revert "fix(controller): default volume/mount to emissary (argoproj#7125)"
This reverts commit 49b3f0c. Signed-off-by: Alex Collins <[email protected]>
1 parent fc4c3d5 commit 2a9fb70

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

workflow/controller/container_set_template_test.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ spec:
4242
pod, err := getPod(woc, "pod")
4343
assert.NoError(t, err)
4444

45+
socket := corev1.HostPathSocket
4546
assert.ElementsMatch(t, []corev1.Volume{
46-
{Name: "var-run-argo", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}},
47+
{Name: "docker-sock", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/var/run/docker.sock", Type: &socket}}},
4748
{Name: "workspace", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}},
4849
}, pod.Spec.Volumes)
4950

@@ -53,7 +54,9 @@ spec:
5354
for _, c := range pod.Spec.Containers {
5455
switch c.Name {
5556
case common.WaitContainerName:
56-
assert.ElementsMatch(t, []corev1.VolumeMount{}, c.VolumeMounts)
57+
assert.ElementsMatch(t, []corev1.VolumeMount{
58+
{Name: "docker-sock", MountPath: "/var/run/docker.sock", ReadOnly: true},
59+
}, c.VolumeMounts)
5760
case "ctr-0":
5861
assert.ElementsMatch(t, []corev1.VolumeMount{
5962
{Name: "workspace", MountPath: "/workspace"},
@@ -105,8 +108,9 @@ spec:
105108
pod, err := getPod(woc, "pod")
106109
assert.NoError(t, err)
107110

111+
socket := corev1.HostPathSocket
108112
assert.ElementsMatch(t, []corev1.Volume{
109-
{Name: "var-run-argo", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}},
113+
{Name: "docker-sock", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/var/run/docker.sock", Type: &socket}}},
110114
{Name: "workspace", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}},
111115
{Name: "input-artifacts", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}},
112116
}, pod.Spec.Volumes)
@@ -124,6 +128,7 @@ spec:
124128
switch c.Name {
125129
case common.WaitContainerName:
126130
assert.ElementsMatch(t, []corev1.VolumeMount{
131+
{Name: "docker-sock", MountPath: "/var/run/docker.sock", ReadOnly: true},
127132
{Name: "workspace", MountPath: "/mainctrfs/workspace"},
128133
{Name: "input-artifacts", MountPath: "/mainctrfs/in/in-0", SubPath: "in-0"},
129134
}, c.VolumeMounts)
@@ -179,8 +184,9 @@ spec:
179184
pod, err := getPod(woc, "pod")
180185
assert.NoError(t, err)
181186

187+
socket := corev1.HostPathSocket
182188
assert.ElementsMatch(t, []corev1.Volume{
183-
{Name: "var-run-argo", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}},
189+
{Name: "docker-sock", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/var/run/docker.sock", Type: &socket}}},
184190
{Name: "workspace", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}},
185191
}, pod.Spec.Volumes)
186192

@@ -191,6 +197,7 @@ spec:
191197
switch c.Name {
192198
case common.WaitContainerName:
193199
assert.ElementsMatch(t, []corev1.VolumeMount{
200+
{Name: "docker-sock", MountPath: "/var/run/docker.sock", ReadOnly: true},
194201
{Name: "workspace", MountPath: "/mainctrfs/workspace"},
195202
}, c.VolumeMounts)
196203
case "main":

workflow/controller/workflowpod.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ func (woc *wfOperationCtx) newWaitContainer(tmpl *wfv1.Template) *apiv1.Containe
535535
// in order to SIGTERM/SIGKILL the pid
536536
ctr.SecurityContext.Privileged = pointer.BoolPtr(true)
537537
}
538-
case common.ContainerRuntimeExecutorDocker:
538+
case "", common.ContainerRuntimeExecutorDocker:
539539
ctr.VolumeMounts = append(ctr.VolumeMounts, woc.getVolumeMountDockerSock(tmpl))
540540
}
541541
return ctr
@@ -638,10 +638,10 @@ func (woc *wfOperationCtx) createVolumes(tmpl *wfv1.Template) []apiv1.Volume {
638638
}
639639
switch woc.getContainerRuntimeExecutor() {
640640
case common.ContainerRuntimeExecutorKubelet, common.ContainerRuntimeExecutorK8sAPI, common.ContainerRuntimeExecutorPNS:
641-
case common.ContainerRuntimeExecutorDocker:
642-
volumes = append(volumes, woc.getVolumeDockerSock(tmpl))
643-
default:
641+
case common.ContainerRuntimeExecutorEmissary:
644642
volumes = append(volumes, volumeVarArgo)
643+
default:
644+
volumes = append(volumes, woc.getVolumeDockerSock(tmpl))
645645
}
646646
volumes = append(volumes, tmpl.Volumes...)
647647
return volumes

workflow/controller/workflowpod_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,6 @@ spec:
15261526
func TestHybridWfVolumesWindows(t *testing.T) {
15271527
wf := wfv1.MustUnmarshalWorkflow(helloWindowsWf)
15281528
woc := newWoc(*wf)
1529-
woc.controller.Config.ContainerRuntimeExecutor = common.ContainerRuntimeExecutorDocker
15301529

15311530
ctx := context.Background()
15321531
mainCtr := woc.execWf.Spec.Templates[0].Container
@@ -1587,7 +1586,6 @@ func TestWindowsUNCPathsAreRemoved(t *testing.T) {
15871586
func TestHybridWfVolumesLinux(t *testing.T) {
15881587
wf := wfv1.MustUnmarshalWorkflow(helloLinuxWf)
15891588
woc := newWoc(*wf)
1590-
woc.controller.Config.ContainerRuntimeExecutor = common.ContainerRuntimeExecutorDocker
15911589

15921590
ctx := context.Background()
15931591
mainCtr := woc.execWf.Spec.Templates[0].Container

workflow/validate/validate_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,7 +1626,7 @@ func TestBaseImageOutputVerify(t *testing.T) {
16261626
wfNonPathOutputParam := unmarshalWf(nonPathOutputParameter)
16271627
var err error
16281628

1629-
for _, executor := range []string{common.ContainerRuntimeExecutorK8sAPI, common.ContainerRuntimeExecutorKubelet, common.ContainerRuntimeExecutorPNS, common.ContainerRuntimeExecutorDocker, common.ContainerRuntimeExecutorDocker, common.ContainerRuntimeExecutorEmissary, ""} {
1629+
for _, executor := range []string{common.ContainerRuntimeExecutorK8sAPI, common.ContainerRuntimeExecutorKubelet, common.ContainerRuntimeExecutorPNS, common.ContainerRuntimeExecutorDocker, ""} {
16301630
switch executor {
16311631
case common.ContainerRuntimeExecutorK8sAPI, common.ContainerRuntimeExecutorKubelet:
16321632
_, err = ValidateWorkflow(wftmplGetter, cwftmplGetter, wfBaseOutArt, ValidateOpts{ContainerRuntimeExecutor: executor})
@@ -1644,7 +1644,7 @@ func TestBaseImageOutputVerify(t *testing.T) {
16441644
assert.NoError(t, err)
16451645
_, err = ValidateWorkflow(wftmplGetter, cwftmplGetter, wfBaseWithEmptyDirOutArt, ValidateOpts{ContainerRuntimeExecutor: executor})
16461646
assert.Error(t, err)
1647-
case common.ContainerRuntimeExecutorDocker, common.ContainerRuntimeExecutorEmissary, "":
1647+
case common.ContainerRuntimeExecutorDocker, "":
16481648
_, err = ValidateWorkflow(wftmplGetter, cwftmplGetter, wfBaseOutArt, ValidateOpts{ContainerRuntimeExecutor: executor})
16491649
assert.NoError(t, err)
16501650
_, err = ValidateWorkflow(wftmplGetter, cwftmplGetter, wfBaseOutParam, ValidateOpts{ContainerRuntimeExecutor: executor})

0 commit comments

Comments
 (0)