Skip to content

Commit fa48189

Browse files
mfojtikopenshift-cherrypick-robot
authored and
openshift-cherrypick-robot
committed
hack: copy oc to kubectl
1 parent 5a04ef7 commit fa48189

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

hack/lib/build/binaries.sh

+13-5
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,18 @@ function os::build::place_bins() {
330330
fi
331331
done
332332

333+
# Link binaries that we want to link (eg. oc->kubectl)
334+
local suffix=""
335+
if [[ $platform == "windows/amd64" ]]; then
336+
suffix=".exe"
337+
fi
338+
for linkname in "${OC_BINARY_COPY[@]}"; do
339+
local src="${OS_OUTPUT_BINPATH}/${platform}/oc${suffix}"
340+
if [[ -f "${src}" ]]; then
341+
ln -f "$src" "${OS_OUTPUT_BINPATH}/${platform}/${linkname}${suffix}"
342+
fi
343+
done
344+
333345
# If no release archive was requested, we're done.
334346
if [[ "${OS_RELEASE_ARCHIVE-}" == "" ]]; then
335347
continue
@@ -342,14 +354,10 @@ function os::build::place_bins() {
342354
done
343355

344356
# Create binary copies where specified.
345-
local suffix=""
346-
if [[ $platform == "windows/amd64" ]]; then
347-
suffix=".exe"
348-
fi
349357
for linkname in "${OC_BINARY_COPY[@]}"; do
350358
local src="${release_binpath}/oc${suffix}"
351359
if [[ -f "${src}" ]]; then
352-
ln "${release_binpath}/oc${suffix}" "${release_binpath}/${linkname}${suffix}"
360+
cp -f "${release_binpath}/oc${suffix}" "${release_binpath}/${linkname}${suffix}"
353361
fi
354362
done
355363

0 commit comments

Comments
 (0)