Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Switch hack to use the new envtest tool
We can now drop the `setup-envtest.sh` script, and instead just use
`source <(setup-envtest fetch -k ${version} -p env)` (plus a couple
lines to install setup-envtest ;-)).
  • Loading branch information
DirectXMan12 committed Apr 28, 2021
commit 782807d8d4fb287e86f6c91862529574ac42cc0a
19 changes: 15 additions & 4 deletions hack/check-everything.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,27 @@ set -o pipefail

hack_dir=$(dirname ${BASH_SOURCE})
source ${hack_dir}/common.sh
source ${hack_dir}/setup-envtest.sh

tmp_root=/tmp
kb_root_dir=$tmp_root/kubebuilder

ENVTEST_K8S_VERSION=${ENVTEST_K8S_VERSION:-"1.19.2"}

fetch_envtest_tools "$kb_root_dir"
fetch_envtest_tools "${hack_dir}/../pkg/internal/testing/integration/assets"
setup_envtest_env "$kb_root_dir"
# set up envtest tools if necessary

header_text "installing envtest tools@${ENVTEST_K8S_VERSION} with setup-envtest if necessary"
tmp_bin=/tmp/cr-tests-bin
(
# don't presume to install for the user
cd ${hack_dir}/../tools/setup-envtest
GOBIN=${tmp_bin} go install .
)
source <(${tmp_bin}/setup-envtest use --use-env -p env ${ENVTEST_K8S_VERSION})

# link the assets into integration
for tool in kube-apiserver etcd kubectl; do
ln -f -s "${KUBEBUILDER_ASSETS:?unable find envtest assets}/${tool}" "${hack_dir}/../pkg/internal/testing/integration/assets/bin/${tool}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this respect the default /usr/local/kubebuilder/bin?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolving this, as /usr/local is often not writeable by non-superusers.

done

${hack_dir}/verify.sh
${hack_dir}/test-all.sh
Expand Down
96 changes: 0 additions & 96 deletions hack/setup-envtest.sh

This file was deleted.