File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
- set -e
17
+ set -o errexit
18
+ set -o nounset
19
+ set -o pipefail
18
20
19
21
hack_dir=$( dirname ${BASH_SOURCE} )
20
22
source ${hack_dir} /common.sh
@@ -35,12 +37,10 @@ SKIP_FETCH_TOOLS=${SKIP_FETCH_TOOLS:-""}
35
37
ENVTEST_K8S_VERSION=${ENVTEST_K8S_VERSION:- " 1.16.4" }
36
38
37
39
if [ -z " $SKIP_FETCH_TOOLS " ]; then
38
- header_text " fetching envtest tools@${ENVTEST_K8S_VERSION} "
39
40
fetch_envtest_tools " $kb_root_dir "
40
41
fetch_envtest_tools " ${hack_dir} /../pkg/internal/testing/integration/assets"
41
42
fi
42
43
43
- header_text " setting up envtest@${ENVTEST_K8S_VERSION} "
44
44
setup_envtest_env " $kb_root_dir "
45
45
46
46
${hack_dir} /verify.sh
Original file line number Diff line number Diff line change 15
15
# limitations under the License.
16
16
17
17
set -o errexit
18
- set -o nounset
19
18
set -o pipefail
20
19
20
+ # Turn colors in this script off by setting the NO_COLOR variable in your
21
+ # environment to any value:
22
+ #
23
+ # $ NO_COLOR=1 test.sh
24
+ NO_COLOR=${NO_COLOR:- " " }
25
+ if [ -z " $NO_COLOR " ]; then
26
+ header=$' \e [1;33m'
27
+ reset=$' \e [0m'
28
+ else
29
+ header=' '
30
+ reset=' '
31
+ fi
32
+
33
+ function header_text {
34
+ echo " $header $* $reset "
35
+ }
36
+
21
37
function setup_envtest_env {
38
+ header_text " setting up env vars"
39
+
22
40
# Setup env vars
23
41
KUBEBUILDER_ASSETS=${KUBEBUILDER_ASSETS:- " " }
24
42
if [[ -z " ${KUBEBUILDER_ASSETS} " ]]; then
@@ -59,10 +77,12 @@ function fetch_envtest_tools {
59
77
if [[ -x " ${dest_dir} /bin/kube-apiserver" ]]; then
60
78
version=$( " ${dest_dir} " /bin/kube-apiserver --version)
61
79
if [[ $version == * " ${k8s_version} " * ]]; then
80
+ header_text " Using cached envtest tools from ${dest_dir} "
62
81
return 0
63
82
fi
64
83
fi
65
84
85
+ header_text " fetching envtest tools@${k8s_version} (into '${dest_dir} ')"
66
86
envtest_tools_archive_name=" kubebuilder-tools-$k8s_version -$goos -$goarch .tar.gz"
67
87
envtest_tools_download_url=" https://storage.googleapis.com/kubebuilder-tools/$envtest_tools_archive_name "
68
88
You can’t perform that action at this time.
0 commit comments