-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into K8SPSMDB-1183_bundle_generation
- Loading branch information
Showing
277 changed files
with
9,792 additions
and
2,737 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module linters | ||
|
||
go 1.13 | ||
go 1.23.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ jobs: | |
- uses: actions/[email protected] | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '^1.22' | ||
go-version: '^1.23' | ||
- run: go install -v github.com/incu6us/goimports-reviser/v3@latest | ||
- run: $(go env GOPATH)/bin/goimports-reviser -imports-order "std,general,company,project" -company-prefixes "github.com/percona" ./... | ||
- uses: reviewdog/action-suggester@v1 | ||
|
@@ -44,7 +44,7 @@ jobs: | |
- uses: actions/[email protected] | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '^1.22' | ||
go-version: '^1.23' | ||
- run: go install mvdan.cc/sh/v3/cmd/shfmt@latest | ||
- run: $(go env GOPATH)/bin/shfmt -f . | grep -v 'vendor' | xargs $(go env GOPATH)/bin/shfmt -bn -ci -s -w | ||
- name: suggester / shfmt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,15 +29,14 @@ jobs: | |
export DOCKER_SQUASH=0 | ||
export DOCKER_DEFAULT_PLATFORM='linux/arm64' | ||
./e2e-tests/build | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
- name: Run Snyk vulnerability scanner image (linux/arm64) | ||
uses: snyk/actions/docker@master | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
with: | ||
image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64' | ||
format: 'table' | ||
exit-code: '1' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
image: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64' | ||
args: --platform=linux/arm64 --severity-threshold=high --exclude-base-image-vulns --file=./build/Dockerfile -fail-on=upgradable | ||
|
||
- name: Build an image from Dockerfile (linux/amd64) | ||
run: | | ||
|
@@ -47,12 +46,11 @@ jobs: | |
export DOCKER_DEFAULT_PLATFORM='linux/amd64' | ||
./e2e-tests/build | ||
- name: Run Trivy vulnerability scanner image (linux/amd64) | ||
uses: aquasecurity/[email protected] | ||
- name: Run Snyk vulnerability scanner image (linux/amd64) | ||
uses: snyk/actions/docker@master | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
with: | ||
image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64' | ||
format: 'table' | ||
exit-code: '1' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
image: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64' | ||
args: --platform=linux/amd64 --severity-threshold=high --exclude-base-image-vulns --file=./build/Dockerfile -fail-on=upgradable | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ jobs: | |
steps: | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '^1.22' | ||
go-version: '^1.23' | ||
- uses: actions/[email protected] | ||
- name: go test | ||
run: go test -v ./... | ||
- name: run tests | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -347,7 +347,7 @@ EOF | |
-v $WORKSPACE/src/github.com/percona/percona-server-mongodb-operator:/go/src/github.com/percona/percona-server-mongodb-operator \ | ||
-w /go/src/github.com/percona/percona-server-mongodb-operator \ | ||
-e GOFLAGS='-buildvcs=false' \ | ||
golang:1.22 sh -c ' | ||
golang:1.23 sh -c ' | ||
go install github.com/google/[email protected]; | ||
/go/bin/go-licenses csv github.com/percona/percona-server-mongodb-operator/cmd/manager \ | ||
| cut -d , -f 3 \ | ||
|
@@ -375,7 +375,7 @@ EOF | |
-v $WORKSPACE/src/github.com/percona/percona-server-mongodb-operator:/go/src/github.com/percona/percona-server-mongodb-operator \ | ||
-w /go/src/github.com/percona/percona-server-mongodb-operator \ | ||
-e GOFLAGS='-buildvcs=false' \ | ||
golang:1.22 sh -c 'go build -v -o percona-server-mongodb-operator github.com/percona/percona-server-mongodb-operator/cmd/manager' | ||
golang:1.23 sh -c 'go build -v -o percona-server-mongodb-operator github.com/percona/percona-server-mongodb-operator/cmd/manager' | ||
" | ||
''' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ VERSION ?= $(shell git rev-parse --abbrev-ref HEAD | $(SED) -e 's^/^-^g; s^[.]^- | |
IMAGE ?= $(IMAGE_TAG_BASE):$(VERSION) | ||
DEPLOYDIR = ./deploy | ||
|
||
ENVTEST_K8S_VERSION = 1.31 | ||
|
||
all: build | ||
|
||
help: ## Display this help. | ||
|
@@ -35,6 +37,9 @@ $(DEPLOYDIR)/cw-bundle.yaml: $(DEPLOYDIR)/crd.yaml $(DEPLOYDIR)/cw-rbac.yaml $(D | |
|
||
manifests: $(DEPLOYDIR)/crd.yaml $(DEPLOYDIR)/bundle.yaml $(DEPLOYDIR)/cw-bundle.yaml ## Put generated manifests to deploy directory | ||
|
||
e2e-test: | ||
IMAGE=$(IMAGE) ./e2e-tests/$(TEST)/run | ||
|
||
##@ Build | ||
|
||
.PHONY: build | ||
|
@@ -60,6 +65,9 @@ deploy: ## Deploy operator | |
undeploy: ## Undeploy operator | ||
kubectl delete -f $(DEPLOYDIR)/operator.yaml | ||
|
||
test: envtest ## Run tests. | ||
DISABLE_TELEMETRY=true KUBEBUILDER_ASSETS="$(shell $(ENVTEST) --arch=amd64 use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out | ||
|
||
# go-get-tool will 'go get' any package $2 and install it to $1. | ||
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
define go-get-tool | ||
|
@@ -82,6 +90,14 @@ KUSTOMIZE = $(shell pwd)/bin/kustomize | |
kustomize: ## Download kustomize locally if necessary. | ||
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected]) | ||
|
||
ENVTEST = $(shell pwd)/bin/setup-envtest | ||
envtest: ## Download envtest-setup locally if necessary. | ||
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest) | ||
|
||
SWAGGER = $(shell pwd)/bin/swagger | ||
swagger: ## Download swagger locally if necessary. | ||
$(call go-get-tool,$(SWAGGER),github.com/go-swagger/go-swagger/cmd/swagger@latest) | ||
|
||
# Prepare release | ||
CERT_MANAGER_VER := $(shell grep -Eo "cert-manager v.*" go.mod|grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") | ||
release: manifests | ||
|
@@ -112,3 +128,13 @@ after-release: manifests | |
-e "/^ backup:/,/^ image:/{s#image: .*#image: perconalab/percona-server-mongodb-operator:main-backup#}" \ | ||
-e "s#initImage: .*#initImage: perconalab/percona-server-mongodb-operator:main#g" \ | ||
-e "/^ pmm:/,/^ image:/{s#image: .*#image: perconalab/pmm-client:dev-latest#}" deploy/cr.yaml | ||
|
||
version-service-client: swagger | ||
curl https://raw.githubusercontent.com/Percona-Lab/percona-version-service/$(VS_BRANCH)/api/version.swagger.yaml \ | ||
--output ./version.swagger.yaml | ||
rm -rf ./versionserviceclient | ||
swagger generate client \ | ||
-f ./version.swagger.yaml \ | ||
-c ./versionserviceclient/ \ | ||
-m ./versionserviceclient/models | ||
rm ./version.swagger.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.