From 22fa8d67e3fbeb10ba4e9fa9b1fa1c0b7e173379 Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:07:11 +0200 Subject: [PATCH 01/30] K8SPSMDB-1153 Update images and versions for 1.18.0 release (#1688) * K8SPSMDB-1153 Update images and versions for 1.18.0 release * Update images and versions for 1.18.0 release in the pkg/controller/perconaservermongodb/xxx files * Update percona-server-mongodb image to version 7.0.14-8 * Updating the cert-manager version to 1.16.1 * Refactor certmanager.go to remove unused variable and update cmapichecker.New() call * Update percona/pmm-client image to version 2.43.2 * Revert "Refactor certmanager.go to remove unused variable and update cmapichecker.New() call" This reverts commit 733f378ccfa659c5bbe7f03102880e81d7eb9933. * Revert "Updating the cert-manager version to 1.16.1" This reverts commit 9d8ec60291d5f87695eeff84d35ee5e2ba5b8b9f. * reverting cert-manager back to 1.15.3, the version bump will be a part of a separate PR --- deploy/bundle.yaml | 2 +- deploy/cr-minimal.yaml | 2 +- deploy/cr.yaml | 8 ++++---- deploy/cw-bundle.yaml | 2 +- deploy/cw-operator.yaml | 2 +- deploy/operator.yaml | 2 +- .../testdata/reconcile-statefulset/cfg-arbiter.yaml | 4 ++-- .../testdata/reconcile-statefulset/cfg-mongod.yaml | 4 ++-- .../testdata/reconcile-statefulset/cfg-nv.yaml | 4 ++-- .../testdata/reconcile-statefulset/rs0-arbiter.yaml | 2 +- .../testdata/reconcile-statefulset/rs0-mongod.yaml | 4 ++-- .../testdata/reconcile-statefulset/rs0-nv.yaml | 4 ++-- pkg/psmdb/backup/testdata/cr-with-pbm-config.yaml | 6 +++--- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/deploy/bundle.yaml b/deploy/bundle.yaml index 67934c7f15..51389ecaa8 100644 --- a/deploy/bundle.yaml +++ b/deploy/bundle.yaml @@ -19693,7 +19693,7 @@ spec: serviceAccountName: percona-server-mongodb-operator containers: - name: percona-server-mongodb-operator - image: perconalab/percona-server-mongodb-operator:main + image: percona/percona-server-mongodb-operator:1.18.0 imagePullPolicy: Always livenessProbe: failureThreshold: 3 diff --git a/deploy/cr-minimal.yaml b/deploy/cr-minimal.yaml index 2d00203fe5..9782641eb3 100644 --- a/deploy/cr-minimal.yaml +++ b/deploy/cr-minimal.yaml @@ -4,7 +4,7 @@ metadata: name: minimal-cluster spec: crVersion: 1.18.0 - image: perconalab/percona-server-mongodb-operator:main-mongod7.0 + image: percona/percona-server-mongodb:7.0.14-8 unsafeFlags: replsetSize: true mongosSize: true diff --git a/deploy/cr.yaml b/deploy/cr.yaml index a58814a89e..5ed1221914 100644 --- a/deploy/cr.yaml +++ b/deploy/cr.yaml @@ -14,7 +14,7 @@ spec: # unmanaged: false # enableVolumeExpansion: true crVersion: 1.18.0 - image: perconalab/percona-server-mongodb-operator:main-mongod7.0 + image: percona/percona-server-mongodb:7.0.14-8 imagePullPolicy: Always # tls: # mode: preferTLS @@ -27,7 +27,7 @@ spec: # group: cert-manager.io # imagePullSecrets: # - name: private-registry-credentials -# initImage: perconalab/percona-server-mongodb-operator:main +# initImage: percona/percona-server-mongodb-operator:1.18.0 # initContainerSecurityContext: {} # unsafeFlags: # tls: false @@ -57,7 +57,7 @@ spec: # sse: my-cluster-name-sse pmm: enabled: false - image: perconalab/pmm-client:dev-latest + image: percona/pmm-client:2.43.2 serverHost: monitoring-service # containerSecurityContext: {} # mongodParams: --environment=ENVIRONMENT @@ -608,7 +608,7 @@ spec: backup: enabled: true - image: perconalab/percona-server-mongodb-operator:main-backup + image: percona/percona-backup-mongodb:2.6.0 # annotations: # iam.amazonaws.com/role: role-arn # resources: diff --git a/deploy/cw-bundle.yaml b/deploy/cw-bundle.yaml index b365d0d673..f85f1736e4 100644 --- a/deploy/cw-bundle.yaml +++ b/deploy/cw-bundle.yaml @@ -19714,7 +19714,7 @@ spec: serviceAccountName: percona-server-mongodb-operator containers: - name: percona-server-mongodb-operator - image: perconalab/percona-server-mongodb-operator:main + image: percona/percona-server-mongodb-operator:1.18.0 imagePullPolicy: Always livenessProbe: failureThreshold: 3 diff --git a/deploy/cw-operator.yaml b/deploy/cw-operator.yaml index b8ec3d38e6..47b2ecc323 100644 --- a/deploy/cw-operator.yaml +++ b/deploy/cw-operator.yaml @@ -15,7 +15,7 @@ spec: serviceAccountName: percona-server-mongodb-operator containers: - name: percona-server-mongodb-operator - image: perconalab/percona-server-mongodb-operator:main + image: percona/percona-server-mongodb-operator:1.18.0 imagePullPolicy: Always livenessProbe: failureThreshold: 3 diff --git a/deploy/operator.yaml b/deploy/operator.yaml index 90d4d04a51..e606af9612 100644 --- a/deploy/operator.yaml +++ b/deploy/operator.yaml @@ -15,7 +15,7 @@ spec: serviceAccountName: percona-server-mongodb-operator containers: - name: percona-server-mongodb-operator - image: perconalab/percona-server-mongodb-operator:main + image: percona/percona-server-mongodb-operator:1.18.0 imagePullPolicy: Always livenessProbe: failureThreshold: 3 diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-arbiter.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-arbiter.yaml index a9d9da30d0..07905f7682 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-arbiter.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-arbiter.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: perconalab/percona-server-mongodb-operator:main-mongod7.0 + image: percona/percona-server-mongodb:7.0.14-8 imagePullPolicy: Always livenessProbe: exec: @@ -185,7 +185,7 @@ spec: value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME) - name: PBM_AGENT_TLS_ENABLED value: "true" - image: perconalab/percona-server-mongodb-operator:main-backup + image: percona/percona-backup-mongodb:2.6.0 imagePullPolicy: Always name: backup-agent resources: {} diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-mongod.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-mongod.yaml index a9d9da30d0..07905f7682 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-mongod.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-mongod.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: perconalab/percona-server-mongodb-operator:main-mongod7.0 + image: percona/percona-server-mongodb:7.0.14-8 imagePullPolicy: Always livenessProbe: exec: @@ -185,7 +185,7 @@ spec: value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME) - name: PBM_AGENT_TLS_ENABLED value: "true" - image: perconalab/percona-server-mongodb-operator:main-backup + image: percona/percona-backup-mongodb:2.6.0 imagePullPolicy: Always name: backup-agent resources: {} diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-nv.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-nv.yaml index a9d9da30d0..07905f7682 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-nv.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-nv.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: perconalab/percona-server-mongodb-operator:main-mongod7.0 + image: percona/percona-server-mongodb:7.0.14-8 imagePullPolicy: Always livenessProbe: exec: @@ -185,7 +185,7 @@ spec: value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME) - name: PBM_AGENT_TLS_ENABLED value: "true" - image: perconalab/percona-server-mongodb-operator:main-backup + image: percona/percona-backup-mongodb:2.6.0 imagePullPolicy: Always name: backup-agent resources: {} diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-arbiter.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-arbiter.yaml index def9845aaf..94ab3d6772 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-arbiter.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-arbiter.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: perconalab/percona-server-mongodb-operator:main-mongod7.0 + image: percona/percona-server-mongodb:7.0.14-8 imagePullPolicy: Always livenessProbe: exec: diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-mongod.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-mongod.yaml index 3827372650..68ddad2631 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-mongod.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-mongod.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: perconalab/percona-server-mongodb-operator:main-mongod7.0 + image: percona/percona-server-mongodb:7.0.14-8 imagePullPolicy: Always livenessProbe: exec: @@ -185,7 +185,7 @@ spec: value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME) - name: PBM_AGENT_TLS_ENABLED value: "true" - image: perconalab/percona-server-mongodb-operator:main-backup + image: percona/percona-backup-mongodb:2.6.0 imagePullPolicy: Always name: backup-agent resources: {} diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-nv.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-nv.yaml index 00e3260dd9..e865cef7a1 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-nv.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-nv.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: perconalab/percona-server-mongodb-operator:main-mongod7.0 + image: percona/percona-server-mongodb:7.0.14-8 imagePullPolicy: Always livenessProbe: exec: @@ -184,7 +184,7 @@ spec: value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME) - name: PBM_AGENT_TLS_ENABLED value: "true" - image: perconalab/percona-server-mongodb-operator:main-backup + image: percona/percona-backup-mongodb:2.6.0 imagePullPolicy: Always name: backup-agent resources: {} diff --git a/pkg/psmdb/backup/testdata/cr-with-pbm-config.yaml b/pkg/psmdb/backup/testdata/cr-with-pbm-config.yaml index ebee7b3824..d7fb3753a8 100644 --- a/pkg/psmdb/backup/testdata/cr-with-pbm-config.yaml +++ b/pkg/psmdb/backup/testdata/cr-with-pbm-config.yaml @@ -5,7 +5,7 @@ metadata: namespace: test-namespace spec: crVersion: 1.16.0 - image: perconalab/percona-server-mongodb-operator:main-mongod7.0 + image: percona/percona-server-mongodb:7.0.14-8 imagePullPolicy: Always allowUnsafeConfigurations: false updateStrategy: SmartUpdate @@ -19,7 +19,7 @@ spec: encryptionKey: my-cluster-name-mongodb-encryption-key pmm: enabled: false - image: perconalab/pmm-client:dev-latest + image: percona/pmm-client:2.43.2 serverHost: monitoring-service replsets: - name: rs0 @@ -118,7 +118,7 @@ spec: backup: enabled: true - image: perconalab/percona-server-mongodb-operator:main-backup + image: percona/percona-backup-mongodb:2.6.0 storages: test-s3-storage: type: s3 From ef64f8dbdc33530b2fa0eb0e6b4309f5f1fe151b Mon Sep 17 00:00:00 2001 From: Eleonora Zinchenko Date: Fri, 1 Nov 2024 15:35:33 +0200 Subject: [PATCH 02/30] K8SPSMDB-1136 Add file with release versions (#1671) --- e2e-tests/release_images | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 e2e-tests/release_images diff --git a/e2e-tests/release_images b/e2e-tests/release_images new file mode 100644 index 0000000000..5881a0e1a7 --- /dev/null +++ b/e2e-tests/release_images @@ -0,0 +1,7 @@ +IMAGE_OPERATOR=percona/percona-server-mongodb-operator:1.18.0 +IMAGE_MONGOD70=percona/percona-server-mongodb:7.0.14-8 +IMAGE_MONGOD60=percona/percona-server-mongodb:6.0.17-14 +IMAGE_MONGOD50=percona/percona-server-mongodb:5.0.29-25 +IMAGE_BACKUP=percona/percona-backup-mongodb:2.6.0 +IMAGE_PMM_CLIENT=percona/pmm-client:2.43.2 +IMAGE_PMM_SERVER=percona/pmm-server:2.43.2 From a87e788ba087d06dbfc3666984b948e124e6209c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20G=C3=BCne=C5=9F?= Date: Tue, 29 Oct 2024 10:36:03 +0300 Subject: [PATCH 03/30] K8SPSMDB-1177: Bump PBM to 2.7.0 (#1672) * K8SPSMDB-1177: Bump PBM to 2.7.0 * wait for resync after physical restore * use PBM 2.7.0 * wait for pbm operations before requesting physical restore * remove workaround for PBM-1391 * don't fail restore on partlyDone --------- Co-authored-by: Viacheslav Sarzhan --- e2e-tests/conf/client_with_tls.yml | 1 + e2e-tests/demand-backup-physical/run | 4 + e2e-tests/functions | 2 +- e2e-tests/pitr-physical/run | 5 - go.mod | 2 +- go.sum | 2 + .../perconaservermongodbbackup_controller.go | 2 +- .../perconaservermongodbrestore/physical.go | 124 ++++++++++-------- pkg/psmdb/backup/pbm.go | 12 +- 9 files changed, 84 insertions(+), 70 deletions(-) diff --git a/e2e-tests/conf/client_with_tls.yml b/e2e-tests/conf/client_with_tls.yml index d64c177597..4b6f5e829e 100644 --- a/e2e-tests/conf/client_with_tls.yml +++ b/e2e-tests/conf/client_with_tls.yml @@ -12,6 +12,7 @@ spec: labels: name: psmdb-client spec: + terminationGracePeriodSeconds: 10 containers: - name: psmdb-client image: percona/percona-server-mongodb:4.4 diff --git a/e2e-tests/demand-backup-physical/run b/e2e-tests/demand-backup-physical/run index 16d1042560..853468d29c 100755 --- a/e2e-tests/demand-backup-physical/run +++ b/e2e-tests/demand-backup-physical/run @@ -36,16 +36,20 @@ run_recovery_check() { # we don't wait for cluster readiness here because the annotation gets removed then wait_restore "${backup_name}" "${cluster}" "ready" "0" "1800" + kubectl_bin get psmdb ${cluster} -o yaml if [ $(kubectl_bin get psmdb ${cluster} -o yaml | yq '.metadata.annotations."percona.com/resync-pbm"') == null ]; then echo "psmdb/${cluster} should be annotated with percona.com/resync-pbm after a physical restore" exit 1 fi echo + wait_cluster_consistency ${cluster} + compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-0.${cluster}-rs0.${namespace}" compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-1.${cluster}-rs0.${namespace}" compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-2.${cluster}-rs0.${namespace}" + echo set -o xtrace } diff --git a/e2e-tests/functions b/e2e-tests/functions index ae1ffeb7a0..dd813925a1 100755 --- a/e2e-tests/functions +++ b/e2e-tests/functions @@ -11,7 +11,7 @@ perconalab/percona-server-mongodb-operator:main-mongod5.0 perconalab/percona-server-mongodb-operator:main-mongod6.0 perconalab/percona-server-mongodb-operator:main-mongod7.0'} -IMAGE_BACKUP=${IMAGE_BACKUP:-"perconalab/percona-server-mongodb-operator:main-backup"} +IMAGE_BACKUP=${IMAGE_BACKUP:-"perconalab/percona-backup-mongodb:2.7.0"} SKIP_BACKUPS_TO_AWS_GCP_AZURE=${SKIP_BACKUPS_TO_AWS_GCP_AZURE:-1} PMM_SERVER_VER=${PMM_SERVER_VER:-"9.9.9"} IMAGE_PMM_CLIENT=${IMAGE_PMM_CLIENT:-"perconalab/pmm-client:dev-latest"} diff --git a/e2e-tests/pitr-physical/run b/e2e-tests/pitr-physical/run index ac8703a7f9..49ae125d4a 100755 --- a/e2e-tests/pitr-physical/run +++ b/e2e-tests/pitr-physical/run @@ -152,11 +152,6 @@ main() { sleep 360 backup_name_minio="backup-minio" - run_backup $backup_name_minio 1 physical - - # 2nd backup is required for to workaround PBM-1391 - # in case of the 1st, pbmPITR collection is created after the backup - # and it causes crashes after physical restore run_backup $backup_name_minio 2 physical write_document "-2nd" diff --git a/go.mod b/go.mod index f581339d75..edab38d720 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/go-openapi/validate v0.24.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 github.com/hashicorp/go-version v1.7.0 - github.com/percona/percona-backup-mongodb v1.8.1-0.20240902083313-f2cf881c856b + github.com/percona/percona-backup-mongodb v1.8.1-0.20241002124601-957ac501f939 github.com/pkg/errors v0.9.1 github.com/robfig/cron/v3 v3.0.1 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index 0dd8d821d5..67621a9266 100644 --- a/go.sum +++ b/go.sum @@ -385,6 +385,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/percona/percona-backup-mongodb v1.8.1-0.20240902083313-f2cf881c856b h1:NUFwRNs75xaz4mNaGnt5E6jb0eMWIgNOf9mriwrCAeQ= github.com/percona/percona-backup-mongodb v1.8.1-0.20240902083313-f2cf881c856b/go.mod h1:KhIlTT4wR2mIkMvDtEFerr9zaADJorL7UThSztzxBaY= +github.com/percona/percona-backup-mongodb v1.8.1-0.20241002124601-957ac501f939 h1:OggdqSzqe9pO3A4GaRlrLwZXS3zEQ84O4+7Jm9cg74s= +github.com/percona/percona-backup-mongodb v1.8.1-0.20241002124601-957ac501f939/go.mod h1:KhIlTT4wR2mIkMvDtEFerr9zaADJorL7UThSztzxBaY= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= diff --git a/pkg/controller/perconaservermongodbbackup/perconaservermongodbbackup_controller.go b/pkg/controller/perconaservermongodbbackup/perconaservermongodbbackup_controller.go index 6ef7a5b31a..4b66d3b35f 100644 --- a/pkg/controller/perconaservermongodbbackup/perconaservermongodbbackup_controller.go +++ b/pkg/controller/perconaservermongodbbackup/perconaservermongodbbackup_controller.go @@ -418,7 +418,7 @@ func (r *ReconcilePerconaServerMongoDBBackup) deleteBackupFinalizer(ctx context. if err != nil { return errors.Wrap(err, "get storage") } - if err := pbmBackup.DeleteBackupFiles(getPBMBackupMeta(cr), stg); err != nil { + if err := pbmBackup.DeleteBackupFiles(stg, getPBMBackupMeta(cr).Name); err != nil { return errors.Wrap(err, "failed to delete backup files with dummy PBM") } return nil diff --git a/pkg/controller/perconaservermongodbrestore/physical.go b/pkg/controller/perconaservermongodbrestore/physical.go index fec777ad2b..4d5b24b9e2 100644 --- a/pkg/controller/perconaservermongodbrestore/physical.go +++ b/pkg/controller/perconaservermongodbrestore/physical.go @@ -147,53 +147,7 @@ func (r *ReconcilePerconaServerMongoDBRestore) reconcilePhysicalRestore(ctx cont } time.Sleep(5 * time.Second) // wait until pbm will start resync - - waitErr := errors.New("waiting for PBM operation to finish") - err = retry.OnError(wait.Backoff{ - Duration: 5 * time.Second, - Factor: 2.0, - Cap: time.Hour, - Steps: 12, - }, func(err error) bool { return err == waitErr }, func() error { - err := retry.OnError(retry.DefaultBackoff, func(err error) bool { return strings.Contains(err.Error(), "No agent available") }, func() error { - stdoutBuf.Reset() - stderrBuf.Reset() - - command := []string{"/opt/percona/pbm", "status", "--out", "json"} - err := r.clientcmd.Exec(ctx, &pod, "mongod", command, nil, stdoutBuf, stderrBuf, false) - if err != nil { - log.Error(err, "failed to get PBM status") - return err - } - - log.V(1).Info("PBM status", "status", stdoutBuf.String()) - - return nil - }) - if err != nil { - return errors.Wrapf(err, "get PBM status stderr: %s stdout: %s", stderrBuf.String(), stdoutBuf.String()) - } - - var pbmStatus struct { - Running struct { - Type string `json:"type,omitempty"` - OpId string `json:"opID,omitempty"` - } `json:"running"` - } - - if err := json.Unmarshal(stdoutBuf.Bytes(), &pbmStatus); err != nil { - return errors.Wrap(err, "unmarshal PBM status output") - } - - if len(pbmStatus.Running.OpId) == 0 { - return nil - } - - log.Info("Waiting for another PBM operation to finish", "type", pbmStatus.Running.Type, "opID", pbmStatus.Running.OpId) - - return waitErr - }) - if err != nil { + if err := r.waitForPBMOperationsToFinish(ctx, &pod); err != nil { return status, err } @@ -288,15 +242,6 @@ func (r *ReconcilePerconaServerMongoDBRestore) reconcilePhysicalRestore(ctx cont case defs.StatusError: status.State = psmdbv1.RestoreStateError status.Error = meta.Err - case defs.StatusPartlyDone: - status.State = psmdbv1.RestoreStateError - var pbmErr string - for _, rs := range meta.Replsets { - if rs.Status == defs.StatusError { - pbmErr += fmt.Sprintf("%s %s;", rs.Name, rs.Error) - } - } - status.Error = pbmErr case defs.StatusRunning: status.State = psmdbv1.RestoreStateRunning case defs.StatusDone: @@ -938,3 +883,70 @@ func (r *ReconcilePerconaServerMongoDBRestore) pbmConfigName(cluster *psmdbv1.Pe } return cluster.Name + "-pbm-config" } + +func (r *ReconcilePerconaServerMongoDBRestore) waitForPBMOperationsToFinish(ctx context.Context, pod *corev1.Pod) error { + log := logf.FromContext(ctx) + + stdoutBuf := &bytes.Buffer{} + stderrBuf := &bytes.Buffer{} + + container := "mongod" + pbmBinary := "/opt/percona/pbm" + for _, c := range pod.Spec.Containers { + if c.Name == "backup-agent" { + container = c.Name + pbmBinary = "pbm" + } + } + + waitErr := errors.New("waiting for PBM operation to finish") + err := retry.OnError(wait.Backoff{ + Duration: 5 * time.Second, + Factor: 2.0, + Cap: time.Hour, + Steps: 12, + }, func(err error) bool { return err == waitErr }, func() error { + err := retry.OnError(retry.DefaultBackoff, func(err error) bool { return strings.Contains(err.Error(), "No agent available") }, func() error { + stdoutBuf.Reset() + stderrBuf.Reset() + + command := []string{pbmBinary, "status", "--out", "json"} + err := r.clientcmd.Exec(ctx, pod, container, command, nil, stdoutBuf, stderrBuf, false) + if err != nil { + log.Error(err, "failed to get PBM status") + return err + } + + log.V(1).Info("PBM status", "status", stdoutBuf.String()) + + return nil + }) + if err != nil { + return errors.Wrapf(err, "get PBM status stderr: %s stdout: %s", stderrBuf.String(), stdoutBuf.String()) + } + + var pbmStatus struct { + Running struct { + Type string `json:"type,omitempty"` + OpId string `json:"opID,omitempty"` + } `json:"running"` + } + + if err := json.Unmarshal(stdoutBuf.Bytes(), &pbmStatus); err != nil { + return errors.Wrap(err, "unmarshal PBM status output") + } + + if len(pbmStatus.Running.OpId) == 0 { + return nil + } + + log.Info("Waiting for another PBM operation to finish", "type", pbmStatus.Running.Type, "opID", pbmStatus.Running.OpId) + + return waitErr + }) + if err != nil { + return err + } + + return nil +} diff --git a/pkg/psmdb/backup/pbm.go b/pkg/psmdb/backup/pbm.go index 6248a83d7f..fc4b6de21e 100644 --- a/pkg/psmdb/backup/pbm.go +++ b/pkg/psmdb/backup/pbm.go @@ -121,7 +121,7 @@ func getMongoUri(ctx context.Context, k8sclient client.Client, cr *api.PerconaSe tlsKey := sslSecret.Data["tls.key"] tlsCert := sslSecret.Data["tls.crt"] - tlsPemFile := fmt.Sprintf("/tmp/%s-%s-tls.pem", cr.Namespace, cr.Name ) + tlsPemFile := fmt.Sprintf("/tmp/%s-%s-tls.pem", cr.Namespace, cr.Name) f, err := os.OpenFile(tlsPemFile, os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0o600) if err != nil { return "", errors.Wrapf(err, "open %s", tlsPemFile) @@ -132,7 +132,7 @@ func getMongoUri(ctx context.Context, k8sclient client.Client, cr *api.PerconaSe } caCert := sslSecret.Data["ca.crt"] - caCertFile := fmt.Sprintf("/tmp/%s-%s-ca.crt", cr.Namespace, cr.Name ) + caCertFile := fmt.Sprintf("/tmp/%s-%s-ca.crt", cr.Namespace, cr.Name) f, err = os.OpenFile(caCertFile, os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0o600) if err != nil { return "", errors.Wrapf(err, "open %s", caCertFile) @@ -391,23 +391,23 @@ func GetPBMConfig(ctx context.Context, k8sclient client.Client, cluster *api.Per func (b *pbmC) ValidateBackup(ctx context.Context, bcp *psmdbv1.PerconaServerMongoDBBackup, cfg config.Config) error { e := b.Logger().NewEvent(string(ctrl.CmdRestore), "", "", primitive.Timestamp{}) backupName := bcp.Status.PBMname - s, err := util.StorageFromConfig(&cfg.Storage, e) + stg, err := util.StorageFromConfig(&cfg.Storage, e) if err != nil { return errors.Wrap(err, "storage from config") } - m, err := restore.GetMetaFromStore(s, backupName) + m, err := restore.GetMetaFromStore(stg, backupName) if err != nil { return errors.Wrap(err, "get backup metadata from storage") } switch bcp.Status.Type { case "", defs.LogicalBackup: - if err := backup.CheckBackupFiles(ctx, m, s); err != nil { + if err := backup.CheckBackupFiles(ctx, stg, m.Name); err != nil { return errors.Wrap(err, "check backup files") } case defs.PhysicalBackup: for _, rs := range m.Replsets { f := path.Join(m.Name, rs.Name) - files, err := s.List(f, "") + files, err := stg.List(f, "") if err != nil { return errors.Wrapf(err, "failed to list backup files at %s", f) } From 1743a0a09979b8ff7204338ceddcc8d655fca3a8 Mon Sep 17 00:00:00 2001 From: Andrii Dema Date: Thu, 31 Oct 2024 15:26:34 +0200 Subject: [PATCH 04/30] K8SPSMDB-1156: fix deletion of cluster with finalizers (#1691) https://perconadev.atlassian.net/browse/K8SPSMDB-1156 --- .../perconaservermongodb/finalizers.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pkg/controller/perconaservermongodb/finalizers.go b/pkg/controller/perconaservermongodb/finalizers.go index 6e5a5bf30b..52dfdeba97 100644 --- a/pkg/controller/perconaservermongodb/finalizers.go +++ b/pkg/controller/perconaservermongodb/finalizers.go @@ -52,13 +52,24 @@ func (r *ReconcilePerconaServerMongoDB) checkFinalizers(ctx context.Context, cr continue } if err != nil { + if cr.Status.State == api.AppStateError { + /* + If a finalizer returns an error, the operator will continue the reconciliation process. + However, if the cluster is already in an error state, it is likely that this state will + persist in each subsequent reconcile, causing the cluster deletion process to get stuck. + + The operator should attempt to execute finalizers, but when the cluster is in an error state, + any errors from finalizer functions should be ignored to allow the deletion process to continue. + + Do not move this check elsewhere. Finalizers should not put the cluster into an error state. + If a finalizer function does cause the cluster to enter an error state, its logic should be changed. + */ + continue + } switch err { case errWaitingTermination: default: log.Error(err, "failed to run finalizer", "finalizer", f) - if cr.Status.State == api.AppStateError { - continue - } } finalizers = append(finalizers, orderedFinalizers[i:]...) break From 356e5f8fa59ac5489b9e8c40d2e67e23ad1e38eb Mon Sep 17 00:00:00 2001 From: Inel Pandzic Date: Mon, 4 Nov 2024 09:10:39 +0100 Subject: [PATCH 05/30] K8SPSMDB-1124: Fix setting authenticationRestrictions (#1695) * Proper mongo request. * Cleanup --------- Co-authored-by: Viacheslav Sarzhan --- pkg/psmdb/mongo/mongo.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkg/psmdb/mongo/mongo.go b/pkg/psmdb/mongo/mongo.go index 60268605d8..90f4eb8d56 100644 --- a/pkg/psmdb/mongo/mongo.go +++ b/pkg/psmdb/mongo/mongo.go @@ -173,7 +173,17 @@ func (client *mongoClient) CreateRole(ctx context.Context, db string, role Role) authRestrictionsArr := bson.A{} for _, r := range role.AuthenticationRestrictions { - authRestrictionsArr = append(authRestrictionsArr, r) + m := bson.M{} + + if len(r.ServerAddress) > 0 { + m["serverAddress"] = r.ServerAddress + } + + if len(r.ClientSource) > 0 { + m["clientSource"] = r.ClientSource + } + + authRestrictionsArr = append(authRestrictionsArr, m) } m := bson.D{ From b94ff83fa2db91a84b32dfcd9ca5212fabca112e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20G=C3=BCne=C5=9F?= Date: Mon, 4 Nov 2024 13:09:47 +0300 Subject: [PATCH 06/30] K8SPSMDB-1132: Fix cluster init if deployed with keyFile auth (#1694) * K8SPSMDB-1132: Fix cluster init if deployed with keyFile auth * fix crVersion --------- Co-authored-by: Viacheslav Sarzhan --- build/ps-entry.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/build/ps-entry.sh b/build/ps-entry.sh index 0e1f187505..78f81371e1 100755 --- a/build/ps-entry.sh +++ b/build/ps-entry.sh @@ -1,6 +1,5 @@ #!/bin/bash set -Eeuo pipefail -set -o xtrace if [ "${1:0:1}" = '-' ]; then set -- mongod "$@" @@ -421,13 +420,10 @@ if [[ $originalArgOne == mongo* ]]; then tlsMode="preferTLS" fi - # don't add --tlsMode if TLS is disabled - if clusterAuthMode="$(_mongod_hack_get_arg_val --clusterAuthMode "${mongodHackedArgs[@]}")"; then - if [[ ${clusterAuthMode} != "keyFile" ]]; then - _mongod_hack_ensure_arg_val --tlsMode "${tlsMode}" "${mongodHackedArgs[@]}" - else - _mongod_hack_ensure_no_arg --sslAllowInvalidCertificates "${mongodHackedArgs[@]}" - fi + _mongod_hack_ensure_arg_val --tlsMode "${tlsMode}" "${mongodHackedArgs[@]}" + + if [[ ${tlsMode} == "disabled" ]]; then + _mongod_hack_ensure_no_arg --sslAllowInvalidCertificates "${mongodHackedArgs[@]}" fi if [[ ${tlsMode} != "disabled" ]]; then From c50ea3ed335356b479b48c55e3652a0b1dae1d0a Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:17:48 +0200 Subject: [PATCH 07/30] Update PBM image version to 2.7.0 --- deploy/cr.yaml | 2 +- e2e-tests/release_images | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/cr.yaml b/deploy/cr.yaml index 5ed1221914..926c7fc404 100644 --- a/deploy/cr.yaml +++ b/deploy/cr.yaml @@ -608,7 +608,7 @@ spec: backup: enabled: true - image: percona/percona-backup-mongodb:2.6.0 + image: percona/percona-backup-mongodb:2.7.0 # annotations: # iam.amazonaws.com/role: role-arn # resources: diff --git a/e2e-tests/release_images b/e2e-tests/release_images index 5881a0e1a7..593f7485c7 100644 --- a/e2e-tests/release_images +++ b/e2e-tests/release_images @@ -2,6 +2,6 @@ IMAGE_OPERATOR=percona/percona-server-mongodb-operator:1.18.0 IMAGE_MONGOD70=percona/percona-server-mongodb:7.0.14-8 IMAGE_MONGOD60=percona/percona-server-mongodb:6.0.17-14 IMAGE_MONGOD50=percona/percona-server-mongodb:5.0.29-25 -IMAGE_BACKUP=percona/percona-backup-mongodb:2.6.0 +IMAGE_BACKUP=percona/percona-backup-mongodb:2.7.0 IMAGE_PMM_CLIENT=percona/pmm-client:2.43.2 IMAGE_PMM_SERVER=percona/pmm-server:2.43.2 From 4f218ca2edf83b103b08fd1704668e2b3e19df1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 3 Nov 2024 09:27:38 +0200 Subject: [PATCH 08/30] CLOUD-727: Bump github.com/cert-manager/cert-manager from 1.15.3 to 1.16.1 (#1677) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * CLOUD-727: Bump github.com/cert-manager/cert-manager Bumps [github.com/cert-manager/cert-manager](https://github.com/cert-manager/cert-manager) from 1.15.3 to 1.16.1. - [Release notes](https://github.com/cert-manager/cert-manager/releases) - [Changelog](https://github.com/cert-manager/cert-manager/blob/master/RELEASE.md) - [Commits](https://github.com/cert-manager/cert-manager/compare/v1.15.3...v1.16.1) --- updated-dependencies: - dependency-name: github.com/cert-manager/cert-manager dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * fix build * use cm 1.16.1 in tests * fix rbac --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ege Güneş --- deploy/bundle.yaml | 1 + deploy/cw-bundle.yaml | 1 + deploy/cw-rbac.yaml | 1 + deploy/rbac.yaml | 1 + e2e-tests/functions | 2 +- go.mod | 25 ++++++--- go.sum | 103 ++++++++++++++++++++++++++++------- pkg/psmdb/tls/certmanager.go | 2 +- 8 files changed, 105 insertions(+), 31 deletions(-) diff --git a/deploy/bundle.yaml b/deploy/bundle.yaml index 51389ecaa8..232944cd71 100644 --- a/deploy/bundle.yaml +++ b/deploy/bundle.yaml @@ -19634,6 +19634,7 @@ rules: resources: - issuers - certificates + - certificaterequests verbs: - get - list diff --git a/deploy/cw-bundle.yaml b/deploy/cw-bundle.yaml index f85f1736e4..4c46bc717d 100644 --- a/deploy/cw-bundle.yaml +++ b/deploy/cw-bundle.yaml @@ -19654,6 +19654,7 @@ rules: resources: - issuers - certificates + - certificaterequests verbs: - get - list diff --git a/deploy/cw-rbac.yaml b/deploy/cw-rbac.yaml index b874b3a7a3..a167ad7179 100644 --- a/deploy/cw-rbac.yaml +++ b/deploy/cw-rbac.yaml @@ -127,6 +127,7 @@ rules: resources: - issuers - certificates + - certificaterequests verbs: - get - list diff --git a/deploy/rbac.yaml b/deploy/rbac.yaml index a9f481e3d3..d71a7102ca 100644 --- a/deploy/rbac.yaml +++ b/deploy/rbac.yaml @@ -107,6 +107,7 @@ rules: resources: - issuers - certificates + - certificaterequests verbs: - get - list diff --git a/e2e-tests/functions b/e2e-tests/functions index dd813925a1..4e0b6bbbb8 100755 --- a/e2e-tests/functions +++ b/e2e-tests/functions @@ -16,7 +16,7 @@ SKIP_BACKUPS_TO_AWS_GCP_AZURE=${SKIP_BACKUPS_TO_AWS_GCP_AZURE:-1} PMM_SERVER_VER=${PMM_SERVER_VER:-"9.9.9"} IMAGE_PMM_CLIENT=${IMAGE_PMM_CLIENT:-"perconalab/pmm-client:dev-latest"} IMAGE_PMM_SERVER=${IMAGE_PMM_SERVER:-"perconalab/pmm-server:dev-latest"} -CERT_MANAGER_VER="1.15.3" +CERT_MANAGER_VER="1.16.1" tmp_dir=$(mktemp -d) sed=$(which gsed || which sed) date=$(which gdate || which date) diff --git a/go.mod b/go.mod index edab38d720..a1512862b4 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.6 require ( github.com/Percona-Lab/percona-version-service v0.0.0-20230216094301-f9489c81b52a github.com/alecthomas/kingpin v2.2.6+incompatible - github.com/cert-manager/cert-manager v1.15.3 + github.com/cert-manager/cert-manager v1.16.1 github.com/go-logr/logr v1.4.2 github.com/go-openapi/errors v0.22.0 github.com/go-openapi/runtime v0.28.0 @@ -32,14 +32,21 @@ require ( ) require ( + github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect + github.com/blang/semver/v4 v4.0.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-asn1-ber/asn1-ber v1.5.6 // indirect + github.com/go-ldap/ldap/v3 v3.4.8 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect github.com/x448/float16 v0.8.4 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect + k8s.io/component-base v0.31.1 // indirect ) require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.1 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect @@ -63,7 +70,7 @@ require ( github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect - github.com/google/go-cmp v0.6.0 // indirect + github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.1 // indirect @@ -96,9 +103,9 @@ require ( github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect - go.opentelemetry.io/otel v1.28.0 // indirect - go.opentelemetry.io/otel/metric v1.28.0 // indirect - go.opentelemetry.io/otel/trace v1.28.0 // indirect + go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel/metric v1.29.0 // indirect + go.opentelemetry.io/otel/trace v1.29.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.27.0 // indirect golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect @@ -110,8 +117,8 @@ require ( golang.org/x/text v0.18.0 // indirect golang.org/x/time v0.6.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 diff --git a/go.sum b/go.sum index 67621a9266..8d195480b0 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,12 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 h1:1nGuui+4POelzDwI7RG56yfQJHCnKvwfMoU7VsEp+Zg= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0/go.mod h1:99EvauvlcJ1U06amZiksfYz/3aFGyIhWGHVyiZXtBAI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 h1:U2rTu3Ef+7w9FHKIAXM6ZyqF3UOWJZ12zIm8zECAFfg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 h1:H+U3Gk9zY56G3u872L82bk4thcsy2Gghb9ExT4Zvm1o= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0/go.mod h1:mgrmMSgaLp9hmax62XQTd0N4aAqSE5E0DulSpVYK7vc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0/go.mod h1:T5RfihdXtBDxt1Ch2wobif3TvzTdumDy29kahv6AV9A= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.1 h1:fXPMAmuh0gDuRDey0atC8cXBuKIlqCzCkL8sm1n9Ov0= @@ -19,6 +19,8 @@ github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxB github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 h1:mFRzDkZVAjdal+s7s0MwaRv9igoPqLRdzOLzw/8Xvq8= +github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -41,6 +43,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 h1:ez/4by2iGztzR4L0zgAOR8lTQK9VlyBVVd7G4omaOQs= github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/alessio/shellescape v1.2.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= +github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa h1:LHTHcTQiSGT7VVbI0o4wBRNQIgn917usHWOd6VAffYI= +github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= @@ -57,9 +61,11 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cert-manager/cert-manager v1.15.3 h1:/u9T0griwd5MegPfWbB7v0KcVcT9OJrEvPNhc9tl7xQ= -github.com/cert-manager/cert-manager v1.15.3/go.mod h1:stBge/DTvrhfQMB/93+Y62s+gQgZBsfL1o0C/4AL/mI= +github.com/cert-manager/cert-manager v1.16.1 h1:1ceFMqTtwiqY2vyfaRT85CNiVmK7pJjt3GebYCx9awY= +github.com/cert-manager/cert-manager v1.16.1/go.mod h1:MfLVTL45hFZsqmaT1O0+b2ugaNNQQZttSFV9hASHUb0= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -78,6 +84,7 @@ github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -118,7 +125,12 @@ github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2H github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-asn1-ber/asn1-ber v1.5.5/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= +github.com/go-asn1-ber/asn1-ber v1.5.6 h1:CYsqysemXfEaQbyrLJmdsCRuufHoLa3P/gGWGl5TDrM= +github.com/go-asn1-ber/asn1-ber v1.5.6/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-ldap/ldap/v3 v3.4.8 h1:loKJyspcRezt2Q3ZRMq2p/0v8iOurlmeXDPw6fikSvQ= +github.com/go-ldap/ldap/v3 v3.4.8/go.mod h1:qS3Sjlu76eHfHGpUdWkAXQTw4beih+cHsco2jXlIXrk= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= @@ -256,6 +268,8 @@ github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1a github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= +github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= @@ -268,6 +282,9 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -280,6 +297,20 @@ github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= +github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= +github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= +github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= +github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg= +github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= +github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= +github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= +github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8= +github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= +github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= +github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= @@ -383,8 +414,6 @@ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYr github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/percona/percona-backup-mongodb v1.8.1-0.20240902083313-f2cf881c856b h1:NUFwRNs75xaz4mNaGnt5E6jb0eMWIgNOf9mriwrCAeQ= -github.com/percona/percona-backup-mongodb v1.8.1-0.20240902083313-f2cf881c856b/go.mod h1:KhIlTT4wR2mIkMvDtEFerr9zaADJorL7UThSztzxBaY= github.com/percona/percona-backup-mongodb v1.8.1-0.20241002124601-957ac501f939 h1:OggdqSzqe9pO3A4GaRlrLwZXS3zEQ84O4+7Jm9cg74s= github.com/percona/percona-backup-mongodb v1.8.1-0.20241002124601-957ac501f939/go.mod h1:KhIlTT4wR2mIkMvDtEFerr9zaADJorL7UThSztzxBaY= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= @@ -430,6 +459,7 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -446,6 +476,8 @@ github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -457,9 +489,14 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -493,14 +530,14 @@ go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM= go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= -go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= -go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= -go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= +go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= +go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= -go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= -go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= +go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -522,6 +559,9 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -534,6 +574,7 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -554,11 +595,17 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -574,6 +621,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -605,10 +653,18 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -618,6 +674,9 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -642,6 +701,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -659,10 +719,10 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed h1:3RgNmBoI9MZhsj3QxC+AP/qQhNwpCLOvYDYYsFrhFt0= +google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -706,6 +766,7 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= @@ -734,6 +795,8 @@ k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRV k8s.io/code-generator v0.18.4/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.18.4/go.mod h1:7jr/Ef5PGmKwQhyAz/pjByxJbC58mhKAhiaDu0vXfPk= +k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8= +k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= diff --git a/pkg/psmdb/tls/certmanager.go b/pkg/psmdb/tls/certmanager.go index bd6721859a..1c79ad1df2 100644 --- a/pkg/psmdb/tls/certmanager.go +++ b/pkg/psmdb/tls/certmanager.go @@ -230,7 +230,7 @@ var ( func (c *certManagerController) Check(ctx context.Context, config *rest.Config, ns string) error { log := logf.FromContext(ctx) - checker, err := cmapichecker.New(config, c.scheme, ns) + checker, err := cmapichecker.New(config, ns) if err != nil { return err } From 6c74eea93041a4dad16668f51235738837cd9cdf Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:52:28 +0200 Subject: [PATCH 09/30] Update percona/percona-server-mongodb:6.0.17-14 to percona/percona-server-mongodb:6.0.18-15 --- e2e-tests/release_images | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/release_images b/e2e-tests/release_images index 593f7485c7..a6d7d5e0ad 100644 --- a/e2e-tests/release_images +++ b/e2e-tests/release_images @@ -1,6 +1,6 @@ IMAGE_OPERATOR=percona/percona-server-mongodb-operator:1.18.0 IMAGE_MONGOD70=percona/percona-server-mongodb:7.0.14-8 -IMAGE_MONGOD60=percona/percona-server-mongodb:6.0.17-14 +IMAGE_MONGOD60=percona/percona-server-mongodb:6.0.18-15 IMAGE_MONGOD50=percona/percona-server-mongodb:5.0.29-25 IMAGE_BACKUP=percona/percona-backup-mongodb:2.7.0 IMAGE_PMM_CLIENT=percona/pmm-client:2.43.2 From 76b9ad229adb05c60bda38fd33bd207df9edd84c Mon Sep 17 00:00:00 2001 From: Inel Pandzic Date: Tue, 5 Nov 2024 14:32:44 +0100 Subject: [PATCH 10/30] K8SPSMDB-1124: Fix role update (#1702) * Fix role update. * Lint fix. --------- Co-authored-by: Viacheslav Sarzhan --- .../perconaservermongodb/custom_users.go | 23 +++++++++---------- pkg/psmdb/mongo/mongo.go | 12 +++++++++- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/pkg/controller/perconaservermongodb/custom_users.go b/pkg/controller/perconaservermongodb/custom_users.go index bd51a1ca12..d13b2afcea 100644 --- a/pkg/controller/perconaservermongodb/custom_users.go +++ b/pkg/controller/perconaservermongodb/custom_users.go @@ -47,10 +47,7 @@ func (r *ReconcilePerconaServerMongoDB) reconcileCustomUsers(ctx context.Context } }() - err = handleRoles(ctx, cr, cli) - if err != nil { - return errors.Wrap(err, "handle roles") - } + handleRoles(ctx, cr, cli) if len(cr.Spec.Users) == 0 { return nil @@ -127,28 +124,31 @@ func (r *ReconcilePerconaServerMongoDB) reconcileCustomUsers(ctx context.Context return nil } -func handleRoles(ctx context.Context, cr *api.PerconaServerMongoDB, cli mongo.Client) error { +func handleRoles(ctx context.Context, cr *api.PerconaServerMongoDB, cli mongo.Client) { log := logf.FromContext(ctx) if len(cr.Spec.Roles) == 0 { - return nil + return } for _, role := range cr.Spec.Roles { roleInfo, err := cli.GetRole(ctx, role.DB, role.Role) if err != nil { - return errors.Wrap(err, "mongo get role") + log.Error(err, "get role info", "role", role.Role) + continue } mr, err := toMongoRoleModel(role) if err != nil { - return err + log.Error(err, "to mongo role model", "role", role.Role) + continue } if roleInfo == nil { log.Info("Creating role", "role", role.Role) err := cli.CreateRole(ctx, role.DB, *mr) if err != nil { - return errors.Wrapf(err, "create role %s", role.Role) + log.Error(err, "create role", "role", role.Role) + continue } log.Info("Role created", "role", role.Role) continue @@ -158,13 +158,12 @@ func handleRoles(ctx context.Context, cr *api.PerconaServerMongoDB, cli mongo.Cl log.Info("Updating role", "role", role.Role) err := cli.UpdateRole(ctx, role.DB, *mr) if err != nil { - return errors.Wrapf(err, "update role %s", role.Role) + log.Error(err, "update role %s", role.Role) + continue } log.Info("Role updated", "role", role.Role) } } - - return nil } func rolesChanged(r1, r2 *mongo.Role) bool { diff --git a/pkg/psmdb/mongo/mongo.go b/pkg/psmdb/mongo/mongo.go index 90f4eb8d56..206dbb2483 100644 --- a/pkg/psmdb/mongo/mongo.go +++ b/pkg/psmdb/mongo/mongo.go @@ -225,7 +225,17 @@ func (client *mongoClient) UpdateRole(ctx context.Context, db string, role Role) authRestrictionsArr := bson.A{} for _, r := range role.AuthenticationRestrictions { - authRestrictionsArr = append(authRestrictionsArr, r) + m := bson.M{} + + if len(r.ServerAddress) > 0 { + m["serverAddress"] = r.ServerAddress + } + + if len(r.ClientSource) > 0 { + m["clientSource"] = r.ClientSource + } + + authRestrictionsArr = append(authRestrictionsArr, m) } m := bson.D{ From 2ade1ba8f538d56943ebf2f4da4fd7e3743e37fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20G=C3=BCne=C5=9F?= Date: Tue, 5 Nov 2024 22:14:44 +0300 Subject: [PATCH 11/30] K8SPSMDB-1180: Fix deleting old scheduled backups (#1705) Co-authored-by: Viacheslav Sarzhan --- e2e-tests/functions | 2 +- .../scheduled-backup/conf/some-name-rs0-2.yml | 5 +++ .../scheduled-backup/conf/some-name-rs0-3.yml | 1 + e2e-tests/scheduled-backup/run | 33 +++++++++++++++++-- pkg/controller/perconaservermongodb/backup.go | 4 +-- pkg/psmdb/backup/pbm.go | 2 +- 6 files changed, 41 insertions(+), 6 deletions(-) diff --git a/e2e-tests/functions b/e2e-tests/functions index 4e0b6bbbb8..db1e9d4c6d 100755 --- a/e2e-tests/functions +++ b/e2e-tests/functions @@ -342,7 +342,7 @@ wait_restore() { fi done echo - set -o xtrace + set_debug if [ $wait_cluster_consistency -eq 1 ]; then wait_cluster_consistency "${cluster_name}" diff --git a/e2e-tests/scheduled-backup/conf/some-name-rs0-2.yml b/e2e-tests/scheduled-backup/conf/some-name-rs0-2.yml index e4f485592b..0a71b455bf 100644 --- a/e2e-tests/scheduled-backup/conf/some-name-rs0-2.yml +++ b/e2e-tests/scheduled-backup/conf/some-name-rs0-2.yml @@ -48,26 +48,31 @@ spec: tasks: - name: every-min-minio enabled: true + keep: 1 schedule: "* * * * *" compressionType: gzip storageName: minio - name: every-min-aws-s3 enabled: true + keep: 1 schedule: "* * * * *" compressionType: gzip storageName: aws-s3 - name: every-min-gcp-cs enabled: true + keep: 1 schedule: "* * * * *" compressionType: gzip storageName: gcp-cs - name: every-min-azure-blob enabled: true + keep: 1 schedule: "* * * * *" compressionType: gzip storageName: azure-blob - name: weekly enabled: true + keep: 1 schedule: "0 0 * * 0" compressionType: gzip storageName: aws-s3 diff --git a/e2e-tests/scheduled-backup/conf/some-name-rs0-3.yml b/e2e-tests/scheduled-backup/conf/some-name-rs0-3.yml index c4cb9b6043..c0639d14fa 100644 --- a/e2e-tests/scheduled-backup/conf/some-name-rs0-3.yml +++ b/e2e-tests/scheduled-backup/conf/some-name-rs0-3.yml @@ -48,6 +48,7 @@ spec: tasks: - name: every-min-minio enabled: true + keep: 1 type: physical schedule: "* * * * *" compressionType: gzip diff --git a/e2e-tests/scheduled-backup/run b/e2e-tests/scheduled-backup/run index eee4225707..8cb5a463c8 100755 --- a/e2e-tests/scheduled-backup/run +++ b/e2e-tests/scheduled-backup/run @@ -18,6 +18,18 @@ unlabel_node() { kubectl_bin label nodes "${LABELED_NODE}" backupWorker- --overwrite } +check_backup_count() { + local ancestor=$1 + local expected=$2 + + local count=$(kubectl_bin get psmdb-backup -l percona.com/backup-ancestor=${ancestor} | grep ready | wc -l) + + if [[ ${count} != ${expected} ]]; then + echo "${ancestor}: Expected ${expected} backups but found ${count}." + exit 1 + fi +} + create_infra "$namespace" deploy_minio @@ -69,11 +81,13 @@ wait_backup_agent $cluster-0 wait_backup_agent $cluster-1 wait_backup_agent $cluster-2 -desc 'add backups schedule, wait for the first backup' +desc 'add backups schedule, wait for backups' apply_cluster "$test_dir/conf/$cluster-2.yml" sleep 55 +desc 'disable backups schedule' apply_cluster "$test_dir/conf/$cluster.yml" + if [ -z "$SKIP_BACKUPS_TO_AWS_GCP_AZURE" ]; then backup_name_aws=$(kubectl_bin get psmdb-backup | grep aws-s3 | awk '{print$1}' | head -1) backup_name_gcp=$(kubectl_bin get psmdb-backup | grep gcp-cs | awk '{print$1}' | head -1) @@ -88,6 +102,22 @@ wait_backup "$backup_name_minio" sleep 5 +echo -n "checking backup count for every-min-minio..." +check_backup_count every-min-minio 1 +echo "OK" + +echo -n "checking backup count for every-min-aws-s3..." +check_backup_count every-min-aws-s3 1 +echo "OK" + +echo -n "checking backup count for every-min-gcp-cs..." +check_backup_count every-min-gcp-cs 1 +echo "OK" + +echo -n "checking backup count for every-min-azure-blob..." +check_backup_count every-min-azure-blob 1 +echo "OK" + desc 'check backup and restore -- minio' backup_dest_minio=$(get_backup_dest "$backup_name_minio") kubectl_bin run -i --rm aws-cli --image=perconalab/awscli --restart=Never -- \ @@ -147,7 +177,6 @@ fi desc 'add physical backup schedule, wait for the first backup' apply_cluster "$test_dir/conf/$cluster-3.yml" - sleep 55 apply_cluster "$test_dir/conf/$cluster.yml" diff --git a/pkg/controller/perconaservermongodb/backup.go b/pkg/controller/perconaservermongodb/backup.go index 18687b33de..4aadd0681c 100644 --- a/pkg/controller/perconaservermongodb/backup.go +++ b/pkg/controller/perconaservermongodb/backup.go @@ -211,8 +211,8 @@ func (r *ReconcilePerconaServerMongoDB) oldScheduledBackups(ctx context.Context, &client.ListOptions{ Namespace: cr.Namespace, LabelSelector: labels.SelectorFromSet(map[string]string{ - "cluster": cr.Name, - "ancestor": ancestor, + naming.LabelCluster: cr.Name, + naming.LabelBackupAncestor: ancestor, }), }, ) diff --git a/pkg/psmdb/backup/pbm.go b/pkg/psmdb/backup/pbm.go index fc4b6de21e..84887634a7 100644 --- a/pkg/psmdb/backup/pbm.go +++ b/pkg/psmdb/backup/pbm.go @@ -428,7 +428,7 @@ func (b *pbmC) Conn() *mongo.Client { // by given storageName func (b *pbmC) GetNSetConfig(ctx context.Context, k8sclient client.Client, cluster *api.PerconaServerMongoDB, stg api.BackupStorageSpec) error { log := logf.FromContext(ctx) - log.Info("Setting PBM config", "backup", cluster.Name) + log.Info("Setting PBM config", "cluster", cluster.Name) conf, err := GetPBMConfig(ctx, k8sclient, cluster, stg) if err != nil { From c594e198481186ba4547005251d315dba4402b2c Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Wed, 6 Nov 2024 07:41:39 +0200 Subject: [PATCH 12/30] K8SPSMDB-1199 Automate Kubernetes Providers versions provisioning for Jenkins jobs (#1701) * added supported kubernetes providers versions * Update AKS_MAX version to 1.31 * trim the v from the Minikube version, like, e.g. v1.31.0 and then add it from within the pipeline itself * Update supported Kubernetes provider versions * reverting the file name back to release_versions, because we keep only versions in it * Update MINIKUBE version variable name to MINIKUBE_REL --- e2e-tests/{release_images => release_versions} | 9 +++++++++ 1 file changed, 9 insertions(+) rename e2e-tests/{release_images => release_versions} (72%) diff --git a/e2e-tests/release_images b/e2e-tests/release_versions similarity index 72% rename from e2e-tests/release_images rename to e2e-tests/release_versions index a6d7d5e0ad..92f6fb33a0 100644 --- a/e2e-tests/release_images +++ b/e2e-tests/release_versions @@ -5,3 +5,12 @@ IMAGE_MONGOD50=percona/percona-server-mongodb:5.0.29-25 IMAGE_BACKUP=percona/percona-backup-mongodb:2.7.0 IMAGE_PMM_CLIENT=percona/pmm-client:2.43.2 IMAGE_PMM_SERVER=percona/pmm-server:2.43.2 +GKE_MIN=1.28 +GKE_MAX=1.30 +EKS_MIN=1.28 +EKS_MAX=1.31 +AKS_MIN=1.28 +AKS_MAX=1.31 +OPENSHIFT_MIN=4.13.52 +OPENSHIFT_MAX=4.17.3 +MINIKUBE_REL=1.31.0 \ No newline at end of file From 419d1b66960d6b94813e51fbc300b63f95fe12fe Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:08:44 +0200 Subject: [PATCH 13/30] mullti arch support for the database image --- deploy/cr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/cr.yaml b/deploy/cr.yaml index 926c7fc404..81d22f468e 100644 --- a/deploy/cr.yaml +++ b/deploy/cr.yaml @@ -14,7 +14,7 @@ spec: # unmanaged: false # enableVolumeExpansion: true crVersion: 1.18.0 - image: percona/percona-server-mongodb:7.0.14-8 + image: percona/percona-server-mongodb:7.0.14-8-multi imagePullPolicy: Always # tls: # mode: preferTLS From badcbc6fc9c8c590e73f98ab757c9ec7cf2b7935 Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:36:47 +0200 Subject: [PATCH 14/30] adding support for-multi arch image for PMM client --- deploy/cr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/cr.yaml b/deploy/cr.yaml index 81d22f468e..e2582ec037 100644 --- a/deploy/cr.yaml +++ b/deploy/cr.yaml @@ -51,7 +51,7 @@ spec: secrets: users: my-cluster-name-secrets encryptionKey: my-cluster-name-mongodb-encryption-key -# keyFile: my-cluster-name-mongodb-keyfile + keyFile: my-cluster-name-mongodb-keyfile # vault: my-cluster-name-vault # ldapSecret: my-ldap-secret # sse: my-cluster-name-sse @@ -608,7 +608,7 @@ spec: backup: enabled: true - image: percona/percona-backup-mongodb:2.7.0 + image: percona/percona-backup-mongodb:2.7.0-multi # annotations: # iam.amazonaws.com/role: role-arn # resources: From 8eba3139de31d94e568a0d8279ae9889c02280db Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:44:14 +0200 Subject: [PATCH 15/30] Remove commented out keyFile line in deploy/cr.yaml --- deploy/cr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/cr.yaml b/deploy/cr.yaml index e2582ec037..6dd81c33a8 100644 --- a/deploy/cr.yaml +++ b/deploy/cr.yaml @@ -51,7 +51,7 @@ spec: secrets: users: my-cluster-name-secrets encryptionKey: my-cluster-name-mongodb-encryption-key - keyFile: my-cluster-name-mongodb-keyfile +# keyFile: my-cluster-name-mongodb-keyfile # vault: my-cluster-name-vault # ldapSecret: my-ldap-secret # sse: my-cluster-name-sse From 43fe2ad574be4ba5a8f953ee090284a35a72c037 Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Wed, 6 Nov 2024 21:26:42 +0200 Subject: [PATCH 16/30] Update MongoDB image tags to include multi-architecture support --- e2e-tests/release_versions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e-tests/release_versions b/e2e-tests/release_versions index 92f6fb33a0..a0285dc0f0 100644 --- a/e2e-tests/release_versions +++ b/e2e-tests/release_versions @@ -1,8 +1,8 @@ IMAGE_OPERATOR=percona/percona-server-mongodb-operator:1.18.0 -IMAGE_MONGOD70=percona/percona-server-mongodb:7.0.14-8 -IMAGE_MONGOD60=percona/percona-server-mongodb:6.0.18-15 -IMAGE_MONGOD50=percona/percona-server-mongodb:5.0.29-25 -IMAGE_BACKUP=percona/percona-backup-mongodb:2.7.0 +IMAGE_MONGOD70=percona/percona-server-mongodb:7.0.14-8-multi +IMAGE_MONGOD60=percona/percona-server-mongodb:6.0.18-15-multi +IMAGE_MONGOD50=percona/percona-server-mongodb:5.0.29-25-multi +IMAGE_BACKUP=percona/percona-backup-mongodb:2.7.0-multi IMAGE_PMM_CLIENT=percona/pmm-client:2.43.2 IMAGE_PMM_SERVER=percona/pmm-server:2.43.2 GKE_MIN=1.28 From 29c869ce88f6d67d76a55d8f059f4579718099f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20G=C3=BCne=C5=9F?= Date: Fri, 8 Nov 2024 22:50:37 +0300 Subject: [PATCH 17/30] Wait for resync to finish after physical restore in tests (#1709) --- e2e-tests/demand-backup-physical-sharded/run | 5 +++-- e2e-tests/demand-backup-physical/run | 5 +---- e2e-tests/functions | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/e2e-tests/demand-backup-physical-sharded/run b/e2e-tests/demand-backup-physical-sharded/run index c7c8dcabe5..1ae02ff797 100755 --- a/e2e-tests/demand-backup-physical-sharded/run +++ b/e2e-tests/demand-backup-physical-sharded/run @@ -42,10 +42,11 @@ run_recovery_check() { exit 1 fi echo + wait_cluster_consistency ${cluster} 42 + wait_for_pbm_operations ${cluster} + compare_mongos_cmd "find" "myApp:myPass@${cluster}-mongos.${namespace}" "-sharded" - echo - set -o xtrace } check_exported_mongos_service_endpoint() { diff --git a/e2e-tests/demand-backup-physical/run b/e2e-tests/demand-backup-physical/run index 853468d29c..2c1a1cbedc 100755 --- a/e2e-tests/demand-backup-physical/run +++ b/e2e-tests/demand-backup-physical/run @@ -37,7 +37,6 @@ run_recovery_check() { # we don't wait for cluster readiness here because the annotation gets removed then wait_restore "${backup_name}" "${cluster}" "ready" "0" "1800" - kubectl_bin get psmdb ${cluster} -o yaml if [ $(kubectl_bin get psmdb ${cluster} -o yaml | yq '.metadata.annotations."percona.com/resync-pbm"') == null ]; then echo "psmdb/${cluster} should be annotated with percona.com/resync-pbm after a physical restore" exit 1 @@ -45,13 +44,11 @@ run_recovery_check() { echo wait_cluster_consistency ${cluster} + wait_for_pbm_operations ${cluster} compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-0.${cluster}-rs0.${namespace}" compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-1.${cluster}-rs0.${namespace}" compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-2.${cluster}-rs0.${namespace}" - - echo - set -o xtrace } create_infra "${namespace}" diff --git a/e2e-tests/functions b/e2e-tests/functions index db1e9d4c6d..d8dde927b5 100755 --- a/e2e-tests/functions +++ b/e2e-tests/functions @@ -239,6 +239,25 @@ wait_backup() { set_debug } +wait_for_pbm_operations() { + local cluster=$1 + + set +o xtrace + echo -n "waiting for PBM operation to finish" + retry=0 + until [[ $(kubectl_bin exec ${cluster}-rs0-0 -c backup-agent -- pbm status -o json -s running | jq -r .running.opID) == null ]]; do + if [ $retry -ge 540 ]; then + echo max retry count $retry reached. something went wrong with PBM operations + exit 1 + fi + echo -n . + sleep 5 + done + echo + set_debug +} + + run_restore() { local backup_name=$1 From 925d2dc50fc57738c04b7650bf1a781c5508ec98 Mon Sep 17 00:00:00 2001 From: Eleonora Zinchenko Date: Sat, 9 Nov 2024 01:00:54 +0200 Subject: [PATCH 18/30] Fix tests --- e2e-tests/data-at-rest-encryption/run | 2 +- e2e-tests/demand-backup-physical-sharded/run | 2 +- e2e-tests/pvc-resize/run | 5 + .../compare/statefulset_mydb-rs0-oc.yml | 217 ++++++++++++++++++ 4 files changed, 224 insertions(+), 2 deletions(-) create mode 100644 e2e-tests/serviceless-external-nodes/compare/statefulset_mydb-rs0-oc.yml diff --git a/e2e-tests/data-at-rest-encryption/run b/e2e-tests/data-at-rest-encryption/run index ff2c08b65d..f2417301e9 100755 --- a/e2e-tests/data-at-rest-encryption/run +++ b/e2e-tests/data-at-rest-encryption/run @@ -57,7 +57,7 @@ sleep 5 desc "check backup and restore -- minio" backup_dest_minio=$(get_backup_dest "$backup_name_minio") -kubectl_bin run -i --rm aws-cli --image=perconalab/awscli --restart=Never -- \ +retry 3 5 kubectl_bin run -i --rm aws-cli --image=perconalab/awscli --restart=Never -- \ /usr/bin/env AWS_ACCESS_KEY_ID=some-access-key AWS_SECRET_ACCESS_KEY=some-secret-key AWS_DEFAULT_REGION=us-east-1 \ /usr/bin/aws --endpoint-url http://minio-service:9000 s3 ls s3://${backup_dest_minio}/rs0/ \ | grep myApp.test.gz diff --git a/e2e-tests/demand-backup-physical-sharded/run b/e2e-tests/demand-backup-physical-sharded/run index 1ae02ff797..e9dc5e8d0c 100755 --- a/e2e-tests/demand-backup-physical-sharded/run +++ b/e2e-tests/demand-backup-physical-sharded/run @@ -29,7 +29,7 @@ run_recovery_check() { local backup_name=$1 local compare_suffix=${2:-"_restore"} - wait_restore "${backup_name}" "${cluster}" "requested" "0" "1200" + wait_restore "${backup_name}" "${cluster}" "requested" "0" "1800" echo compare_kubectl "statefulset/${cluster}-rs0" ${compare_suffix} diff --git a/e2e-tests/pvc-resize/run b/e2e-tests/pvc-resize/run index 47e3f088aa..7689e35f48 100755 --- a/e2e-tests/pvc-resize/run +++ b/e2e-tests/pvc-resize/run @@ -157,6 +157,11 @@ if [[ $EKS == 1 || -n ${OPENSHIFT} ]]; then else spinup_psmdb "${cluster}-rs0" "$test_dir/conf/$cluster.yml" fi + echo "Enabling PVC resize after recreating PSMDB cluster ${cluster} " + kubectl_bin patch psmdb "${cluster}" --type=json -p='[{"op": "add", "path": "/spec/enableVolumeExpansion", "value":true }]' + sleep 10 + + wait_cluster_consistency "$cluster" fi desc 'create resourcequota' diff --git a/e2e-tests/serviceless-external-nodes/compare/statefulset_mydb-rs0-oc.yml b/e2e-tests/serviceless-external-nodes/compare/statefulset_mydb-rs0-oc.yml new file mode 100644 index 0000000000..8ec308dcd1 --- /dev/null +++ b/e2e-tests/serviceless-external-nodes/compare/statefulset_mydb-rs0-oc.yml @@ -0,0 +1,217 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + annotations: {} + generation: 1 + labels: + app.kubernetes.io/component: mongod + app.kubernetes.io/instance: mydb + app.kubernetes.io/managed-by: percona-server-mongodb-operator + app.kubernetes.io/name: percona-server-mongodb + app.kubernetes.io/part-of: percona-server-mongodb + app.kubernetes.io/replset: rs0 + name: mydb-rs0 + ownerReferences: + - controller: true + kind: PerconaServerMongoDB + name: mydb +spec: + podManagementPolicy: OrderedReady + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/component: mongod + app.kubernetes.io/instance: mydb + app.kubernetes.io/managed-by: percona-server-mongodb-operator + app.kubernetes.io/name: percona-server-mongodb + app.kubernetes.io/part-of: percona-server-mongodb + app.kubernetes.io/replset: rs0 + serviceName: mydb-rs0 + template: + metadata: + annotations: {} + labels: + app.kubernetes.io/component: mongod + app.kubernetes.io/instance: mydb + app.kubernetes.io/managed-by: percona-server-mongodb-operator + app.kubernetes.io/name: percona-server-mongodb + app.kubernetes.io/part-of: percona-server-mongodb + app.kubernetes.io/replset: rs0 + spec: + containers: + - args: + - --bind_ip_all + - --auth + - --dbpath=/data/db + - --port=27017 + - --replSet=rs0 + - --storageEngine=wiredTiger + - --relaxPermChecks + - --sslAllowInvalidCertificates + - --clusterAuthMode=keyFile + - --keyFile=/etc/mongodb-secrets/mongodb-key + - --tlsMode=allowTLS + - --enableEncryption + - --encryptionKeyFile=/etc/mongodb-encryption/encryption-key + - --wiredTigerCacheSizeGB=0.25 + - --wiredTigerIndexPrefixCompression=true + - --config=/etc/mongodb-config/mongod.conf + - --quiet + command: + - /opt/percona/ps-entry.sh + env: + - name: SERVICE_NAME + value: mydb + - name: MONGODB_PORT + value: "27017" + - name: MONGODB_REPLSET + value: rs0 + envFrom: + - secretRef: + name: internal-mydb-users + optional: false + imagePullPolicy: Always + livenessProbe: + exec: + command: + - /opt/percona/mongodb-healthcheck + - k8s + - liveness + - --ssl + - --sslInsecure + - --sslCAFile + - /etc/mongodb-ssl/ca.crt + - --sslPEMKeyFile + - /tmp/tls.pem + - --startupDelaySeconds + - "7200" + failureThreshold: 4 + initialDelaySeconds: 60 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 10 + name: mongod + ports: + - containerPort: 27017 + name: mongodb + protocol: TCP + readinessProbe: + exec: + command: + - /opt/percona/mongodb-healthcheck + - k8s + - readiness + - --component + - mongod + failureThreshold: 8 + initialDelaySeconds: 10 + periodSeconds: 3 + successThreshold: 1 + timeoutSeconds: 2 + resources: + limits: + cpu: 300m + memory: 500M + requests: + cpu: 300m + memory: 500M + securityContext: + runAsNonRoot: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /data/db + name: mongod-data + - mountPath: /etc/mongodb-secrets + name: mydb-custom-mongodb-keyfile + readOnly: true + - mountPath: /etc/mongodb-ssl + name: ssl + readOnly: true + - mountPath: /etc/mongodb-ssl-internal + name: ssl-internal + readOnly: true + - mountPath: /etc/mongodb-config + name: config + - mountPath: /opt/percona + name: bin + - mountPath: /etc/mongodb-encryption + name: mydb-custom-encryption-key + readOnly: true + - mountPath: /etc/users-secret + name: users-secret-file + workingDir: /data/db + dnsPolicy: ClusterFirst + initContainers: + - command: + - /init-entrypoint.sh + imagePullPolicy: Always + name: mongo-init + resources: + limits: + cpu: 300m + memory: 500M + requests: + cpu: 300m + memory: 500M + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /data/db + name: mongod-data + - mountPath: /opt/percona + name: bin + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + serviceAccount: default + serviceAccountName: default + terminationGracePeriodSeconds: 60 + volumes: + - name: mydb-custom-mongodb-keyfile + secret: + defaultMode: 288 + optional: false + secretName: mydb-custom-mongodb-keyfile + - emptyDir: {} + name: bin + - configMap: + defaultMode: 420 + name: mydb-rs0-mongod + optional: true + name: config + - name: mydb-custom-encryption-key + secret: + defaultMode: 288 + optional: false + secretName: mydb-custom-encryption-key + - name: ssl + secret: + defaultMode: 288 + optional: false + secretName: mydb-custom-ssl + - name: ssl-internal + secret: + defaultMode: 288 + optional: true + secretName: mydb-custom-ssl-internal + - name: users-secret-file + secret: + defaultMode: 420 + secretName: internal-mydb-users + updateStrategy: + rollingUpdate: + partition: 0 + type: RollingUpdate + volumeClaimTemplates: + - metadata: + name: mongod-data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 3Gi + status: + phase: Pending From 4bdff26c51bfd4d97a7148359437e359d7b17b59 Mon Sep 17 00:00:00 2001 From: Eleonora Zinchenko Date: Sat, 9 Nov 2024 21:45:39 +0200 Subject: [PATCH 19/30] Get only secrets for the psmdb cluster, skip others --- e2e-tests/serviceless-external-nodes/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e-tests/serviceless-external-nodes/run b/e2e-tests/serviceless-external-nodes/run index 2d87c765bf..b7a1272737 100755 --- a/e2e-tests/serviceless-external-nodes/run +++ b/e2e-tests/serviceless-external-nodes/run @@ -22,7 +22,7 @@ apply_cluster "$test_dir/conf/main.yml" wait_for_running "$cluster-rs0" 1 compare_kubectl statefulset/mydb-rs0 -secrets_count=$(kubectl_bin get secret -o yaml | yq '.items | length') +secrets_count=$(kubectl_bin get secret -o json | jq --arg pattern "$cluster" '[.items[] | select(.metadata.name | test($pattern))] | length') if [[ $secrets_count != 6 ]]; then echo "It's expected to have 6 secrets. Currently have $secrets_count" exit 1 @@ -41,7 +41,7 @@ apply_cluster "$test_dir/conf/external.yml" wait_pod ${cluster}-rs0-0 wait_pod ${cluster}-rs0-1 -secrets_count=$(kubectl_bin get secret -o yaml | yq '.items | length') +secrets_count=$(kubectl_bin get secret -o json | jq --arg pattern "$cluster" '[.items[] | select(.metadata.name | test($pattern))] | length') if [[ $secrets_count != 6 ]]; then echo "It's expected to have 6 secrets. Currently have $secrets_count" exit 1 From 6d65a7d102945ea6a2a25598bdd40c0e2c9d730e Mon Sep 17 00:00:00 2001 From: Eleonora Zinchenko Date: Mon, 11 Nov 2024 11:45:09 +0200 Subject: [PATCH 20/30] Increase timeouts for backup job --- e2e-tests/demand-backup-physical-sharded/run | 4 ++-- e2e-tests/demand-backup-physical/run | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e-tests/demand-backup-physical-sharded/run b/e2e-tests/demand-backup-physical-sharded/run index e9dc5e8d0c..4cfb61bc15 100755 --- a/e2e-tests/demand-backup-physical-sharded/run +++ b/e2e-tests/demand-backup-physical-sharded/run @@ -29,13 +29,13 @@ run_recovery_check() { local backup_name=$1 local compare_suffix=${2:-"_restore"} - wait_restore "${backup_name}" "${cluster}" "requested" "0" "1800" + wait_restore "${backup_name}" "${cluster}" "requested" "0" "3000" echo compare_kubectl "statefulset/${cluster}-rs0" ${compare_suffix} # we don't wait for cluster readiness here because the annotation gets removed then - wait_restore "${backup_name}" "${cluster}" "ready" "0" "1800" + wait_restore "${backup_name}" "${cluster}" "ready" "0" "3000" kubectl_bin get psmdb ${cluster} -o yaml if [ $(kubectl_bin get psmdb ${cluster} -o yaml | yq '.metadata.annotations."percona.com/resync-pbm"') == null ]; then echo "psmdb/${cluster} should be annotated with percona.com/resync-pbm after a physical restore" diff --git a/e2e-tests/demand-backup-physical/run b/e2e-tests/demand-backup-physical/run index 2c1a1cbedc..60047b14b0 100755 --- a/e2e-tests/demand-backup-physical/run +++ b/e2e-tests/demand-backup-physical/run @@ -29,13 +29,13 @@ run_recovery_check() { local backup_name=$1 local compare_suffix=${2:-"_restore"} - wait_restore "${backup_name}" "${cluster}" "requested" "0" "1200" + wait_restore "${backup_name}" "${cluster}" "requested" "0" "3000" echo compare_kubectl "statefulset/${cluster}-rs0" ${compare_suffix} # we don't wait for cluster readiness here because the annotation gets removed then - wait_restore "${backup_name}" "${cluster}" "ready" "0" "1800" + wait_restore "${backup_name}" "${cluster}" "ready" "0" "3000" if [ $(kubectl_bin get psmdb ${cluster} -o yaml | yq '.metadata.annotations."percona.com/resync-pbm"') == null ]; then echo "psmdb/${cluster} should be annotated with percona.com/resync-pbm after a physical restore" From 42a6fbedc1c87ff07d8a46bc25e8ac126733473b Mon Sep 17 00:00:00 2001 From: Eleonora Zinchenko Date: Mon, 11 Nov 2024 18:17:29 +0200 Subject: [PATCH 21/30] Increase sleep for ignore-labels-annotations --- e2e-tests/ignore-labels-annotations/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e-tests/ignore-labels-annotations/run b/e2e-tests/ignore-labels-annotations/run index 9c6666107a..ffda3d1151 100755 --- a/e2e-tests/ignore-labels-annotations/run +++ b/e2e-tests/ignore-labels-annotations/run @@ -61,7 +61,7 @@ check_service() { } }]' - sleep 5 # waiting for reconcile + sleep 7 # waiting for reconcile desc "check if annotations/labels are not deleted from service $svc_name" compare_kubectl "service/$svc_name" "-manual" @@ -78,7 +78,7 @@ check_service() { "value": ["ignoredLabel"] } ]' - sleep 5 + sleep 7 desc "check if annotations/labels are not deleted from service $svc_name" compare_kubectl "service/$svc_name" "-manual" From cd57039593af66c46f5111fdb978f02b7f4fc4a4 Mon Sep 17 00:00:00 2001 From: Eleonora Zinchenko Date: Tue, 12 Nov 2024 12:44:33 +0200 Subject: [PATCH 22/30] Fix data-at-rest-encryption: increate retry time --- e2e-tests/data-at-rest-encryption/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/data-at-rest-encryption/run b/e2e-tests/data-at-rest-encryption/run index f2417301e9..44982a0247 100755 --- a/e2e-tests/data-at-rest-encryption/run +++ b/e2e-tests/data-at-rest-encryption/run @@ -57,7 +57,7 @@ sleep 5 desc "check backup and restore -- minio" backup_dest_minio=$(get_backup_dest "$backup_name_minio") -retry 3 5 kubectl_bin run -i --rm aws-cli --image=perconalab/awscli --restart=Never -- \ +retry 3 8 kubectl_bin run -i --rm aws-cli --image=perconalab/awscli --restart=Never -- \ /usr/bin/env AWS_ACCESS_KEY_ID=some-access-key AWS_SECRET_ACCESS_KEY=some-secret-key AWS_DEFAULT_REGION=us-east-1 \ /usr/bin/aws --endpoint-url http://minio-service:9000 s3 ls s3://${backup_dest_minio}/rs0/ \ | grep myApp.test.gz From fe23787346b0eddcf36e045db72db7e6e3d71e9e Mon Sep 17 00:00:00 2001 From: Eleonora Zinchenko Date: Tue, 12 Nov 2024 19:23:33 +0200 Subject: [PATCH 23/30] Custom roles: remove listSearchIndexes for 50 psmdb --- .../compare/role-one-50.json | 122 ++++++++++++++++++ .../compare/role-two-50.json | 78 +++++++++++ e2e-tests/custom-users-roles-sharded/run | 4 + .../compare/role-one-50.json | 122 ++++++++++++++++++ .../compare/role-two-50.json | 78 +++++++++++ e2e-tests/custom-users-roles/run | 4 + 6 files changed, 408 insertions(+) create mode 100644 e2e-tests/custom-users-roles-sharded/compare/role-one-50.json create mode 100644 e2e-tests/custom-users-roles-sharded/compare/role-two-50.json create mode 100644 e2e-tests/custom-users-roles/compare/role-one-50.json create mode 100644 e2e-tests/custom-users-roles/compare/role-two-50.json diff --git a/e2e-tests/custom-users-roles-sharded/compare/role-one-50.json b/e2e-tests/custom-users-roles-sharded/compare/role-one-50.json new file mode 100644 index 0000000000..3d66df219e --- /dev/null +++ b/e2e-tests/custom-users-roles-sharded/compare/role-one-50.json @@ -0,0 +1,122 @@ +switched to db admin +{ + "_id" : "admin.role-one", + "role" : "role-one", + "db" : "admin", + "privileges" : [ + { + "resource" : { + "cluster" : true + }, + "actions" : [ + "addShard" + ] + }, + { + "resource" : { + "db" : "config", + "collection" : "" + }, + "actions" : [ + "find", + "insert", + "remove", + "update" + ] + } + ], + "roles" : [ + { + "role" : "read", + "db" : "admin" + } + ], + "authenticationRestrictions" : [ + [ + { + "clientSource" : [ + "127.0.0.1" + ], + "serverAddress" : [ + "127.0.0.1" + ] + } + ] + ], + "inheritedRoles" : [ + { + "role" : "read", + "db" : "admin" + } + ], + "inheritedPrivileges" : [ + { + "resource" : { + "cluster" : true + }, + "actions" : [ + "addShard" + ] + }, + { + "resource" : { + "db" : "config", + "collection" : "" + }, + "actions" : [ + "find", + "insert", + "remove", + "update" + ] + }, + { + "resource" : { + "db" : "admin", + "collection" : "" + }, + "actions" : [ + "changeStream", + "collStats", + "dbHash", + "dbStats", + "find", + "killCursors", + "listCollections", + "listIndexes", + "planCacheRead" + ] + }, + { + "resource" : { + "db" : "admin", + "collection" : "system.js" + }, + "actions" : [ + "changeStream", + "collStats", + "dbHash", + "dbStats", + "find", + "killCursors", + "listCollections", + "listIndexes", + "planCacheRead" + ] + } + ], + "inheritedAuthenticationRestrictions" : [ + [ + { + "clientSource" : [ + "127.0.0.1" + ], + "serverAddress" : [ + "127.0.0.1" + ] + } + ] + ], + "isBuiltin" : false +} +bye diff --git a/e2e-tests/custom-users-roles-sharded/compare/role-two-50.json b/e2e-tests/custom-users-roles-sharded/compare/role-two-50.json new file mode 100644 index 0000000000..d8bf5f535d --- /dev/null +++ b/e2e-tests/custom-users-roles-sharded/compare/role-two-50.json @@ -0,0 +1,78 @@ +switched to db admin +{ + "_id" : "admin.role-two", + "role" : "role-two", + "db" : "admin", + "privileges" : [ + { + "resource" : { + "db" : "config", + "collection" : "" + }, + "actions" : [ + "find" + ] + } + ], + "roles" : [ + { + "role" : "read", + "db" : "admin" + } + ], + "authenticationRestrictions" : [ ], + "inheritedRoles" : [ + { + "role" : "read", + "db" : "admin" + } + ], + "inheritedPrivileges" : [ + { + "resource" : { + "db" : "config", + "collection" : "" + }, + "actions" : [ + "find" + ] + }, + { + "resource" : { + "db" : "admin", + "collection" : "" + }, + "actions" : [ + "changeStream", + "collStats", + "dbHash", + "dbStats", + "find", + "killCursors", + "listCollections", + "listIndexes", + "planCacheRead" + ] + }, + { + "resource" : { + "db" : "admin", + "collection" : "system.js" + }, + "actions" : [ + "changeStream", + "collStats", + "dbHash", + "dbStats", + "find", + "killCursors", + "listCollections", + "listIndexes", + "planCacheRead" + ] + } + ], + "inheritedAuthenticationRestrictions" : [ ], + "isBuiltin" : false +} +bye diff --git a/e2e-tests/custom-users-roles-sharded/run b/e2e-tests/custom-users-roles-sharded/run index 78f8114bd0..22025b0854 100755 --- a/e2e-tests/custom-users-roles-sharded/run +++ b/e2e-tests/custom-users-roles-sharded/run @@ -8,6 +8,10 @@ compare() { local uri="$3" local target="$4" + if [[ $IMAGE_MONGOD =~ 5\.0 ]] && [ -f ${test_dir}/compare/$target-50.json ]; then + target=$target-50 + fi + run_mongos "use ${database}\n ${command}" "$uri" "mongodb" \ | egrep -v 'I NETWORK|W NETWORK|F NETWORK|Error saving history file|Percona Server for MongoDB|connecting to:|Unable to reach primary for set|Implicit session:|versions do not match|Error saving history file:' \ | $sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' \ diff --git a/e2e-tests/custom-users-roles/compare/role-one-50.json b/e2e-tests/custom-users-roles/compare/role-one-50.json new file mode 100644 index 0000000000..3d66df219e --- /dev/null +++ b/e2e-tests/custom-users-roles/compare/role-one-50.json @@ -0,0 +1,122 @@ +switched to db admin +{ + "_id" : "admin.role-one", + "role" : "role-one", + "db" : "admin", + "privileges" : [ + { + "resource" : { + "cluster" : true + }, + "actions" : [ + "addShard" + ] + }, + { + "resource" : { + "db" : "config", + "collection" : "" + }, + "actions" : [ + "find", + "insert", + "remove", + "update" + ] + } + ], + "roles" : [ + { + "role" : "read", + "db" : "admin" + } + ], + "authenticationRestrictions" : [ + [ + { + "clientSource" : [ + "127.0.0.1" + ], + "serverAddress" : [ + "127.0.0.1" + ] + } + ] + ], + "inheritedRoles" : [ + { + "role" : "read", + "db" : "admin" + } + ], + "inheritedPrivileges" : [ + { + "resource" : { + "cluster" : true + }, + "actions" : [ + "addShard" + ] + }, + { + "resource" : { + "db" : "config", + "collection" : "" + }, + "actions" : [ + "find", + "insert", + "remove", + "update" + ] + }, + { + "resource" : { + "db" : "admin", + "collection" : "" + }, + "actions" : [ + "changeStream", + "collStats", + "dbHash", + "dbStats", + "find", + "killCursors", + "listCollections", + "listIndexes", + "planCacheRead" + ] + }, + { + "resource" : { + "db" : "admin", + "collection" : "system.js" + }, + "actions" : [ + "changeStream", + "collStats", + "dbHash", + "dbStats", + "find", + "killCursors", + "listCollections", + "listIndexes", + "planCacheRead" + ] + } + ], + "inheritedAuthenticationRestrictions" : [ + [ + { + "clientSource" : [ + "127.0.0.1" + ], + "serverAddress" : [ + "127.0.0.1" + ] + } + ] + ], + "isBuiltin" : false +} +bye diff --git a/e2e-tests/custom-users-roles/compare/role-two-50.json b/e2e-tests/custom-users-roles/compare/role-two-50.json new file mode 100644 index 0000000000..d8bf5f535d --- /dev/null +++ b/e2e-tests/custom-users-roles/compare/role-two-50.json @@ -0,0 +1,78 @@ +switched to db admin +{ + "_id" : "admin.role-two", + "role" : "role-two", + "db" : "admin", + "privileges" : [ + { + "resource" : { + "db" : "config", + "collection" : "" + }, + "actions" : [ + "find" + ] + } + ], + "roles" : [ + { + "role" : "read", + "db" : "admin" + } + ], + "authenticationRestrictions" : [ ], + "inheritedRoles" : [ + { + "role" : "read", + "db" : "admin" + } + ], + "inheritedPrivileges" : [ + { + "resource" : { + "db" : "config", + "collection" : "" + }, + "actions" : [ + "find" + ] + }, + { + "resource" : { + "db" : "admin", + "collection" : "" + }, + "actions" : [ + "changeStream", + "collStats", + "dbHash", + "dbStats", + "find", + "killCursors", + "listCollections", + "listIndexes", + "planCacheRead" + ] + }, + { + "resource" : { + "db" : "admin", + "collection" : "system.js" + }, + "actions" : [ + "changeStream", + "collStats", + "dbHash", + "dbStats", + "find", + "killCursors", + "listCollections", + "listIndexes", + "planCacheRead" + ] + } + ], + "inheritedAuthenticationRestrictions" : [ ], + "isBuiltin" : false +} +bye diff --git a/e2e-tests/custom-users-roles/run b/e2e-tests/custom-users-roles/run index 92dc628aaf..965db48b65 100755 --- a/e2e-tests/custom-users-roles/run +++ b/e2e-tests/custom-users-roles/run @@ -8,6 +8,10 @@ compare() { local uri="$3" local target="$4" + if [[ $IMAGE_MONGOD =~ 5\.0 ]] && [ -f ${test_dir}/compare/$target-50.json ]; then + target=$target-50 + fi + run_mongo "use ${database}\n ${command}" "$uri" "mongodb" \ | egrep -v 'I NETWORK|W NETWORK|F NETWORK|Error saving history file|Percona Server for MongoDB|connecting to:|Unable to reach primary for set|Implicit session:|versions do not match|Error saving history file:' \ | $sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' \ From 6531eee99b8c175cddbc66dd6f58b749052626c7 Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:02:11 +0200 Subject: [PATCH 24/30] Update image tag for minimal cluster to use multi version --- deploy/cr-minimal.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/cr-minimal.yaml b/deploy/cr-minimal.yaml index 9782641eb3..32d4601911 100644 --- a/deploy/cr-minimal.yaml +++ b/deploy/cr-minimal.yaml @@ -4,7 +4,7 @@ metadata: name: minimal-cluster spec: crVersion: 1.18.0 - image: percona/percona-server-mongodb:7.0.14-8 + image: percona/percona-server-mongodb:7.0.14-8-multi unsafeFlags: replsetSize: true mongosSize: true From b4a32ddfd3d87281423b7e81f44844c2964bd9ed Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:18:53 +0200 Subject: [PATCH 25/30] updating for 1.19.0 --- e2e-tests/upgrade-consistency/run | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/e2e-tests/upgrade-consistency/run b/e2e-tests/upgrade-consistency/run index fcd87a6fb6..b2021a2184 100755 --- a/e2e-tests/upgrade-consistency/run +++ b/e2e-tests/upgrade-consistency/run @@ -12,22 +12,21 @@ main() { create_infra $namespace desc 'create secrets and start client' - kubectl_bin apply -f "${conf_dir}/client.yml" \ - -f "${conf_dir}/secrets.yml" + kubectl_bin apply -f "${conf_dir}/client.yml" -f "${conf_dir}/secrets.yml" - desc "create first PSMDB cluster 1.16.2 $CLUSTER" + desc "create first PSMDB cluster 1.17.0 $CLUSTER" apply_cluster "$test_dir/conf/${CLUSTER}-rs0.yml" desc 'check if Pod started' wait_for_running "${CLUSTER}-rs0" "3" "true" desc 'check if service and statefulset created with expected config' - compare_kubectl service/${CLUSTER}-rs0 "-1162" - compare_kubectl statefulset/${CLUSTER}-rs0 "-1162" + compare_kubectl service/${CLUSTER}-rs0 "-1170" + compare_kubectl statefulset/${CLUSTER}-rs0 "-1170" - desc 'test 1.17.0' + desc 'test 1.18.0' kubectl_bin patch psmdb "${CLUSTER}" --type=merge --patch '{ - "spec": {"crVersion":"1.17.0"} + "spec": {"crVersion":"1.18.0"} }' # Wait for at least one reconciliation sleep 10 @@ -35,12 +34,12 @@ main() { wait_for_running "${CLUSTER}-rs0" "3" "true" desc 'check if service and statefulset created with expected config' - compare_kubectl service/${CLUSTER}-rs0 "-1170" - compare_kubectl statefulset/${CLUSTER}-rs0 "-1170" + compare_kubectl service/${CLUSTER}-rs0 "-1180" + compare_kubectl statefulset/${CLUSTER}-rs0 "-1180" - desc 'test 1.18.0' + desc 'test 1.19.0' kubectl_bin patch psmdb "${CLUSTER}" --type=merge --patch '{ - "spec": {"crVersion":"1.18.0"} + "spec": {"crVersion":"1.19.0"} }' # Wait for at least one reconciliation sleep 10 @@ -48,8 +47,8 @@ main() { wait_for_running "${CLUSTER}-rs0" "3" "true" desc 'check if service and statefulset created with expected config' - compare_kubectl service/${CLUSTER}-rs0 "-1180" - compare_kubectl statefulset/${CLUSTER}-rs0 "-1180" + compare_kubectl service/${CLUSTER}-rs0 "-1190" + compare_kubectl statefulset/${CLUSTER}-rs0 "-1190" destroy $namespace From 146a3885c238b5f324e570010e952fdf7918ee44 Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Thu, 21 Nov 2024 12:48:19 +0200 Subject: [PATCH 26/30] for upgrade-consistency and upgrade-consistency-sharded-tls tests, we also need to rename compare files in addition to update of run file content --- ...162.yml => service_some-name-cfg-1190.yml} | 0 ...162.yml => service_some-name-rs0-1190.yml} | 0 .../statefulset_some-name-cfg-1170.yml | 2 +- .../statefulset_some-name-cfg-1180.yml | 2 +- ... => statefulset_some-name-cfg-1190-oc.yml} | 2 +- ...yml => statefulset_some-name-cfg-1190.yml} | 2 +- .../statefulset_some-name-rs0-1170.yml | 2 +- .../statefulset_some-name-rs0-1180.yml | 2 +- ... => statefulset_some-name-rs0-1190-oc.yml} | 2 +- ...yml => statefulset_some-name-rs0-1190.yml} | 2 +- e2e-tests/upgrade-consistency-sharded-tls/run | 34 +++++++++---------- ...162.yml => service_some-name-rs0-1190.yml} | 0 ... => statefulset_some-name-rs0-1190-oc.yml} | 0 ...yml => statefulset_some-name-rs0-1190.yml} | 0 .../conf/some-name-rs0.yml | 2 +- 15 files changed, 26 insertions(+), 26 deletions(-) rename e2e-tests/upgrade-consistency-sharded-tls/compare/{service_some-name-cfg-1162.yml => service_some-name-cfg-1190.yml} (100%) rename e2e-tests/upgrade-consistency-sharded-tls/compare/{service_some-name-rs0-1162.yml => service_some-name-rs0-1190.yml} (100%) rename e2e-tests/upgrade-consistency-sharded-tls/compare/{statefulset_some-name-cfg-1162-oc.yml => statefulset_some-name-cfg-1190-oc.yml} (99%) rename e2e-tests/upgrade-consistency-sharded-tls/compare/{statefulset_some-name-cfg-1162.yml => statefulset_some-name-cfg-1190.yml} (99%) rename e2e-tests/upgrade-consistency-sharded-tls/compare/{statefulset_some-name-rs0-1162-oc.yml => statefulset_some-name-rs0-1190-oc.yml} (99%) rename e2e-tests/upgrade-consistency-sharded-tls/compare/{statefulset_some-name-rs0-1162.yml => statefulset_some-name-rs0-1190.yml} (99%) rename e2e-tests/upgrade-consistency/compare/{service_some-name-rs0-1162.yml => service_some-name-rs0-1190.yml} (100%) rename e2e-tests/upgrade-consistency/compare/{statefulset_some-name-rs0-1162-oc.yml => statefulset_some-name-rs0-1190-oc.yml} (100%) rename e2e-tests/upgrade-consistency/compare/{statefulset_some-name-rs0-1162.yml => statefulset_some-name-rs0-1190.yml} (100%) diff --git a/e2e-tests/upgrade-consistency-sharded-tls/compare/service_some-name-cfg-1162.yml b/e2e-tests/upgrade-consistency-sharded-tls/compare/service_some-name-cfg-1190.yml similarity index 100% rename from e2e-tests/upgrade-consistency-sharded-tls/compare/service_some-name-cfg-1162.yml rename to e2e-tests/upgrade-consistency-sharded-tls/compare/service_some-name-cfg-1190.yml diff --git a/e2e-tests/upgrade-consistency-sharded-tls/compare/service_some-name-rs0-1162.yml b/e2e-tests/upgrade-consistency-sharded-tls/compare/service_some-name-rs0-1190.yml similarity index 100% rename from e2e-tests/upgrade-consistency-sharded-tls/compare/service_some-name-rs0-1162.yml rename to e2e-tests/upgrade-consistency-sharded-tls/compare/service_some-name-rs0-1190.yml diff --git a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1170.yml b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1170.yml index 6c10a1135c..a4aceed30f 100644 --- a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1170.yml +++ b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1170.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: annotations: {} - generation: 5 + generation: 3 labels: app.kubernetes.io/component: cfg app.kubernetes.io/instance: some-name diff --git a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1180.yml b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1180.yml index bfd388030a..6c10a1135c 100644 --- a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1180.yml +++ b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1180.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: annotations: {} - generation: 7 + generation: 5 labels: app.kubernetes.io/component: cfg app.kubernetes.io/instance: some-name diff --git a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1162-oc.yml b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1190-oc.yml similarity index 99% rename from e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1162-oc.yml rename to e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1190-oc.yml index e1b011548f..1640b7b614 100644 --- a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1162-oc.yml +++ b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1190-oc.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: annotations: {} - generation: 3 + generation: 7 labels: app.kubernetes.io/component: cfg app.kubernetes.io/instance: some-name diff --git a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1162.yml b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1190.yml similarity index 99% rename from e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1162.yml rename to e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1190.yml index a4aceed30f..bfd388030a 100644 --- a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1162.yml +++ b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-cfg-1190.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: annotations: {} - generation: 3 + generation: 7 labels: app.kubernetes.io/component: cfg app.kubernetes.io/instance: some-name diff --git a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1170.yml b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1170.yml index a0ce6a988b..abc93591b5 100644 --- a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1170.yml +++ b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1170.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: annotations: {} - generation: 5 + generation: 3 labels: app.kubernetes.io/component: mongod app.kubernetes.io/instance: some-name diff --git a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1180.yml b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1180.yml index 148a09afe6..a0ce6a988b 100644 --- a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1180.yml +++ b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1180.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: annotations: {} - generation: 7 + generation: 5 labels: app.kubernetes.io/component: mongod app.kubernetes.io/instance: some-name diff --git a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1162-oc.yml b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1190-oc.yml similarity index 99% rename from e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1162-oc.yml rename to e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1190-oc.yml index 87ad33b990..794034ad9b 100644 --- a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1162-oc.yml +++ b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1190-oc.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: annotations: {} - generation: 3 + generation: 7 labels: app.kubernetes.io/component: mongod app.kubernetes.io/instance: some-name diff --git a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1162.yml b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1190.yml similarity index 99% rename from e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1162.yml rename to e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1190.yml index abc93591b5..148a09afe6 100644 --- a/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1162.yml +++ b/e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1190.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: annotations: {} - generation: 3 + generation: 7 labels: app.kubernetes.io/component: mongod app.kubernetes.io/instance: some-name diff --git a/e2e-tests/upgrade-consistency-sharded-tls/run b/e2e-tests/upgrade-consistency-sharded-tls/run index 3eed33edd1..4f7a0a88cf 100755 --- a/e2e-tests/upgrade-consistency-sharded-tls/run +++ b/e2e-tests/upgrade-consistency-sharded-tls/run @@ -24,7 +24,7 @@ main() { kubectl_bin apply -f "$conf_dir/client_with_tls.yml" deploy_cmctl - desc "create first PSMDB cluster 1.16.2 $CLUSTER" + desc "create first PSMDB cluster 1.17.0 $CLUSTER" apply_cluster "$test_dir/conf/${CLUSTER}.yml" desc 'check if Pod started' @@ -51,14 +51,14 @@ main() { compare_generation "3" "statefulset" "${CLUSTER}-cfg" desc 'check if service and statefulset created with expected config' - compare_kubectl service/${CLUSTER}-rs0 "-1162" - compare_kubectl service/${CLUSTER}-cfg "-1162" - compare_kubectl statefulset/${CLUSTER}-rs0 "-1162" - compare_kubectl statefulset/${CLUSTER}-cfg "-1162" + compare_kubectl service/${CLUSTER}-rs0 "-1170" + compare_kubectl service/${CLUSTER}-cfg "-1170" + compare_kubectl statefulset/${CLUSTER}-rs0 "-1170" + compare_kubectl statefulset/${CLUSTER}-cfg "-1170" - desc 'test 1.17.0' + desc 'test 1.18.0' kubectl_bin patch psmdb "${CLUSTER}" --type=merge --patch '{ - "spec": {"crVersion":"1.17.0"} + "spec": {"crVersion":"1.18.0"} }' # Wait for at least one reconciliation sleep 20 @@ -80,14 +80,14 @@ main() { compare_generation "5" "statefulset" "${CLUSTER}-cfg" desc 'check if service and statefulset created with expected config' - compare_kubectl service/${CLUSTER}-rs0 "-1170" - compare_kubectl service/${CLUSTER}-cfg "-1170" - compare_kubectl statefulset/${CLUSTER}-rs0 "-1170" - compare_kubectl statefulset/${CLUSTER}-cfg "-1170" + compare_kubectl service/${CLUSTER}-rs0 "-1180" + compare_kubectl service/${CLUSTER}-cfg "-1180" + compare_kubectl statefulset/${CLUSTER}-rs0 "-1180" + compare_kubectl statefulset/${CLUSTER}-cfg "-1180" - desc 'test 1.18.0' + desc 'test 1.19.0' kubectl_bin patch psmdb "${CLUSTER}" --type=merge --patch '{ - "spec": {"crVersion":"1.18.0"} + "spec": {"crVersion":"1.19.0"} }' # Wait for at least one reconciliation sleep 20 @@ -109,10 +109,10 @@ main() { compare_generation "7" "statefulset" "${CLUSTER}-cfg" desc 'check if service and statefulset created with expected config' - compare_kubectl service/${CLUSTER}-rs0 "-1180" - compare_kubectl service/${CLUSTER}-cfg "-1180" - compare_kubectl statefulset/${CLUSTER}-rs0 "-1180" - compare_kubectl statefulset/${CLUSTER}-cfg "-1180" + compare_kubectl service/${CLUSTER}-rs0 "-1190" + compare_kubectl service/${CLUSTER}-cfg "-1190" + compare_kubectl statefulset/${CLUSTER}-rs0 "-1190" + compare_kubectl statefulset/${CLUSTER}-cfg "-1190" destroy "$namespace" diff --git a/e2e-tests/upgrade-consistency/compare/service_some-name-rs0-1162.yml b/e2e-tests/upgrade-consistency/compare/service_some-name-rs0-1190.yml similarity index 100% rename from e2e-tests/upgrade-consistency/compare/service_some-name-rs0-1162.yml rename to e2e-tests/upgrade-consistency/compare/service_some-name-rs0-1190.yml diff --git a/e2e-tests/upgrade-consistency/compare/statefulset_some-name-rs0-1162-oc.yml b/e2e-tests/upgrade-consistency/compare/statefulset_some-name-rs0-1190-oc.yml similarity index 100% rename from e2e-tests/upgrade-consistency/compare/statefulset_some-name-rs0-1162-oc.yml rename to e2e-tests/upgrade-consistency/compare/statefulset_some-name-rs0-1190-oc.yml diff --git a/e2e-tests/upgrade-consistency/compare/statefulset_some-name-rs0-1162.yml b/e2e-tests/upgrade-consistency/compare/statefulset_some-name-rs0-1190.yml similarity index 100% rename from e2e-tests/upgrade-consistency/compare/statefulset_some-name-rs0-1162.yml rename to e2e-tests/upgrade-consistency/compare/statefulset_some-name-rs0-1190.yml diff --git a/e2e-tests/upgrade-consistency/conf/some-name-rs0.yml b/e2e-tests/upgrade-consistency/conf/some-name-rs0.yml index 67dec005fa..00f375a790 100644 --- a/e2e-tests/upgrade-consistency/conf/some-name-rs0.yml +++ b/e2e-tests/upgrade-consistency/conf/some-name-rs0.yml @@ -3,7 +3,7 @@ kind: PerconaServerMongoDB metadata: name: some-name spec: - crVersion: 1.16.2 + crVersion: 1.17.0 #platform: openshift image: imagePullPolicy: Always From 5ad9886f26cc84c729e8cc20b62e08aba8128145 Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:01:53 +0200 Subject: [PATCH 27/30] Update dependencies: add Ginkgo v2.19.0 and Gomega v1.33.1 --- go.mod | 4 ++++ go.sum | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 6bd7ef1d9a..6351e0c9a2 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,8 @@ require ( github.com/go-openapi/validate v0.24.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 github.com/hashicorp/go-version v1.7.0 + github.com/onsi/ginkgo/v2 v2.19.0 + github.com/onsi/gomega v1.33.1 github.com/percona/percona-backup-mongodb v1.8.1-0.20241002124601-957ac501f939 github.com/pkg/errors v0.9.1 github.com/robfig/cron/v3 v3.0.1 @@ -37,6 +39,8 @@ require ( github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-asn1-ber/asn1-ber v1.5.6 // indirect github.com/go-ldap/ldap/v3 v3.4.8 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect + github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/x448/float16 v0.8.4 // indirect diff --git a/go.sum b/go.sum index cbb39e8f16..d78c651e8a 100644 --- a/go.sum +++ b/go.sum @@ -255,8 +255,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20241101162523-b92577c0c142 h1:sAGdeJj0bnMgUNVeUpp6AYlVdCt3/GdI3pGRqsNSQLs= -github.com/google/pprof v0.0.0-20241101162523-b92577c0c142/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -399,15 +399,15 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= -github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= -github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= From a5a44661608117f6b0c90e2823135c5296143eef Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:41:24 +0200 Subject: [PATCH 28/30] Update container images to use perconalab versions for MongoDB operator and backup --- deploy/bundle.yaml | 2 +- deploy/cr-minimal.yaml | 2 +- deploy/cr.yaml | 4 ++-- deploy/cw-bundle.yaml | 2 +- deploy/cw-operator.yaml | 2 +- deploy/operator.yaml | 2 +- .../testdata/reconcile-statefulset/cfg-arbiter.yaml | 4 ++-- .../testdata/reconcile-statefulset/cfg-mongod.yaml | 4 ++-- .../testdata/reconcile-statefulset/cfg-nv.yaml | 4 ++-- .../testdata/reconcile-statefulset/rs0-arbiter.yaml | 2 +- .../testdata/reconcile-statefulset/rs0-mongod.yaml | 4 ++-- .../testdata/reconcile-statefulset/rs0-nv.yaml | 4 ++-- pkg/psmdb/backup/testdata/cr-with-pbm-config.yaml | 6 +++--- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/deploy/bundle.yaml b/deploy/bundle.yaml index ea653cf2da..bcbeb7865e 100644 --- a/deploy/bundle.yaml +++ b/deploy/bundle.yaml @@ -19741,7 +19741,7 @@ spec: serviceAccountName: percona-server-mongodb-operator containers: - name: percona-server-mongodb-operator - image: percona/percona-server-mongodb-operator:1.18.0 + image: perconalab/percona-server-mongodb-operator:main imagePullPolicy: Always livenessProbe: failureThreshold: 3 diff --git a/deploy/cr-minimal.yaml b/deploy/cr-minimal.yaml index 32d4601911..2d00203fe5 100644 --- a/deploy/cr-minimal.yaml +++ b/deploy/cr-minimal.yaml @@ -4,7 +4,7 @@ metadata: name: minimal-cluster spec: crVersion: 1.18.0 - image: percona/percona-server-mongodb:7.0.14-8-multi + image: perconalab/percona-server-mongodb-operator:main-mongod7.0 unsafeFlags: replsetSize: true mongosSize: true diff --git a/deploy/cr.yaml b/deploy/cr.yaml index 2c823c877c..598aa76896 100644 --- a/deploy/cr.yaml +++ b/deploy/cr.yaml @@ -59,7 +59,7 @@ spec: # sse: my-cluster-name-sse pmm: enabled: false - image: percona/pmm-client:2.43.2 + image: perconalab/pmm-client:dev-latest serverHost: monitoring-service # containerSecurityContext: {} # mongodParams: --environment=ENVIRONMENT @@ -618,7 +618,7 @@ spec: backup: enabled: true - image: percona/percona-backup-mongodb:2.7.0-multi + image: perconalab/percona-server-mongodb-operator:main-backup # annotations: # iam.amazonaws.com/role: role-arn # resources: diff --git a/deploy/cw-bundle.yaml b/deploy/cw-bundle.yaml index 47af1d62f7..2e863b6097 100644 --- a/deploy/cw-bundle.yaml +++ b/deploy/cw-bundle.yaml @@ -19762,7 +19762,7 @@ spec: serviceAccountName: percona-server-mongodb-operator containers: - name: percona-server-mongodb-operator - image: percona/percona-server-mongodb-operator:1.18.0 + image: perconalab/percona-server-mongodb-operator:main imagePullPolicy: Always livenessProbe: failureThreshold: 3 diff --git a/deploy/cw-operator.yaml b/deploy/cw-operator.yaml index 47b2ecc323..b8ec3d38e6 100644 --- a/deploy/cw-operator.yaml +++ b/deploy/cw-operator.yaml @@ -15,7 +15,7 @@ spec: serviceAccountName: percona-server-mongodb-operator containers: - name: percona-server-mongodb-operator - image: percona/percona-server-mongodb-operator:1.18.0 + image: perconalab/percona-server-mongodb-operator:main imagePullPolicy: Always livenessProbe: failureThreshold: 3 diff --git a/deploy/operator.yaml b/deploy/operator.yaml index e606af9612..90d4d04a51 100644 --- a/deploy/operator.yaml +++ b/deploy/operator.yaml @@ -15,7 +15,7 @@ spec: serviceAccountName: percona-server-mongodb-operator containers: - name: percona-server-mongodb-operator - image: percona/percona-server-mongodb-operator:1.18.0 + image: perconalab/percona-server-mongodb-operator:main imagePullPolicy: Always livenessProbe: failureThreshold: 3 diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-arbiter.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-arbiter.yaml index afee09d0e4..87d5e275a1 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-arbiter.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-arbiter.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: percona/percona-server-mongodb:7.0.14-8 + image: perconalab/percona-server-mongodb-operator:main-mongod7.0 imagePullPolicy: Always livenessProbe: exec: @@ -185,7 +185,7 @@ spec: value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME) - name: PBM_AGENT_TLS_ENABLED value: "true" - image: percona/percona-backup-mongodb:2.6.0 + image: perconalab/percona-server-mongodb-operator:main-backup imagePullPolicy: Always name: backup-agent resources: {} diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-mongod.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-mongod.yaml index afee09d0e4..87d5e275a1 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-mongod.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-mongod.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: percona/percona-server-mongodb:7.0.14-8 + image: perconalab/percona-server-mongodb-operator:main-mongod7.0 imagePullPolicy: Always livenessProbe: exec: @@ -185,7 +185,7 @@ spec: value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME) - name: PBM_AGENT_TLS_ENABLED value: "true" - image: percona/percona-backup-mongodb:2.6.0 + image: perconalab/percona-server-mongodb-operator:main-backup imagePullPolicy: Always name: backup-agent resources: {} diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-nv.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-nv.yaml index afee09d0e4..87d5e275a1 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-nv.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/cfg-nv.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: percona/percona-server-mongodb:7.0.14-8 + image: perconalab/percona-server-mongodb-operator:main-mongod7.0 imagePullPolicy: Always livenessProbe: exec: @@ -185,7 +185,7 @@ spec: value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME) - name: PBM_AGENT_TLS_ENABLED value: "true" - image: percona/percona-backup-mongodb:2.6.0 + image: perconalab/percona-server-mongodb-operator:main-backup imagePullPolicy: Always name: backup-agent resources: {} diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-arbiter.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-arbiter.yaml index be9b389274..e51bb7f1aa 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-arbiter.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-arbiter.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: percona/percona-server-mongodb:7.0.14-8 + image: perconalab/percona-server-mongodb-operator:main-mongod7.0 imagePullPolicy: Always livenessProbe: exec: diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-mongod.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-mongod.yaml index 8610ffd7fc..5822610e51 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-mongod.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-mongod.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: percona/percona-server-mongodb:7.0.14-8 + image: perconalab/percona-server-mongodb-operator:main-mongod7.0 imagePullPolicy: Always livenessProbe: exec: @@ -185,7 +185,7 @@ spec: value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME) - name: PBM_AGENT_TLS_ENABLED value: "true" - image: percona/percona-backup-mongodb:2.6.0 + image: perconalab/percona-server-mongodb-operator:main-backup imagePullPolicy: Always name: backup-agent resources: {} diff --git a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-nv.yaml b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-nv.yaml index 3a69feb524..9c884dfb84 100644 --- a/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-nv.yaml +++ b/pkg/controller/perconaservermongodb/testdata/reconcile-statefulset/rs0-nv.yaml @@ -83,7 +83,7 @@ spec: - secretRef: name: internal-reconcile-statefulset-cr-users optional: false - image: percona/percona-server-mongodb:7.0.14-8 + image: perconalab/percona-server-mongodb-operator:main-mongod7.0 imagePullPolicy: Always livenessProbe: exec: @@ -184,7 +184,7 @@ spec: value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME) - name: PBM_AGENT_TLS_ENABLED value: "true" - image: percona/percona-backup-mongodb:2.6.0 + image: perconalab/percona-server-mongodb-operator:main-backup imagePullPolicy: Always name: backup-agent resources: {} diff --git a/pkg/psmdb/backup/testdata/cr-with-pbm-config.yaml b/pkg/psmdb/backup/testdata/cr-with-pbm-config.yaml index d7fb3753a8..ebee7b3824 100644 --- a/pkg/psmdb/backup/testdata/cr-with-pbm-config.yaml +++ b/pkg/psmdb/backup/testdata/cr-with-pbm-config.yaml @@ -5,7 +5,7 @@ metadata: namespace: test-namespace spec: crVersion: 1.16.0 - image: percona/percona-server-mongodb:7.0.14-8 + image: perconalab/percona-server-mongodb-operator:main-mongod7.0 imagePullPolicy: Always allowUnsafeConfigurations: false updateStrategy: SmartUpdate @@ -19,7 +19,7 @@ spec: encryptionKey: my-cluster-name-mongodb-encryption-key pmm: enabled: false - image: percona/pmm-client:2.43.2 + image: perconalab/pmm-client:dev-latest serverHost: monitoring-service replsets: - name: rs0 @@ -118,7 +118,7 @@ spec: backup: enabled: true - image: percona/percona-backup-mongodb:2.6.0 + image: perconalab/percona-server-mongodb-operator:main-backup storages: test-s3-storage: type: s3 From 52a16a11746a61ed2444b6f5913c92f09cad15f3 Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:43:41 +0200 Subject: [PATCH 29/30] Update initImage to use perconalab version for MongoDB operator --- deploy/cr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/cr.yaml b/deploy/cr.yaml index 598aa76896..9cc5deba99 100644 --- a/deploy/cr.yaml +++ b/deploy/cr.yaml @@ -27,7 +27,7 @@ spec: # group: cert-manager.io # imagePullSecrets: # - name: private-registry-credentials -# initImage: percona/percona-server-mongodb-operator:1.18.0 +# initImage: perconalab/percona-server-mongodb-operator:main # initContainerSecurityContext: {} # unsafeFlags: # tls: false From 437ac69df1c265831f1af10db3be2d71053a99c7 Mon Sep 17 00:00:00 2001 From: Natalia Marukovich Date: Tue, 26 Nov 2024 15:28:43 +0100 Subject: [PATCH 30/30] K8SPSMDB-1075 use controller runtime builder (#1692) * K8SPSMDB-1075 use controller runtime builder * fix * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * delete unused code * fix PR comments * fix controller * Update pkg/controller/perconaservermongodbbackup/perconaservermongodbbackup_controller.go Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix imports --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../perconaservermongodb/psmdb_controller.go | 25 +++------- .../perconaservermongodbbackup_controller.go | 48 ++++++------------- .../perconaservermongodbrestore_controller.go | 39 ++++++--------- 3 files changed, 36 insertions(+), 76 deletions(-) diff --git a/pkg/controller/perconaservermongodb/psmdb_controller.go b/pkg/controller/perconaservermongodb/psmdb_controller.go index 4a8efdac71..bc3f68f20d 100644 --- a/pkg/controller/perconaservermongodb/psmdb_controller.go +++ b/pkg/controller/perconaservermongodb/psmdb_controller.go @@ -25,15 +25,13 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/rest" "k8s.io/client-go/util/retry" + "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" "sigs.k8s.io/controller-runtime/pkg/client/config" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/handler" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" "github.com/percona/percona-server-mongodb-operator/clientcmd" api "github.com/percona/percona-server-mongodb-operator/pkg/apis/psmdb/v1" @@ -134,21 +132,14 @@ func getOperatorPodImage(ctx context.Context) (string, error) { // add adds a new Controller to mgr with r as the reconcile.Reconciler func add(mgr manager.Manager, r reconcile.Reconciler) error { - // Create a new controller - c, err := controller.New("psmdb-controller", mgr, controller.Options{Reconciler: r}) - if err != nil { - return err - } - - // Watch for changes to primary resource PerconaServerMongoDB - err = c.Watch(source.Kind(mgr.GetCache(), &api.PerconaServerMongoDB{}, &handler.TypedEnqueueRequestForObject[*api.PerconaServerMongoDB]{})) - if err != nil { - return err - } - - return nil + return builder.ControllerManagedBy(mgr). + For(&api.PerconaServerMongoDB{}). + Named("psmdb-controller"). + Complete(r) } +var _ reconcile.Reconciler = &ReconcilePerconaServerMongoDB{} + type CronRegistry struct { crons *cron.Cron jobs map[string]Schedule @@ -172,8 +163,6 @@ func NewCronRegistry() CronRegistry { return c } -var _ reconcile.Reconciler = &ReconcilePerconaServerMongoDB{} - // ReconcilePerconaServerMongoDB reconciles a PerconaServerMongoDB object type ReconcilePerconaServerMongoDB struct { // This client, initialized using mgr.Client() above, is a split client diff --git a/pkg/controller/perconaservermongodbbackup/perconaservermongodbbackup_controller.go b/pkg/controller/perconaservermongodbbackup/perconaservermongodbbackup_controller.go index fe2fe90651..7e861939f4 100644 --- a/pkg/controller/perconaservermongodbbackup/perconaservermongodbbackup_controller.go +++ b/pkg/controller/perconaservermongodbbackup/perconaservermongodbbackup_controller.go @@ -14,20 +14,18 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/retry" + "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" pbmBackup "github.com/percona/percona-backup-mongodb/pbm/backup" pbmErrors "github.com/percona/percona-backup-mongodb/pbm/errors" "github.com/percona/percona-backup-mongodb/pbm/storage" "github.com/percona/percona-backup-mongodb/pbm/storage/azure" "github.com/percona/percona-backup-mongodb/pbm/storage/s3" - "github.com/percona/percona-server-mongodb-operator/clientcmd" psmdbv1 "github.com/percona/percona-server-mongodb-operator/pkg/apis/psmdb/v1" "github.com/percona/percona-server-mongodb-operator/pkg/naming" @@ -67,29 +65,20 @@ func newReconciler(mgr manager.Manager) (reconcile.Reconciler, error) { } // add adds a new Controller to mgr with r as the reconcile.Reconciler -func add(mgr manager.Manager, r reconcile.Reconciler) error { - // Create a new controller - c, err := controller.New("psmdbbackup-controller", mgr, controller.Options{Reconciler: r}) - if err != nil { - return err - } - - // Watch for changes to primary resource PerconaServerMongoDBBackup - err = c.Watch(source.Kind(mgr.GetCache(), &psmdbv1.PerconaServerMongoDBBackup{}, &handler.TypedEnqueueRequestForObject[*psmdbv1.PerconaServerMongoDBBackup]{})) - if err != nil { - return err - } - // TODO(user): Modify this to be the types you create that are owned by the primary resource - // Watch for changes to secondary resource Pods and requeue the owner PerconaServerMongoDBBackup - err = c.Watch(source.Kind(mgr.GetCache(), &corev1.Pod{}, handler.TypedEnqueueRequestForOwner[*corev1.Pod]( - mgr.GetScheme(), mgr.GetRESTMapper(), &psmdbv1.PerconaServerMongoDBBackup{}, handler.OnlyControllerOwner(), - ))) - if err != nil { - return err - } - - return nil +func add(mgr manager.Manager, r reconcile.Reconciler) error { + return builder.ControllerManagedBy(mgr). + Named("psmdbbackup-controller"). + For(&psmdbv1.PerconaServerMongoDBBackup{}). + Watches( + &corev1.Pod{}, + handler.EnqueueRequestForOwner( + mgr.GetScheme(), mgr.GetRESTMapper(), + &psmdbv1.PerconaServerMongoDBBackup{}, + handler.OnlyControllerOwner(), + ), + ). + Complete(r) } var _ reconcile.Reconciler = &ReconcilePerconaServerMongoDBBackup{} @@ -177,15 +166,6 @@ func (r *ReconcilePerconaServerMongoDBBackup) Reconcile(ctx context.Context, req if err != nil { return rr, errors.Wrapf(err, "set defaults for %s/%s", cluster.Namespace, cluster.Name) } - // TODO: Remove after 1.15 - if cluster.CompareVersion("1.12.0") >= 0 && cr.Spec.ClusterName == "" { - cr.Spec.ClusterName = cr.Spec.PSMDBCluster - cr.Spec.PSMDBCluster = "" - err = r.client.Update(ctx, cr) - if err != nil { - return rr, errors.Wrap(err, "failed to update clusterName") - } - } } bcp, err := r.newBackup(ctx, cluster) diff --git a/pkg/controller/perconaservermongodbrestore/perconaservermongodbrestore_controller.go b/pkg/controller/perconaservermongodbrestore/perconaservermongodbrestore_controller.go index ac2d8c784b..8cff8f259e 100644 --- a/pkg/controller/perconaservermongodbrestore/perconaservermongodbrestore_controller.go +++ b/pkg/controller/perconaservermongodbrestore/perconaservermongodbrestore_controller.go @@ -13,13 +13,12 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/util/retry" + "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" "github.com/percona/percona-backup-mongodb/pbm/defs" @@ -56,29 +55,21 @@ func newReconciler(mgr manager.Manager) (reconcile.Reconciler, error) { }, nil } -// add adds a new Controller to mgr with r as the reconcile.Reconciler -func add(mgr manager.Manager, r reconcile.Reconciler) error { - // Create a new controller - c, err := controller.New("psmdbrestore-controller", mgr, controller.Options{Reconciler: r}) - if err != nil { - return err - } +//add adds a new Controller to mgr with r as the reconcile.Reconciler - // Watch for changes to primary resource PerconaServerMongoDBRestore - err = c.Watch(source.Kind(mgr.GetCache(), &psmdbv1.PerconaServerMongoDBRestore{}, &handler.TypedEnqueueRequestForObject[*psmdbv1.PerconaServerMongoDBRestore]{})) - if err != nil { - return err - } - - // Watch for changes to secondary resource Pods and requeue the owner PerconaServerMongoDBRestore - err = c.Watch(source.Kind(mgr.GetCache(), &corev1.Pod{}, handler.TypedEnqueueRequestForOwner[*corev1.Pod]( - mgr.GetScheme(), mgr.GetRESTMapper(), &psmdbv1.PerconaServerMongoDBRestore{}, handler.OnlyControllerOwner(), - ))) - if err != nil { - return err - } - - return nil +func add(mgr manager.Manager, r reconcile.Reconciler) error { + return builder.ControllerManagedBy(mgr). + Named("psmdbrestore-controller"). + For(&psmdbv1.PerconaServerMongoDBRestore{}). + Watches( + &corev1.Pod{}, + handler.EnqueueRequestForOwner( + mgr.GetScheme(), mgr.GetRESTMapper(), + &psmdbv1.PerconaServerMongoDBRestore{}, + handler.OnlyControllerOwner(), + ), + ). + Complete(r) } var _ reconcile.Reconciler = &ReconcilePerconaServerMongoDBRestore{}