@@ -4,13 +4,15 @@ SHELL = /bin/bash
4
4
# This value must be updated to the release tag of the most recent release, a change that must
5
5
# occur in the release commit. IMAGE_VERSION will be removed once each subproject that uses this
6
6
# version is moved to a separate repo and release process.
7
- export IMAGE_VERSION = v1.30 .0
7
+ export IMAGE_VERSION = v1.31 .0
8
8
# Build-time variables to inject into binaries
9
9
export SIMPLE_VERSION = $(shell (test "$(shell git describe --tags) " = "$(shell git describe --tags --abbrev=0) " && echo $(shell git describe --tags) ) || echo $(shell git describe --tags --abbrev=0) +git)
10
10
export GIT_VERSION = $(shell git describe --dirty --tags --always)
11
11
export GIT_COMMIT = $(shell git rev-parse HEAD)
12
12
export K8S_VERSION = 1.26.0
13
13
14
+ export OPERATOR_SDK_VERSION = $(IMAGE_VERSION )
15
+
14
16
# Build settings
15
17
export TOOLS_DIR = tools/bin
16
18
export SCRIPTS_DIR = tools/scripts
@@ -35,17 +37,17 @@ export PATH := $(PWD)/$(BUILD_DIR):$(PWD)/$(TOOLS_DIR):$(PATH)
35
37
# #@ Development
36
38
37
39
.PHONY : generate
38
- generate : build # Generate CLI docs and samples
40
+ generate : operator-sdk build # Generate CLI docs and samples
39
41
rm -rf testdata
40
- go run ./hack/generate/samples/generate_testdata.go
42
+ go run ./hack/generate/samples/generate_testdata.go --bin $( OPERATOR_SDK )
41
43
go generate ./...
42
44
43
45
.PHONY : fix
44
46
fix : # # Fixup files in the repo.
45
47
go mod tidy
46
48
go fmt ./...
47
49
make setup-lint
48
- $(TOOLS_DIR ) /golangci-lint run --fix
50
+ $(TOOLS_DIR ) /golangci-lint run --fix --timeout=2m
49
51
50
52
.PHONY : setup-lint
51
53
setup-lint : # # Setup the lint
@@ -140,7 +142,7 @@ e2e_targets := test-e2e $(e2e_tests)
140
142
export KIND_CLUSTER := osdk-test
141
143
142
144
KUBEBUILDER_ASSETS = $(PWD ) /$(shell go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest && $(shell go env GOPATH) /bin/setup-envtest use $(K8S_VERSION ) --bin-dir tools/bin/ -p path)
143
- test-e2e-setup :: build dev-install cluster-create
145
+ test-e2e-setup :: operator-sdk build dev-install cluster-create
144
146
145
147
.PHONY : cluster-create
146
148
cluster-create ::
@@ -162,13 +164,29 @@ test-e2e-teardown:
162
164
$(e2e_targets ) :: test-e2e-setup
163
165
test-e2e :: $(e2e_tests ) # # Run e2e tests
164
166
165
- test-e2e-ansible :: image/ansible-operator # # Run Ansible e2e tests
167
+ test-e2e-ansible :: operator-sdk image/ansible-operator # # Run Ansible e2e tests
166
168
go test -count=1 ./internal/ansible/proxy/...
167
169
go test ./test/e2e/ansible -v -ginkgo.v
168
170
test-e2e-ansible-molecule :: install dev-install image/ansible-operator # # Run molecule-based Ansible e2e tests
169
171
go run ./hack/generate/samples/molecule/generate.go
170
172
./hack/tests/e2e-ansible-molecule.sh
171
173
174
+ # # Location to install dependencies to
175
+ LOCALBIN ?= $(shell pwd) /bin
176
+ $(LOCALBIN ) :
177
+ mkdir -p $(LOCALBIN )
178
+
179
+ .PHONY : operator-sdk
180
+ OPERATOR_SDK ?= $(LOCALBIN ) /operator-sdk
181
+ operator-sdk : # # Download operator-sdk locally if necessary.
182
+ @{ \
183
+ set -e ; \
184
+ mkdir -p $(dir $(OPERATOR_SDK ) ) ; \
185
+ OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
186
+ curl -sSLo $(OPERATOR_SDK ) https://github.com/operator-framework/operator-sdk/releases/download/$(OPERATOR_SDK_VERSION ) /operator-sdk_$$ {OS}_$$ {ARCH} ; \
187
+ chmod +x $(OPERATOR_SDK ) ; \
188
+ }
189
+
172
190
.DEFAULT_GOAL := help
173
191
.PHONY : help
174
192
help : # # Show this help screen.
0 commit comments