Skip to content

Commit dbe1f5c

Browse files
Merge branch 'main' into rotation
2 parents b20c366 + 194c31d commit dbe1f5c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+497
-424
lines changed

.github/workflows/chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
runs-on: ubuntu-20.04
2020
steps:
2121
- name: Harden Runner
22-
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
22+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
2323
with:
2424
egress-policy: audit
25-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.0.0
25+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.0.0
2626
with:
2727
submodules: true
2828
fetch-depth: 0

.github/workflows/codecov.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Harden Runner
17-
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
17+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
1818
with:
1919
egress-policy: audit
2020

21-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.0.0
22-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
21+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.0.0
22+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
2323
with:
2424
go-version: "^1.20"
2525
- name: Run tests
2626
run: make go-test
27-
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
27+
- uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e
2828
with:
2929
files: ./cover.out

.github/workflows/codeql.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ jobs:
2121

2222
steps:
2323
- name: Harden Runner
24-
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
24+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
2525
with:
2626
egress-policy: audit
2727

2828
- name: Checkout repository
29-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.0.0
29+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.0.0
3030

3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
32+
uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
3333
with:
3434
languages: go
3535

3636
- name: Autobuild
37-
uses: github/codeql-action/autobuild@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
37+
uses: github/codeql-action/autobuild@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
3838

3939
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/analyze@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
40+
uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13

.github/workflows/create-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
runs-on: ubuntu-20.04
1313
steps:
1414
- name: Harden Runner
15-
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
15+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
1616
with:
1717
egress-policy: audit
1818

1919
- name: Checkout
20-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.0.0
20+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.0.0
2121
with:
2222
fetch-depth: 0
2323
- name: Goreleaser

.github/workflows/dependency-review.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Harden Runner
20-
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
20+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
2121
with:
2222
egress-policy: audit
2323

2424
- name: 'Checkout Repository'
25-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.0.0
25+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.0.0
2626
- name: 'Dependency Review'
2727
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4

.github/workflows/e2e.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
KUBERNETES_VERSION: ["v1.28.9", "v1.29.4", "v1.30.2"]
3333
steps:
3434
- name: Harden Runner
35-
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
35+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
3636
with:
3737
egress-policy: audit
3838
- name: Checkout
39-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.0.0
39+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.0.0
4040
with:
4141
submodules: true
4242
fetch-depth: 0

.github/workflows/markdown-link-check.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Harden Runner
25-
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
25+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
2626
with:
2727
egress-policy: audit
28-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.0.0
28+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.0.0
2929
- uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec # v1.0.15
3030
with:
3131
# this will only show errors in the output

.github/workflows/scan-vulns.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
timeout-minutes: 15
2020
steps:
2121
- name: Harden Runner
22-
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
22+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
2323
with:
2424
egress-policy: audit
2525

26-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
26+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
2727
with:
2828
go-version: "1.21"
2929
check-latest: true
30-
- uses: golang/govulncheck-action@dd0578b371c987f96d1185abb54344b44352bd58 # v1.0.3
30+
- uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4

.github/workflows/scorecards.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131

3232
steps:
3333
- name: Harden Runner
34-
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
34+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
3535
with:
3636
egress-policy: audit
3737

3838
- name: "Checkout code"
39-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.0.0
39+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.0.0
4040
with:
4141
persist-credentials: false
4242

@@ -63,14 +63,14 @@ jobs:
6363
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6464
# format to the repository Actions tab.
6565
- name: "Upload artifact"
66-
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
66+
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
6767
with:
6868
name: SARIF file
6969
path: results.sarif
7070
retention-days: 5
7171

7272
# Upload the results to GitHub's code scanning dashboard.
7373
- name: "Upload to code-scanning"
74-
uses: github/codeql-action/upload-sarif@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
74+
uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
7575
with:
7676
sarif_file: results.sarif

Makefile

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ E2E_PROVIDER_IMAGE_NAME ?= e2e-provider
2929

3030
# Release version is the current supported release for the driver
3131
# 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
3434

3535
# Use a custom version for E2E tests if we are testing in CI
3636
ifdef CI
@@ -103,7 +103,7 @@ KIND_VERSION ?= 0.23.0
103103
KUBERNETES_VERSION ?= 1.30.2
104104
KUBECTL_VERSION ?= 1.30.2
105105
BATS_VERSION ?= 1.4.1
106-
TRIVY_VERSION ?= 0.39.1
106+
TRIVY_VERSION ?= 0.57.1
107107
PROTOC_VERSION ?= 3.20.1
108108
SHELLCHECK_VER ?= v0.8.0
109109
YQ_VERSION ?= v4.11.2
@@ -116,17 +116,22 @@ AWS_REGION := us-west-2
116116
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
117117
CRD_OPTIONS ?= "crd:crdVersions=v1"
118118

119-
## --------------------------------------
119+
120120
## Validate golang version
121-
## --------------------------------------
121+
122122
GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
123123
GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
124124
MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
125125
MINIMUM_SUPPORTED_GO_MINOR_VERSION = 16
126126
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)
127127

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+
128133
.PHONY: validate-go
129-
validate-go: ## Validates the installed version of go.
134+
validate-go: ## Validates the installed version of go
130135
@if [ $(GO_MAJOR_VERSION) -gt $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION) ]; then \
131136
exit 0 ;\
132137
elif [ $(GO_MAJOR_VERSION) -lt $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION) ]; then \
@@ -137,35 +142,31 @@ validate-go: ## Validates the installed version of go.
137142
exit 1; \
138143
fi
139144

140-
## --------------------------------------
141-
## Testing
142-
## --------------------------------------
145+
##@ Testing
143146

144147
.PHONY: test
145-
test: go-test
148+
test: go-test ## Run unit tests
146149

147-
.PHONY: go-test # Run unit tests
150+
.PHONY: go-test
148151
go-test:
149152
go test -count=1 $(GO_FILES) -v -coverprofile cover.out
150153
cd test/e2eprovider && go test ./... -tags e2e -count=1 -v
151154

152155
# skipping Controller tests as this driver only implements Node and Identity service.
153156
.PHONY: sanity-test # Run CSI sanity tests for the driver
154-
sanity-test:
157+
sanity-test: ## Run sanity tests
155158
go test -v ./test/sanity -ginkgo.skip=Controller\|should.work\|NodeStageVolume
156159

157160
.PHONY: image-scan
158-
image-scan: $(TRIVY)
161+
image-scan: $(TRIVY) ## Run image-scan
159162
# show all vulnerabilities
160163
$(TRIVY) image --severity MEDIUM,HIGH,CRITICAL $(IMAGE_TAG)
161164
$(TRIVY) image --severity MEDIUM,HIGH,CRITICAL $(CRD_IMAGE_TAG)
162165
# show vulnerabilities that have been fixed
163166
$(TRIVY) image --exit-code 1 --ignore-unfixed --severity MEDIUM,HIGH,CRITICAL $(IMAGE_TAG)
164167
$(TRIVY) image --exit-code 1 --ignore-unfixed --severity MEDIUM,HIGH,CRITICAL $(CRD_IMAGE_TAG)
165168

166-
## --------------------------------------
167169
## Tooling Binaries
168-
## --------------------------------------
169170

170171
$(CONTROLLER_GEN): $(TOOLS_MOD_DIR)/go.mod $(TOOLS_MOD_DIR)/go.sum $(TOOLS_MOD_DIR)/tools.go ## Build controller-gen from tools folder.
171172
cd $(TOOLS_MOD_DIR) && \
@@ -177,7 +178,7 @@ $(GOLANGCI_LINT): ## Build golangci-lint from tools folder.
177178

178179
$(KUSTOMIZE): ## Build kustomize from tools folder.
179180
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
181182

182183
$(PROTOC_GEN_GO): ## Build protoc-gen-go from tools folder.
183184
cd $(TOOLS_MOD_DIR) && \
@@ -187,9 +188,7 @@ $(PROTOC_GEN_GO_GRPC): ## Build protoc-gen-go-grpc from tools folder.
187188
cd $(TOOLS_MOD_DIR) && \
188189
GOPROXY=$(GOPROXY) go build -tags=tools -o $(TOOLS_BIN_DIR)/protoc-gen-go-grpc google.golang.org/grpc/cmd/protoc-gen-go-grpc
189190

190-
## --------------------------------------
191191
## Testing Binaries
192-
## --------------------------------------
193192

194193
$(HELM): ## Install helm3 if not present
195194
helm version --short | grep -q v3 || (curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash)
@@ -234,34 +233,32 @@ $(SHELLCHECK):
234233
chmod +x "$(TOOLS_BIN_DIR)/shellcheck" "$(SHELLCHECK)"
235234
rm -rf shellcheck*
236235

237-
## --------------------------------------
238-
## Linting
239-
## --------------------------------------
236+
##@ Linting
237+
240238
.PHONY: test-style
241239
test-style: lint lint-charts shellcheck
242240

243241
.PHONY: lint
244-
lint: $(GOLANGCI_LINT)
242+
lint: $(GOLANGCI_LINT) ## Run lint
245243
# Setting timeout to 5m as default is 1m
246244
$(GOLANGCI_LINT) run --timeout=5m -v
247245
cd test/e2eprovider && $(GOLANGCI_LINT) run --build-tags e2e --timeout=5m -v
248246

249247
lint-full: $(GOLANGCI_LINT)
250248
$(GOLANGCI_LINT) run -v --fast=false
251249

252-
lint-charts: $(HELM) # Run helm lint tests
250+
lint-charts: $(HELM) ## Run lint on helm charts
253251
helm lint charts/secrets-store-csi-driver
254252
helm lint manifest_staging/charts/secrets-store-csi-driver
255253

256254
.PHONY: shellcheck
257255
shellcheck: $(SHELLCHECK)
258256
find . -name '*.sh' -not -path './third_party/*' | xargs $(SHELLCHECK)
259257

260-
## --------------------------------------
261-
## Builds
262-
## --------------------------------------
258+
##@ Builds
259+
263260
.PHONY: build
264-
build:
261+
build: ## Build Secret Store CSI Driver binary
265262
GOPROXY=$(GOPROXY) CGO_ENABLED=0 GOOS=linux go build -a -ldflags $(LDFLAGS) -o _output/secrets-store-csi ./cmd/secrets-store-csi-driver
266263

267264
.PHONY: build-e2e-provider
@@ -281,7 +278,7 @@ clean-crds:
281278
rm -rf _output/crds/*
282279

283280
.PHONY: build-crds
284-
build-crds: clean-crds
281+
build-crds: clean-crds ## Build crds
285282
mkdir -p _output/crds
286283
ifdef CI
287284
cp -R manifest_staging/charts/secrets-store-csi-driver/crds/ _output/crds/
@@ -294,7 +291,7 @@ e2e-provider-container:
294291
docker buildx build --no-cache -t $(E2E_PROVIDER_IMAGE_TAG) -f test/e2eprovider/Dockerfile --progress=plain .
295292

296293
.PHONY: container
297-
container: crd-container
294+
container: crd-container ## Build container image
298295
docker buildx build --no-cache --build-arg IMAGE_VERSION=$(IMAGE_VERSION) -t $(IMAGE_TAG) -f docker/Dockerfile --progress=plain .
299296

300297
.PHONY: crd-container
@@ -356,9 +353,8 @@ push-manifest:
356353
docker manifest push --purge $(CRD_IMAGE_TAG)
357354
docker manifest inspect $(CRD_IMAGE_TAG)
358355

359-
## --------------------------------------
360-
## E2E Testing
361-
## --------------------------------------
356+
##@ E2E Testing
357+
362358
.PHONY: e2e-install-prerequisites
363359
e2e-install-prerequisites: $(HELM) $(BATS) $(KIND) $(KUBECTL) $(ENVSUBST) $(YQ)
364360

@@ -388,7 +384,7 @@ e2e-mock-provider-container:
388384
kind load docker-image --name kind $(E2E_PROVIDER_IMAGE_TAG)
389385

390386
.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
392388
$(MAKE) e2e-azure
393389

394390
.PHONY: e2e-teardown
@@ -496,12 +492,10 @@ e2e-aws:
496492
e2e-conjur:
497493
bats -t test/bats/conjur.bats
498494

499-
## --------------------------------------
500-
## Generate
501-
## --------------------------------------
502-
# Generate manifests e.g. CRD, RBAC etc.
495+
##@ Generate
496+
503497
.PHONY: manifests
504-
manifests: $(CONTROLLER_GEN) $(KUSTOMIZE)
498+
manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) ## Generate manifests e.g. CRD, RBAC etc.
505499
# Generate the base CRD/RBAC
506500
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=secretproviderclasses-role object:headerFile=./hack/boilerplate.go.txt paths="./apis/..." \
507501
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
553547
# Update boilerplate for the generated file.
554548
cat hack/boilerplate.go.txt provider/v1alpha1/service_grpc.pb.go > tmpfile && mv tmpfile provider/v1alpha1/service_grpc.pb.go
555549

556-
## --------------------------------------
557550
## Release
558-
## --------------------------------------
551+
559552
.PHONY: release-manifest
560553
release-manifest:
561554
$(MAKE) manifests
@@ -573,9 +566,8 @@ promote-staging-manifest: #promote staging manifests to release dir
573566
@rm -rf charts/secrets-store-csi-driver
574567
@cp -r manifest_staging/charts/secrets-store-csi-driver ./charts
575568

576-
## --------------------------------------
577-
## Local
578-
## --------------------------------------
569+
##@ Local
570+
579571
.PHONY: redeploy-driver
580-
redeploy-driver: e2e-container
572+
redeploy-driver: e2e-container ## Redeploy driver and e2e-container
581573
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

Comments
 (0)