-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3362 from Skarlso/use-setup-envtest
Using setup-envtest to install kubebuilder dependency
- Loading branch information
Showing
7 changed files
with
84 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2021 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
if [ -z "${1}" ]; then | ||
echo "must provide module as first parameter" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${2}" ]; then | ||
echo "must provide binary name as second parameter" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${3}" ]; then | ||
echo "must provide version as third parameter" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${GOBIN}" ]; then | ||
echo "GOBIN is not set. Must set GOBIN to install the bin in a specified directory." | ||
exit 1 | ||
fi | ||
|
||
rm "${GOBIN}/${2}"* || true | ||
|
||
# install the golang module specified as the first argument | ||
go install -tags tools "${1}@${3}" | ||
mv "${GOBIN}/${2}" "${GOBIN}/${2}-${3}" | ||
ln -sf "${GOBIN}/${2}-${3}" "${GOBIN}/${2}" |