k8s/script: allow parallelizing custom script without clear-containers
@@ -644,8 +644,13 @@ users:
set -x
}
+if [[ "$CONTAINER_RUNTIME" == "clear-containers" ]]; then
+ # If the container runtime is "clear-containers" we need to ensure the
+ # run command is completed _before_ we start installing all the dependencies
+ # for clear-containers to make sure there is not a dpkg lock.
ensureRunCommandCompleted
echo `date`,`hostname`, RunCmdCompleted>>/opt/m
+fi
if [[ $OS == $UBUNTU_OS_NAME ]]; then
# make sure walinuxagent doesn't get updated in the middle of running this script
@@ -678,6 +683,11 @@ echo `date`,`hostname`, ensureJournalStart>>/opt/m
ensureJournal
echo `date`,`hostname`, ensureJournalDone>>/opt/m
+# On all other runtimes, but "clear-containers" we can ensure the run command
+# completed here to allow for parallelizing the custom script
+ensureRunCommandCompleted
+echo `date`,`hostname`, RunCmdCompleted>>/opt/m
+
# master only
if [[ ! -z "${APISERVER_PRIVATE_KEY}" ]]; then
writeKubeConfig
