Skip to content

Commit

Permalink
update go install script (#339)
Browse files Browse the repository at this point in the history
* update go install script

Signed-off-by: cpanato <ctadeu@gmail.com>

* update kustomize/kubectl

Signed-off-by: cpanato <ctadeu@gmail.com>

* update go to 1.17.9

Signed-off-by: cpanato <ctadeu@gmail.com>
  • Loading branch information
cpanato committed Apr 28, 2022
1 parent d5c9a82 commit 7135c74
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Build the manager binary
FROM golang:1.17.8 as builder
FROM golang:1.17.9 as builder
WORKDIR /workspace

# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -130,7 +130,7 @@ GOLANGCI_LINT_VER := v1.45.2
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)

KUSTOMIZE_VER := v3.8.6
KUSTOMIZE_VER := v4.5.2
KUSTOMIZE_BIN := kustomize
KUSTOMIZE := $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER)

Expand All @@ -146,7 +146,7 @@ GINKGO_VER := v1.16.5
GINKGO_BIN := ginkgo
GINKGO := $(TOOLS_BIN_DIR)/$(GINKGO_BIN)-$(GINKGO_VER)

KUBECTL_VER := v1.22.3
KUBECTL_VER := v1.22.9
KUBECTL_BIN := $(TOOLS_BIN_DIR)/kubectl
KUBECTL := $(KUBECTL_BIN)-$(KUBECTL_VER)

Expand Down Expand Up @@ -212,7 +212,7 @@ $(GOLANGCI_LINT): ## Build golangci-lint from tools folder.
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) github.com/golangci/golangci-lint/cmd/golangci-lint $(GOLANGCI_LINT_BIN) $(GOLANGCI_LINT_VER)

$(KUSTOMIZE): ## Build kustomize from tools folder.
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) sigs.k8s.io/kustomize/kustomize/v3 $(KUSTOMIZE_BIN) $(KUSTOMIZE_VER)
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) sigs.k8s.io/kustomize/kustomize/v4 $(KUSTOMIZE_BIN) $(KUSTOMIZE_VER)

$(MOCKGEN): ## Build mockgen from tools folder.
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) github.com/golang/mock/mockgen $(MOCKGEN_BIN) $(MOCKGEN_VER)
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci-conformance.sh
Expand Up @@ -71,7 +71,7 @@ if [[ "${E2E_ARGS:-}" == "-kubetest.use-ci-artifacts" ]]; then
export CI_VERSION
export KUBERNETES_VERSION
export KUBERNETES_MAJOR_VERSION
export KUBERNETES_MAJOR_VERSION
export KUBERNETES_MINOR_VERSION
fi
echo "Will use K8s version $KUBERNETES_VERSION"

Expand Down
13 changes: 1 addition & 12 deletions scripts/go_install.sh
Expand Up @@ -37,20 +37,9 @@ if [ -z "${GOBIN}" ]; then
exit 1
fi

tmp_dir=$(mktemp -d -t goinstall_XXXXXXXXXX)
function clean {
rm -rf "${tmp_dir}"
}
trap clean EXIT

rm "${GOBIN}/${2}"* || true

cd "${tmp_dir}"

# create a new module in the tmp directory
go mod init fake/mod

# install the golang module specified as the first argument
go get -tags tools "${1}@${3}"
go install -tags tools "${1}@${3}"
mv "${GOBIN}/${2}" "${GOBIN}/${2}-${3}"
ln -sf "${GOBIN}/${2}-${3}" "${GOBIN}/${2}"

0 comments on commit 7135c74

Please sign in to comment.