mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
build: fix a logic error in shell script.
The right place to assign the "docker inspect" return value is outside of the subshell. The last return value was coming from something else than the expected command.
This commit is contained in:
parent
551f73d324
commit
7a67246d47
@ -501,9 +501,11 @@ function kube::build::ensure_data_container() {
|
||||
# If the data container exists AND exited successfully, we can use it.
|
||||
# Otherwise nuke it and start over.
|
||||
local ret=0
|
||||
local code=$(docker inspect \
|
||||
local code=0
|
||||
|
||||
code=$(docker inspect \
|
||||
-f '{{.State.ExitCode}}' \
|
||||
"${KUBE_DATA_CONTAINER_NAME}" 2>/dev/null || ret=$?)
|
||||
"${KUBE_DATA_CONTAINER_NAME}" 2>/dev/null) || ret=$?
|
||||
if [[ "${ret}" == 0 && "${code}" != 0 ]]; then
|
||||
kube::build::destroy_container "${KUBE_DATA_CONTAINER_NAME}"
|
||||
ret=1
|
||||
|
Loading…
Reference in New Issue
Block a user