fix(cli): remove exp scaletest from slim binary (#9934)

- Removes the `exp scaletest` command from the slim binary 
- Updates scaletest-runner template to fetch the full binary from the running Coder instance
This commit is contained in:
Cian Johnston
2023-10-03 15:13:04 +01:00
committed by GitHub
parent 45b53c285f
commit 9aac15212b
4 changed files with 74 additions and 4 deletions

View File

@ -20,7 +20,6 @@ ARCH="$(arch)"
if [[ "$ARCH" == "x86_64" ]]; then
ARCH="amd64"
fi
PLATFORM="$(uname | tr '[:upper:]' '[:lower:]')"
if [[ -f "${CONFIG_DIR}/coder.env" ]]; then
echo "Found existing coder.env in ${CONFIG_DIR}!"
@ -29,8 +28,20 @@ if [[ -f "${CONFIG_DIR}/coder.env" ]]; then
fi
maybedryrun "$DRY_RUN" mkdir -p "${CONFIG_DIR}"
echo "Fetching Coder CLI for first-time setup!"
maybedryrun "$DRY_RUN" curl -fsSLk "${CODER_URL}/bin/coder-${PLATFORM}-${ARCH}" -o "${CONFIG_DIR}/coder"
echo "Fetching Coder for first-time setup!"
pod=$(kubectl get pods \
--namespace="${NAMESPACE}" \
--selector="app.kubernetes.io/name=coder,app.kubernetes.io/part-of=coder" \
--output="jsonpath='{.items[0].metadata.name}'")
if [[ -z ${pod} ]]; then
log "Could not find coder pod!"
exit 1
fi
maybedryrun "$DRY_RUN" kubectl \
--namespace="${NAMESPACE}" \
cp \
--container=coder \
"${pod}:/opt/coder" "${CONFIG_DIR}/coder"
maybedryrun "$DRY_RUN" chmod +x "${CONFIG_DIR}/coder"
set +o pipefail