Skip to content

Commit 6d23a02

Browse files
authored
Merge branch 'main' into fix/user-roles-order-sensitive-comparison
2 parents b675426 + 265db79 commit 6d23a02

150 files changed

Lines changed: 8146 additions & 620 deletions

File tree

Some content is hidden

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

.github/workflows/labeler.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: "PR Labeler"
2+
permissions:
3+
contents: read
4+
pull-requests: write
25
on:
36
pull_request:
47
types: [opened, synchronize]
5-
68
jobs:
79
label:
810
runs-on: ubuntu-latest

.github/workflows/reviewdog.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: reviewdog
2+
permissions:
3+
contents: read
24
on: [pull_request]
35
jobs:
46
golangci-lint:
@@ -94,12 +96,12 @@ jobs:
9496
steps:
9597
- uses: actions/checkout@v6
9698
- name: check on release branch
97-
if: ${{ contains(github.head_ref, 'release-') || contains(github.base_ref, 'release-') }}
99+
if: ${{ contains(github.base_ref, 'release-') }}
98100
run: |
99101
make generate manifests VERSION="$(grep -Eo "[0-9]+\.[0-9]+\.[0-9]+" pkg/version/version.txt)" IMAGE_TAG_BASE="percona/percona-server-mongodb-operator"
100102
git diff --exit-code
101103
- name: check on non release branches
102-
if: ${{ ! (contains(github.head_ref, 'release-') || contains(github.base_ref, 'release-')) }}
104+
if: ${{ ! contains(github.base_ref, 'release-') }}
103105
run: |
104106
make generate manifests VERSION=main
105107
git diff --exit-code

.github/workflows/scan.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Scan docker
22
on: [pull_request]
3+
permissions:
4+
contents: read
35

46
env:
57
# Use docker.io for Docker Hub if empty

.github/workflows/stale.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55

66
jobs:
77
stale:
8+
permissions:
9+
contents: read
10+
pull-requests: write
811
runs-on: ubuntu-latest
912
steps:
1013
- uses: actions/stale@v10

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: Run tests
2+
permissions:
3+
contents: read
4+
pull-requests: write
25
on: [pull_request]
36
jobs:
47
test:

Jenkinsfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
region = 'us-central1-a'
2-
testUrlPrefix = 'https://percona-jenkins-artifactory-public.s3.amazonaws.com/cloud-psmdb-operator'
3-
tests = []
1+
import groovy.transform.Field
2+
3+
@Field def region = 'us-central1-a'
4+
@Field def testUrlPrefix = 'https://percona-jenkins-artifactory-public.s3.amazonaws.com/cloud-psmdb-operator'
5+
@Field def tests = []
46

57
void createCluster(String CLUSTER_SUFFIX) {
68
withCredentials([string(credentialsId: 'GCP_PROJECT_ID', variable: 'GCP_PROJECT'), file(credentialsId: 'gcloud-key-file', variable: 'CLIENT_SECRET_FILE')]) {
@@ -182,8 +184,8 @@ String formatTime(def time) {
182184
}
183185
}
184186

185-
TestsReport = '| Test Name | Result | Time |\r\n| ----------- | -------- | ------ |'
186-
TestsReportXML = '<testsuite name=\\"PSMDB\\">\n'
187+
@Field def TestsReport = '| Test Name | Result | Time |\r\n| ----------- | -------- | ------ |'
188+
@Field def TestsReportXML = '<testsuite name=\\"PSMDB\\">\n'
187189

188190
void makeReport() {
189191
def wholeTestAmount = tests.size()
@@ -290,7 +292,7 @@ void prepareNode() {
290292
sudo curl -sLo /usr/local/bin/kubectl https://dl.k8s.io/release/\$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl && sudo chmod +x /usr/local/bin/kubectl
291293
kubectl version --client --output=yaml
292294
293-
curl -fsSL https://get.helm.sh/helm-v3.19.0-linux-amd64.tar.gz | sudo tar -C /usr/local/bin --strip-components 1 -xzf - linux-amd64/helm
295+
curl -fsSL https://get.helm.sh/helm-v3.20.0-linux-amd64.tar.gz | sudo tar -C /usr/local/bin --strip-components 1 -xzf - linux-amd64/helm
294296
295297
sudo curl -fsSL https://github.com/mikefarah/yq/releases/download/v4.48.1/yq_linux_amd64 -o /usr/local/bin/yq && sudo chmod +x /usr/local/bin/yq
296298
sudo curl -fsSL https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux64 -o /usr/local/bin/jq && sudo chmod +x /usr/local/bin/jq
@@ -344,7 +346,7 @@ boolean isManualBuild() {
344346
return !causes.isEmpty()
345347
}
346348

347-
needToRunTests = true
349+
@Field def needToRunTests = true
348350
void checkE2EIgnoreFiles() {
349351
if (isManualBuild()) {
350352
echo "This is a manual rebuild. Forcing pipeline execution."
@@ -423,9 +425,9 @@ pipeline {
423425
CLOUDSDK_CORE_DISABLE_PROMPTS = 1
424426
CLEAN_NAMESPACE = 1
425427
OPERATOR_NS = 'psmdb-operator'
426-
GIT_SHORT_COMMIT = sh(script: 'git rev-parse --short HEAD', , returnStdout: true).trim()
428+
GIT_SHORT_COMMIT = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
427429
VERSION = "${env.GIT_BRANCH}-${env.GIT_SHORT_COMMIT}"
428-
CLUSTER_NAME = sh(script: "echo jen-psmdb-${env.CHANGE_ID}-${GIT_SHORT_COMMIT}-${env.BUILD_NUMBER} | tr '[:upper:]' '[:lower:]'", , returnStdout: true).trim()
430+
CLUSTER_NAME = sh(script: "echo jen-psmdb-${env.CHANGE_ID}-${GIT_SHORT_COMMIT}-${env.BUILD_NUMBER} | tr '[:upper:]' '[:lower:]'", returnStdout: true).trim()
429431
AUTHOR_NAME = sh(script: "echo ${CHANGE_AUTHOR_EMAIL} | awk -F'@' '{print \$1}'", , returnStdout: true).trim()
430432
ENABLE_LOGGING = "true"
431433
}

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ MOCKGEN = $(shell pwd)/bin/mockgen
104104
mockgen: ## Download mockgen locally if necessary.
105105
$(call go-get-tool,$(MOCKGEN), github.com/golang/mock/mockgen@latest)
106106

107+
update-version:
108+
echo $(NEXT_VER) > pkg/version/version.txt
109+
107110
# Prepare release
108111
include e2e-tests/release_versions
109112
CERT_MANAGER_VER := $(shell grep -Eo "cert-manager v.*" go.mod|grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")
@@ -127,13 +130,13 @@ release: manifests
127130
-e "s|perconalab/fluentbit:main-logcollector|$(IMAGE_LOGCOLLECTOR)|g" \
128131
pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/*.yaml
129132
$(SED) -i "s|cr.Spec.InitImage = \".*\"|cr.Spec.InitImage = \"${IMAGE_OPERATOR}\"|g" pkg/controller/perconaservermongodb/suite_test.go
133+
$(SED) -i "s|perconalab/percona-server-mongodb-operator:main-mongod8.0|$(IMAGE_MONGOD80)|g" pkg/psmdb/mongos_test.go
130134

131135
# Prepare main branch after release
132136
MAJOR_VER := $(shell grep -oE "crVersion: .*" deploy/cr.yaml|grep -oE "[0-9]+\.[0-9]+\.[0-9]+"|cut -d'.' -f1)
133137
MINOR_VER := $(shell grep -oE "crVersion: .*" deploy/cr.yaml|grep -oE "[0-9]+\.[0-9]+\.[0-9]+"|cut -d'.' -f2)
134138
NEXT_VER ?= $(MAJOR_VER).$$(($(MINOR_VER) + 1)).0
135-
after-release: manifests
136-
echo $(NEXT_VER) > pkg/version/version.txt
139+
after-release: update-version manifests
137140
$(SED) -i \
138141
-e "s/crVersion: .*/crVersion: $(NEXT_VER)/" \
139142
-e "/^spec:/,/^ image:/{s#image: .*#image: perconalab/percona-server-mongodb-operator:main-mongod8.0#}" deploy/cr-minimal.yaml
@@ -151,6 +154,7 @@ after-release: manifests
151154
-e "s|$(IMAGE_LOGCOLLECTOR)|perconalab/fluentbit:main-logcollector|g" \
152155
pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/*.yaml
153156
$(SED) -i "s|cr.Spec.InitImage = \".*\"|cr.Spec.InitImage = \"perconalab/percona-server-mongodb-operator:main\"|g" pkg/controller/perconaservermongodb/suite_test.go
157+
$(SED) -i "s|$(IMAGE_MONGOD80)|perconalab/percona-server-mongodb-operator:main-mongod8.0|g" pkg/psmdb/mongos_test.go
154158

155159
version-service-client: swagger
156160
curl https://raw.githubusercontent.com/Percona-Lab/percona-version-service/$(VS_BRANCH)/api/version.swagger.yaml \

build/physical-restore-ps-entry.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ trap 'handle_sigterm' 15
2525

2626
touch /opt/percona/restore-in-progress
2727

28+
if [ -d /etc/s3/certs-in ] && [ -n "$(ls -A /etc/s3/certs-in/*.crt 2>/dev/null)" ]; then
29+
cat /etc/s3/certs-in/*.crt > /etc/s3/certs/ca-bundle.crt
30+
chmod 0644 /etc/s3/certs/ca-bundle.crt
31+
fi
32+
2833
if [[ -z ${PBM_AGENT_TLS_ENABLED} ]] || [[ ${PBM_AGENT_TLS_ENABLED} == "true" ]]; then
2934
MONGO_SSL_DIR=/etc/mongodb-ssl
3035
if [[ -e "${MONGO_SSL_DIR}/tls.crt" ]] && [[ -e "${MONGO_SSL_DIR}/tls.key" ]]; then

cmd/manager/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313

1414
certmgrscheme "github.com/cert-manager/cert-manager/pkg/client/clientset/versioned/scheme"
1515
"github.com/go-logr/logr"
16+
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
1617
uzap "go.uber.org/zap"
1718
"go.uber.org/zap/zapcore"
1819
k8sruntime "k8s.io/apimachinery/pkg/runtime"
@@ -44,6 +45,7 @@ var (
4445
func init() {
4546
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
4647
utilruntime.Must(apis.AddToScheme(scheme))
48+
utilruntime.Must(volumesnapshotv1.AddToScheme(scheme))
4749
}
4850

4951
func main() {

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@ spec:
7878
enum:
7979
- logical
8080
- physical
81+
- external
8182
- incremental
8283
- incremental-base
8384
type: string
85+
volumeSnapshotClass:
86+
type: string
8487
type: object
8588
status:
8689
properties:
@@ -255,6 +258,15 @@ spec:
255258
type: object
256259
size:
257260
type: string
261+
snapshots:
262+
items:
263+
properties:
264+
replsetName:
265+
type: string
266+
snapshotName:
267+
type: string
268+
type: object
269+
type: array
258270
start:
259271
format: date-time
260272
type: string

0 commit comments

Comments
 (0)