Skip to content

Commit

Permalink
Merge pull request #124449 from SergeyKanzhelev/fiximageUtils
Browse files Browse the repository at this point in the history
added init to image-utils.sh
  • Loading branch information
k8s-ci-robot committed Apr 23, 2024
2 parents 16a594f + 7951d79 commit 2806ffe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/images/image-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export DOCKER_CLI_EXPERIMENTAL="enabled"
DOCKER_CERT_BASE_PATH="${DOCKER_CERT_BASE_PATH:-${HOME}}"

KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
source "${KUBE_ROOT}/hack/lib/init.sh"
source "${KUBE_ROOT}/hack/lib/logging.sh"
source "${KUBE_ROOT}/hack/lib/util.sh"

Expand Down Expand Up @@ -265,11 +266,16 @@ bin() {
fi
for SRC in "$@";
do
docker run --rm -v "${TARGET}:${TARGET}:Z" -v "${KUBE_ROOT}":/go/src/k8s.io/kubernetes:Z \
local -r target=${TARGET:-}
if [[ -z "${target}" ]]; then
echo "TARGET is not set"
exit 1
fi
docker run --rm -v "${target}:${target}:Z" -v "${KUBE_ROOT}":/go/src/k8s.io/kubernetes:Z \
golang:"${GOLANG_VERSION}" \
/bin/bash -c "\
cd /go/src/k8s.io/kubernetes/test/images/${SRC_DIR} && \
CGO_ENABLED=0 ${arch_prefix} GOOS=${OS} GOARCH=${ARCH} go build -a -installsuffix cgo --ldflags \"-w ${LD_FLAGS:-}\" -o ${TARGET}/${SRC} ./$(dirname "${SRC}")"
CGO_ENABLED=0 ${arch_prefix} GOOS=${OS} GOARCH=${ARCH} go build -a -installsuffix cgo --ldflags \"-w ${LD_FLAGS:-}\" -o ${target}/${SRC} ./$(dirname "${SRC}")"
done
}

Expand Down

0 comments on commit 2806ffe

Please sign in to comment.