@@ -29,8 +29,8 @@ E2E_PROVIDER_IMAGE_NAME ?= e2e-provider
29
29
30
30
# Release version is the current supported release for the driver
31
31
# Update this version when the helm chart is being updated for release
32
- RELEASE_VERSION := v1.4.5
33
- IMAGE_VERSION ?= v1.4.5
32
+ RELEASE_VERSION := v1.4.7
33
+ IMAGE_VERSION ?= v1.4.7
34
34
35
35
# Use a custom version for E2E tests if we are testing in CI
36
36
ifdef CI
@@ -103,7 +103,7 @@ KIND_VERSION ?= 0.23.0
103
103
KUBERNETES_VERSION ?= 1.30.2
104
104
KUBECTL_VERSION ?= 1.30.2
105
105
BATS_VERSION ?= 1.4.1
106
- TRIVY_VERSION ?= 0.39 .1
106
+ TRIVY_VERSION ?= 0.57 .1
107
107
PROTOC_VERSION ?= 3.20.1
108
108
SHELLCHECK_VER ?= v0.8.0
109
109
YQ_VERSION ?= v4.11.2
@@ -116,17 +116,22 @@ AWS_REGION := us-west-2
116
116
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
117
117
CRD_OPTIONS ?= "crd:crdVersions=v1"
118
118
119
- # # --------------------------------------
119
+
120
120
# # Validate golang version
121
- # # --------------------------------------
121
+
122
122
GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
123
123
GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
124
124
MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
125
125
MINIMUM_SUPPORTED_GO_MINOR_VERSION = 16
126
126
GO_VERSION_VALIDATION_ERR_MSG = Golang version is not supported, please update to at least $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION ) .$(MINIMUM_SUPPORTED_GO_MINOR_VERSION )
127
127
128
+
129
+ .PHONY : help
130
+ help : # # Display this help
131
+ @awk ' BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST )
132
+
128
133
.PHONY : validate-go
129
- validate-go : # # Validates the installed version of go.
134
+ validate-go : # # Validates the installed version of go
130
135
@if [ $( GO_MAJOR_VERSION) -gt $( MINIMUM_SUPPORTED_GO_MAJOR_VERSION) ]; then \
131
136
exit 0 ; \
132
137
elif [ $( GO_MAJOR_VERSION) -lt $( MINIMUM_SUPPORTED_GO_MAJOR_VERSION) ]; then \
@@ -137,35 +142,31 @@ validate-go: ## Validates the installed version of go.
137
142
exit 1; \
138
143
fi
139
144
140
- # # --------------------------------------
141
- # # Testing
142
- # # --------------------------------------
145
+ # #@ Testing
143
146
144
147
.PHONY : test
145
- test : go-test
148
+ test : go-test # # Run unit tests
146
149
147
- .PHONY : go-test # Run unit tests
150
+ .PHONY : go-test
148
151
go-test :
149
152
go test -count=1 $(GO_FILES ) -v -coverprofile cover.out
150
153
cd test/e2eprovider && go test ./... -tags e2e -count=1 -v
151
154
152
155
# skipping Controller tests as this driver only implements Node and Identity service.
153
156
.PHONY : sanity-test # Run CSI sanity tests for the driver
154
- sanity-test :
157
+ sanity-test : # # Run sanity tests
155
158
go test -v ./test/sanity -ginkgo.skip=Controller\| should.work\| NodeStageVolume
156
159
157
160
.PHONY : image-scan
158
- image-scan : $(TRIVY )
161
+ image-scan : $(TRIVY ) # # Run image-scan
159
162
# show all vulnerabilities
160
163
$(TRIVY ) image --severity MEDIUM,HIGH,CRITICAL $(IMAGE_TAG )
161
164
$(TRIVY ) image --severity MEDIUM,HIGH,CRITICAL $(CRD_IMAGE_TAG )
162
165
# show vulnerabilities that have been fixed
163
166
$(TRIVY ) image --exit-code 1 --ignore-unfixed --severity MEDIUM,HIGH,CRITICAL $(IMAGE_TAG )
164
167
$(TRIVY ) image --exit-code 1 --ignore-unfixed --severity MEDIUM,HIGH,CRITICAL $(CRD_IMAGE_TAG )
165
168
166
- # # --------------------------------------
167
169
# # Tooling Binaries
168
- # # --------------------------------------
169
170
170
171
$(CONTROLLER_GEN ) : $(TOOLS_MOD_DIR ) /go.mod $(TOOLS_MOD_DIR ) /go.sum $(TOOLS_MOD_DIR ) /tools.go # # Build controller-gen from tools folder.
171
172
cd $(TOOLS_MOD_DIR ) && \
@@ -177,7 +178,7 @@ $(GOLANGCI_LINT): ## Build golangci-lint from tools folder.
177
178
178
179
$(KUSTOMIZE ) : # # Build kustomize from tools folder.
179
180
cd $(TOOLS_MOD_DIR ) && \
180
- GOPROXY=$(GOPROXY ) go build -tags=tools -o $(TOOLS_BIN_DIR ) /kustomize sigs.k8s.io/kustomize/kustomize/v4
181
+ GOPROXY=$(GOPROXY ) go build -tags=tools -o $(TOOLS_BIN_DIR ) /kustomize sigs.k8s.io/kustomize/kustomize/v5
181
182
182
183
$(PROTOC_GEN_GO ) : # # Build protoc-gen-go from tools folder.
183
184
cd $(TOOLS_MOD_DIR ) && \
@@ -187,9 +188,7 @@ $(PROTOC_GEN_GO_GRPC): ## Build protoc-gen-go-grpc from tools folder.
187
188
cd $(TOOLS_MOD_DIR ) && \
188
189
GOPROXY=$(GOPROXY ) go build -tags=tools -o $(TOOLS_BIN_DIR ) /protoc-gen-go-grpc google.golang.org/grpc/cmd/protoc-gen-go-grpc
189
190
190
- # # --------------------------------------
191
191
# # Testing Binaries
192
- # # --------------------------------------
193
192
194
193
$(HELM ) : # # Install helm3 if not present
195
194
helm version --short | grep -q v3 || (curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash)
@@ -234,34 +233,32 @@ $(SHELLCHECK):
234
233
chmod +x " $( TOOLS_BIN_DIR) /shellcheck" " $( SHELLCHECK) "
235
234
rm -rf shellcheck*
236
235
237
- # # --------------------------------------
238
- # # Linting
239
- # # --------------------------------------
236
+ # #@ Linting
237
+
240
238
.PHONY : test-style
241
239
test-style : lint lint-charts shellcheck
242
240
243
241
.PHONY : lint
244
- lint : $(GOLANGCI_LINT )
242
+ lint : $(GOLANGCI_LINT ) # # Run lint
245
243
# Setting timeout to 5m as default is 1m
246
244
$(GOLANGCI_LINT ) run --timeout=5m -v
247
245
cd test/e2eprovider && $(GOLANGCI_LINT ) run --build-tags e2e --timeout=5m -v
248
246
249
247
lint-full : $(GOLANGCI_LINT )
250
248
$(GOLANGCI_LINT ) run -v --fast=false
251
249
252
- lint-charts : $(HELM ) # Run helm lint tests
250
+ lint-charts : $(HELM ) # # Run lint on helm charts
253
251
helm lint charts/secrets-store-csi-driver
254
252
helm lint manifest_staging/charts/secrets-store-csi-driver
255
253
256
254
.PHONY : shellcheck
257
255
shellcheck : $(SHELLCHECK )
258
256
find . -name ' *.sh' -not -path ' ./third_party/*' | xargs $(SHELLCHECK )
259
257
260
- # # --------------------------------------
261
- # # Builds
262
- # # --------------------------------------
258
+ # #@ Builds
259
+
263
260
.PHONY : build
264
- build :
261
+ build : # # Build Secret Store CSI Driver binary
265
262
GOPROXY=$(GOPROXY ) CGO_ENABLED=0 GOOS=linux go build -a -ldflags $(LDFLAGS ) -o _output/secrets-store-csi ./cmd/secrets-store-csi-driver
266
263
267
264
.PHONY : build-e2e-provider
@@ -281,7 +278,7 @@ clean-crds:
281
278
rm -rf _output/crds/*
282
279
283
280
.PHONY : build-crds
284
- build-crds : clean-crds
281
+ build-crds : clean-crds # # Build crds
285
282
mkdir -p _output/crds
286
283
ifdef CI
287
284
cp -R manifest_staging/charts/secrets-store-csi-driver/crds/ _output/crds/
@@ -294,7 +291,7 @@ e2e-provider-container:
294
291
docker buildx build --no-cache -t $(E2E_PROVIDER_IMAGE_TAG ) -f test/e2eprovider/Dockerfile --progress=plain .
295
292
296
293
.PHONY : container
297
- container : crd-container
294
+ container : crd-container # # Build container image
298
295
docker buildx build --no-cache --build-arg IMAGE_VERSION=$(IMAGE_VERSION ) -t $(IMAGE_TAG ) -f docker/Dockerfile --progress=plain .
299
296
300
297
.PHONY : crd-container
@@ -356,9 +353,8 @@ push-manifest:
356
353
docker manifest push --purge $(CRD_IMAGE_TAG )
357
354
docker manifest inspect $(CRD_IMAGE_TAG )
358
355
359
- # # --------------------------------------
360
- # # E2E Testing
361
- # # --------------------------------------
356
+ # #@ E2E Testing
357
+
362
358
.PHONY : e2e-install-prerequisites
363
359
e2e-install-prerequisites : $(HELM ) $(BATS ) $(KIND ) $(KUBECTL ) $(ENVSUBST ) $(YQ )
364
360
@@ -388,7 +384,7 @@ e2e-mock-provider-container:
388
384
kind load docker-image --name kind $(E2E_PROVIDER_IMAGE_TAG )
389
385
390
386
.PHONY : e2e-test
391
- e2e-test : e2e-bootstrap e2e-helm-deploy # run test for windows
387
+ e2e-test : e2e-bootstrap e2e-helm-deploy # # Run e2e tests for windows
392
388
$(MAKE ) e2e-azure
393
389
394
390
.PHONY : e2e-teardown
@@ -496,12 +492,10 @@ e2e-aws:
496
492
e2e-conjur :
497
493
bats -t test/bats/conjur.bats
498
494
499
- # # --------------------------------------
500
- # # Generate
501
- # # --------------------------------------
502
- # Generate manifests e.g. CRD, RBAC etc.
495
+ # #@ Generate
496
+
503
497
.PHONY : manifests
504
- manifests : $(CONTROLLER_GEN ) $(KUSTOMIZE )
498
+ manifests : $(CONTROLLER_GEN ) $(KUSTOMIZE ) # # Generate manifests e.g. CRD, RBAC etc.
505
499
# Generate the base CRD/RBAC
506
500
$(CONTROLLER_GEN ) $(CRD_OPTIONS ) rbac:roleName=secretproviderclasses-role object:headerFile=./hack/boilerplate.go.txt paths=" ./apis/..." \
507
501
paths=" ./apis/..." paths=" ./controllers" output:crd:artifacts:config=config/crd/bases
@@ -553,9 +547,8 @@ generate-protobuf: $(PROTOC) $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_GRPC) # generates
553
547
# Update boilerplate for the generated file.
554
548
cat hack/boilerplate.go.txt provider/v1alpha1/service_grpc.pb.go > tmpfile && mv tmpfile provider/v1alpha1/service_grpc.pb.go
555
549
556
- # # --------------------------------------
557
550
# # Release
558
- # # --------------------------------------
551
+
559
552
.PHONY : release-manifest
560
553
release-manifest :
561
554
$(MAKE ) manifests
@@ -573,9 +566,8 @@ promote-staging-manifest: #promote staging manifests to release dir
573
566
@rm -rf charts/secrets-store-csi-driver
574
567
@cp -r manifest_staging/charts/secrets-store-csi-driver ./charts
575
568
576
- # # --------------------------------------
577
- # # Local
578
- # # --------------------------------------
569
+ # #@ Local
570
+
579
571
.PHONY : redeploy-driver
580
- redeploy-driver : e2e-container
572
+ redeploy-driver : e2e-container # # Redeploy driver and e2e-container
581
573
kubectl delete pod $(shell kubectl get pod -n kube-system -l app=secrets-store-csi-driver -o jsonpath="{.items[0].metadata.name}") -n kube-system --force --grace-period 0
0 commit comments