From d4cf0572e6b227bbcb4bfb0ce23e85f812beb667 Mon Sep 17 00:00:00 2001 From: Benjamin Schanzel Date: Wed, 21 Oct 2020 10:28:17 +0200 Subject: [PATCH] k8s/OpenShift Provider: Remove workingDir Attribute For users to be able to specifiy a custom working dir for their container nodes this change removes the hard-coded /tmp workingDir attribute from the container specs. The user-specified WORKDIR from the respective Dockerfile is then used. Change-Id: I0e2c0ca5be0af2360f54336340a40fa37ffe1001 --- nodepool/driver/kubernetes/provider.py | 1 - nodepool/driver/openshift/provider.py | 1 - ...ovider-remove-default-workdir-21df518c822b2914.yaml | 10 ++++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/k8s-provider-remove-default-workdir-21df518c822b2914.yaml diff --git a/nodepool/driver/kubernetes/provider.py b/nodepool/driver/kubernetes/provider.py index 6a82fdd4b..78603207d 100644 --- a/nodepool/driver/kubernetes/provider.py +++ b/nodepool/driver/kubernetes/provider.py @@ -281,7 +281,6 @@ class KubernetesProvider(Provider, QuotaSupport): 'imagePullPolicy': label.image_pull, 'command': ["/bin/sh", "-c"], 'args': ["while true; do sleep 30; done;"], - 'workingDir': '/tmp', 'env': label.env, } diff --git a/nodepool/driver/openshift/provider.py b/nodepool/driver/openshift/provider.py index 8228a9407..f39a59d8e 100644 --- a/nodepool/driver/openshift/provider.py +++ b/nodepool/driver/openshift/provider.py @@ -210,7 +210,6 @@ class OpenshiftProvider(Provider): 'imagePullPolicy': label.image_pull, 'command': ["/bin/sh", "-c"], 'args': ["while true; do sleep 30; done;"], - 'workingDir': '/tmp', 'env': label.env, } if label.cpu or label.memory: diff --git a/releasenotes/notes/k8s-provider-remove-default-workdir-21df518c822b2914.yaml b/releasenotes/notes/k8s-provider-remove-default-workdir-21df518c822b2914.yaml new file mode 100644 index 000000000..9859d4be3 --- /dev/null +++ b/releasenotes/notes/k8s-provider-remove-default-workdir-21df518c822b2914.yaml @@ -0,0 +1,10 @@ +--- +upgrade: + - | + The k8s and OpenShift providers do not longer set the workingDir attribute + of their container specs to /tmp. + + For increased flexibility for the user, the working dir specified in the + container images Dockerfile is used as the default in container nodes. + Please note that this might often be the root dir ('/') if not specified + otherwise by the respective Dockerfiles WORKDIR directive.