Skip to content

Commit d120637

Browse files
authored
Merge branch 'main' into feat-env
2 parents 82b5284 + ae44a66 commit d120637

File tree

64 files changed

+4348
-462
lines changed

Some content is hidden

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

64 files changed

+4348
-462
lines changed

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout code
11-
uses: actions/checkout@v4
11+
uses: actions/checkout@v5
1212

1313
- name: "Label PR"
1414
uses: actions/labeler@v5

.github/workflows/reviewdog.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
name: runner / suggester / golangci-lint
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v4.1.1
8+
- uses: actions/checkout@v5
99
- name: golangci-lint
1010
uses: golangci/golangci-lint-action@v8
1111
with:
@@ -17,38 +17,38 @@ jobs:
1717
name: runner / suggester / gofmt
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v4.1.1
20+
- uses: actions/checkout@v5
2121
- run: gofmt -w -s $(find . -not -path "*/vendor/*" -name "*.go")
22-
- uses: reviewdog/action-suggester@v1
22+
- uses: reviewdog/action-suggester@v1.22.0
2323
with:
2424
tool_name: gofmt
2525

2626
goimports-reviser:
2727
name: runner / suggester / goimports-reviser
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/checkout@v4.1.1
30+
- uses: actions/checkout@v5
3131
- uses: actions/setup-go@v5
3232
with:
33-
go-version: '^1.23'
33+
go-version: '^1.25'
3434
- run: go install -v github.com/incu6us/goimports-reviser/v3@latest
3535
- run: $(go env GOPATH)/bin/goimports-reviser -imports-order "std,general,company,project" -company-prefixes "github.com/percona" ./...
36-
- uses: reviewdog/action-suggester@v1
36+
- uses: reviewdog/action-suggester@v1.22.0
3737
with:
3838
tool_name: goimports-reviser
3939

4040
shfmt:
4141
name: runner / suggester / shfmt
4242
runs-on: ubuntu-latest
4343
steps:
44-
- uses: actions/checkout@v4.1.1
44+
- uses: actions/checkout@v5
4545
- uses: actions/setup-go@v5
4646
with:
47-
go-version: '^1.23'
47+
go-version: '^1.25'
4848
- run: go install mvdan.cc/sh/v3/cmd/shfmt@latest
4949
- run: $(go env GOPATH)/bin/shfmt -f . | grep -v 'vendor' | xargs $(go env GOPATH)/bin/shfmt -bn -ci -s -w
5050
- name: suggester / shfmt
51-
uses: reviewdog/action-suggester@v1
51+
uses: reviewdog/action-suggester@v1.22.0
5252
with:
5353
tool_name: shfmt
5454

@@ -57,7 +57,7 @@ jobs:
5757
name: runner / shellcheck
5858
runs-on: ubuntu-latest
5959
steps:
60-
- uses: actions/checkout@v4.1.1
60+
- uses: actions/checkout@v5
6161
- uses: reviewdog/action-shellcheck@v1
6262
with:
6363
github_token: ${{ secrets.github_token }}
@@ -68,7 +68,7 @@ jobs:
6868
name: runner / misspell
6969
runs-on: ubuntu-latest
7070
steps:
71-
- uses: actions/checkout@v4.1.1
71+
- uses: actions/checkout@v5
7272
- uses: reviewdog/action-misspell@v1
7373
with:
7474
github_token: ${{ secrets.github_token }}
@@ -80,7 +80,7 @@ jobs:
8080
name: runner / alex
8181
runs-on: ubuntu-latest
8282
steps:
83-
- uses: actions/checkout@v4.1.1
83+
- uses: actions/checkout@v5
8484
- uses: reviewdog/action-alex@v1
8585
with:
8686
github_token: ${{ secrets.github_token }}
@@ -92,7 +92,7 @@ jobs:
9292
name: runner / manifests
9393
runs-on: ubuntu-latest
9494
steps:
95-
- uses: actions/checkout@v4
95+
- uses: actions/checkout@v5
9696
- name: check on release branch
9797
if: ${{ contains(github.head_ref, 'release-') || contains(github.base_ref, 'release-') }}
9898
run: |

.github/workflows/scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v4.1.1
17+
uses: actions/checkout@v5
1818

1919
- name: Set up QEMU
2020
uses: docker/setup-qemu-action@v3

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ jobs:
55
name: Test
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/setup-go@v5
8+
- uses: actions/checkout@v5
9+
- uses: actions/setup-go@v6
910
with:
10-
go-version: '^1.24'
11-
- uses: actions/[email protected]
11+
go-version-file: go.mod
1212
- name: run tests
1313
run: make test

Jenkinsfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ pipeline {
358358
ENABLE_LOGGING = "true"
359359
}
360360
agent {
361-
label 'docker'
361+
label 'docker-x64-min'
362362
}
363363
options {
364364
disableConcurrentBuilds(abortPrevious: true)
@@ -447,7 +447,7 @@ pipeline {
447447
-v $WORKSPACE/src/github.com/percona/percona-server-mongodb-operator:/go/src/github.com/percona/percona-server-mongodb-operator \
448448
-w /go/src/github.com/percona/percona-server-mongodb-operator \
449449
-e GOFLAGS='-buildvcs=false' \
450-
golang:1.24 sh -c '
450+
golang:1.25 sh -c '
451451
go install github.com/google/[email protected];
452452
/go/bin/go-licenses csv github.com/percona/percona-server-mongodb-operator/cmd/manager \
453453
| cut -d , -f 3 \
@@ -475,7 +475,7 @@ pipeline {
475475
-v $WORKSPACE/src/github.com/percona/percona-server-mongodb-operator:/go/src/github.com/percona/percona-server-mongodb-operator \
476476
-w /go/src/github.com/percona/percona-server-mongodb-operator \
477477
-e GOFLAGS='-buildvcs=false' \
478-
golang:1.24 sh -c 'go build -v -o percona-server-mongodb-operator github.com/percona/percona-server-mongodb-operator/cmd/manager'
478+
golang:1.25 sh -c 'go build -v -o percona-server-mongodb-operator github.com/percona/percona-server-mongodb-operator/cmd/manager'
479479
"
480480
'''
481481

LICENSE

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Copyright 2018 - 2025 Percona, LLC
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");You may not use
4+
this software except in compliance with the License.
5+
A copy of the License can be obtained at: http://www.apache.org/licenses/LICENSE-2.0
6+
Except as required by applicable law or agreed to in writing, the software distributed
7+
under this License is provided as is, without any warranties or conditions of any kind,
8+
either express or implied. Please refer to the License for the specific terms governing
9+
permissions and limitations.
10+
11+
112
Apache License
213
Version 2.0, January 2004
314
http://www.apache.org/licenses/
@@ -186,7 +197,7 @@
186197
same "printed page" as the copyright notice for easier
187198
identification within third-party archives.
188199

189-
Copyright 2018 Percona, LLC
200+
Copyright 2018 - 2025 Percona, LLC
190201

191202
Licensed under the Apache License, Version 2.0 (the "License");
192203
you may not use this file except in compliance with the License.

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ all: build
1313
help: ## Display this help.
1414
@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)
1515

16-
generate: controller-gen ## Generate CRDs and RBAC files
16+
generate: controller-gen mockgen ## Generate CRDs and RBAC files
1717
go generate ./...
1818
$(CONTROLLER_GEN) crd:maxDescLen=0,allowDangerousTypes=true rbac:roleName=$(NAME) webhook paths="./..." output:crd:artifacts:config=config/crd/bases ## Generate WebhookConfiguration, Role and CustomResourceDefinition objects.
1919
$(CONTROLLER_GEN) object paths="./..." ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -67,7 +67,7 @@ deploy: ## Deploy operator
6767
undeploy: ## Undeploy operator
6868
kubectl delete -f $(DEPLOYDIR)/operator.yaml
6969

70-
test: envtest ## Run tests.
70+
test: envtest generate ## Run tests.
7171
DISABLE_TELEMETRY=true KUBEBUILDER_ASSETS="$(shell $(ENVTEST) --arch=amd64 use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
7272

7373
# go-get-tool will 'go get' any package $2 and install it to $1.
@@ -86,7 +86,7 @@ endef
8686

8787
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
8888
controller-gen: ## Download controller-gen locally if necessary.
89-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.3)
89+
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.19.0)
9090

9191
KUSTOMIZE = $(shell pwd)/bin/kustomize
9292
kustomize: ## Download kustomize locally if necessary.
@@ -100,12 +100,16 @@ SWAGGER = $(shell pwd)/bin/swagger
100100
swagger: ## Download swagger locally if necessary.
101101
$(call go-get-tool,$(SWAGGER),github.com/go-swagger/go-swagger/cmd/swagger@latest)
102102

103+
MOCKGEN = $(shell pwd)/bin/mockgen
104+
mockgen: ## Download mockgen locally if necessary.
105+
$(call go-get-tool,$(MOCKGEN), github.com/golang/mock/mockgen@latest)
106+
103107
# Prepare release
104108
include e2e-tests/release_versions
105109
CERT_MANAGER_VER := $(shell grep -Eo "cert-manager v.*" go.mod|grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")
106110
release: manifests
107111
$(SED) -i "/CERT_MANAGER_VER/s/CERT_MANAGER_VER=\".*/CERT_MANAGER_VER=\"$(CERT_MANAGER_VER)\"/" e2e-tests/functions
108-
$(SED) -i "/Version = \"/s/Version = \".*/Version = \"$(VERSION)\"/" version/version.go
112+
echo "$(VERSION)" > pkg/version/version.txt
109113
$(SED) -i \
110114
-e "s/crVersion: .*/crVersion: $(VERSION)/" \
111115
-e "/^spec:/,/^ image:/{s#image: .*#image: $(IMAGE_MONGOD80)#}" deploy/cr-minimal.yaml

build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=${BUILDPLATFORM} golang:1.24 AS go_builder
1+
FROM --platform=${BUILDPLATFORM} golang:1.25 AS go_builder
22
WORKDIR /go/src/github.com/percona/percona-server-mongodb-operator
33

44
COPY go.mod go.sum ./

config/crd/bases/psmdb.percona.com_perconaservermongodbbackups.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.3
6+
controller-gen.kubebuilder.io/version: v0.19.0
77
name: perconaservermongodbbackups.psmdb.percona.com
88
spec:
99
group: psmdb.percona.com

config/crd/bases/psmdb.percona.com_perconaservermongodbrestores.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.3
6+
controller-gen.kubebuilder.io/version: v0.19.0
77
name: perconaservermongodbrestores.psmdb.percona.com
88
spec:
99
group: psmdb.percona.com
@@ -191,6 +191,13 @@ spec:
191191
type:
192192
type: string
193193
type: object
194+
x-kubernetes-validations:
195+
- message: 'Time should be in format YYYY-MM-DD HH:MM:SS with valid
196+
ranges (MM: 01-12, DD: 01-31, HH: 00-23, MM/SS: 00-59)'
197+
rule: self.type != 'date' || (has(self.date) && self.date.matches('^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])
198+
([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$'))
199+
- message: Date should not be used when 'latest' type is used
200+
rule: self.type != 'latest' || !has(self.date)
194201
replset:
195202
type: string
196203
selective:

0 commit comments

Comments
 (0)