Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

k8s/script: allow parallelizing custom script without clear-containers #2067

Merged
merged 1 commit into from
Jan 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions parts/k8s/kubernetesmastercustomscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this got moved up in your previous PR? if not it can probably go back to right after echo `date`,`hostname`,` RunCmdCompleted>>/opt/m

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it up since we are installing things for clearcontainers i didn't want it to upgrade... but can move inside the if if that hellps

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I think it's needed for all runtimes, not just clearcontainers so let's leave it as is

# make sure walinuxagent doesn't get updated in the middle of running this script
Expand Down Expand Up @@ -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
Expand Down