Skip to content

Commit

Permalink
Add support for running kuryr with ocata devstack.
Browse files Browse the repository at this point in the history
The signature for run_process is different between older and newer versions of
devstack. This patch works around those issues by calling sudo directly.

However, sudo cannot be called in systemd so we use the new signature when
IS_SYSTEMD is True and sudo in all other instances.

Ocata:  run_process service "command-line" [group]
Master: run_process service "command-line" [group] [user]

Change-Id: Ia2ca599fe1dc5df945425b27dc5ac70c93f47f8e
Closes-Bug: 1693323
  • Loading branch information
Frederick F. Kautz IV committed Jun 9, 2017
1 parent 87039c6 commit 20bdaa8
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions devstack/plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,21 @@ function prepare_docker {

function run_docker {
local dockerd_bin=$(which dockerd)
run_process docker \
"$dockerd_bin --debug=true \
-H unix://$KURYR_DOCKER_ENGINE_SOCKET_FILE" "" "root"

if [[ "$USE_SYSTEMD" = "True" ]]; then
# If systemd is being used, proceed as normal
run_process docker \
"$dockerd_bin --debug=true \
-H unix://$KURYR_DOCKER_ENGINE_SOCKET_FILE" "root" "root"
else
# If screen is being used, there is a possibility that the devstack
# environment is on a stable branch. Older versions of run_process have
# a different signature. Sudo is used as a workaround that works in
# both older and newer versions of devstack.
run_process docker \
"sudo $dockerd_bin --debug=true \
-H unix://$KURYR_DOCKER_ENGINE_SOCKET_FILE"
fi

# We put the stack user as owner of the socket so we do not need to
# run the Docker commands with sudo when developing.
Expand Down Expand Up @@ -537,7 +549,16 @@ function run_k8s_kubelet {
--cert-dir=${KURYR_HYPERKUBE_DATA_DIR}/kubelet.cert \
--root-dir=${KURYR_HYPERKUBE_DATA_DIR}/kubelet"
wait_for "Kubernetes API Server" "$KURYR_K8S_API_URL"
run_process kubelet "$command" "" "root"
if [[ "$USE_SYSTEMD" = "True" ]]; then
# If systemd is being used, proceed as normal
run_process kubelet "$command" root root
else
# If screen is being used, there is a possibility that the devstack
# environment is on a stable branch. Older versions of run_process have
# a different signature. Sudo is used as a workaround that works in
# both older and newer versions of devstack.
run_process kubelet "sudo $command"
fi
}

function run_kuryr_kubernetes {
Expand Down

0 comments on commit 20bdaa8

Please sign in to comment.