11# Copyright (c) 2022 Red Hat, Inc.
22# Copyright Contributors to the Open Cluster Management project
33
4+ # # CLI versions (with links to the latest releases)
5+ # https://github.com/kubernetes-sigs/controller-tools/releases/latest
6+ CONTROLLER_GEN_VERSION := v0.6.1
7+ # https://github.com/kubernetes-sigs/kustomize/releases/latest
8+ KUSTOMIZE_VERSION := v5.3.0
9+ # https://github.com/golangci/golangci-lint/releases/latest
10+ GOLANGCI_VERSION := v1.52.2
11+ # https://github.com/mvdan/gofumpt/releases/latest
12+ GOFUMPT_VERSION := v0.6.0
13+ # https://github.com/daixiang0/gci/releases/latest
14+ GCI_VERSION := v0.12.1
15+ # https://github.com/securego/gosec/releases/latest
16+ GOSEC_VERSION := v2.18.2
17+ # https://github.com/kubernetes-sigs/kubebuilder/releases/latest
18+ KBVERSION := 3.12.0
19+ # https://github.com/kubernetes/kubernetes/releases/latest
20+ ENVTEST_K8S_VERSION := 1.26.x
21+
422LOCAL_BIN ?= $(error LOCAL_BIN is not set.)
523ifneq ($(findstring $(LOCAL_BIN ) , $(PATH ) ) , $(LOCAL_BIN ) )
624 $(error LOCAL_BIN is not in PATH.)
@@ -35,11 +53,11 @@ KUSTOMIZE = $(LOCAL_BIN)/kustomize
3553
3654.PHONY : controller-gen
3755controller-gen : # # Download controller-gen locally if necessary.
38- $(call go-get-tool,sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.1 )
56+ $(call go-get-tool,sigs.k8s.io/controller-tools/cmd/controller-gen@$( CONTROLLER_GEN_VERSION ) )
3957
4058.PHONY : kustomize
4159kustomize : # # Download kustomize locally if necessary.
42- $(call go-get-tool,sigs.k8s.io/kustomize/kustomize/v5@v5.0.1 )
60+ $(call go-get-tool,sigs.k8s.io/kustomize/kustomize/v5@$( KUSTOMIZE_VERSION ) )
4361
4462# ###########################################################
4563# Lint
@@ -53,7 +71,7 @@ lint: lint-dependencies lint-yaml lint-go
5371
5472.PHONY : lint-dependencies
5573lint-dependencies :
56- $(call go-get-tool,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2 )
74+ $(call go-get-tool,github.com/golangci/golangci-lint/cmd/golangci-lint@$( GOLANGCI_VERSION ) )
5775
5876.PHONY : lint-yaml
5977lint-yaml :
@@ -67,8 +85,8 @@ lint-go:
6785
6886.PHONY : fmt-dependencies
6987fmt-dependencies :
70- $(call go-get-tool,github.com/daixiang0/gci@v0.10.1 )
71- $(call go-get-tool,mvdan.cc/gofumpt@v0.5.0 )
88+ $(call go-get-tool,github.com/daixiang0/gci@$( GCI_VERSION ) )
89+ $(call go-get-tool,mvdan.cc/gofumpt@$( GOFUMPT_VERSION ) )
7290
7391.PHONY : fmt
7492fmt : fmt-dependencies
@@ -82,8 +100,6 @@ fmt: fmt-dependencies
82100GOSEC = $(LOCAL_BIN ) /gosec
83101KUBEBUILDER = $(LOCAL_BIN ) /kubebuilder
84102ENVTEST = $(LOCAL_BIN ) /setup-envtest
85- KBVERSION = 3.12.0
86- ENVTEST_K8S_VERSION = 1.26.x
87103
88104.PHONY : kubebuilder
89105kubebuilder :
@@ -99,7 +115,7 @@ envtest:
99115
100116.PHONY : gosec
101117gosec :
102- $(call go-get-tool,github.com/securego/gosec/v2/cmd/gosec@v2.15.0 )
118+ $(call go-get-tool,github.com/securego/gosec/v2/cmd/gosec@$( GOSEC_VERSION ) )
103119
104120.PHONY : gosec-scan
105121gosec-scan : gosec
0 commit comments