Skip to content

K8SPSMDB add support for Rancher#2412

Open
valmiranogueira wants to merge 7 commits into
mainfrom
K8SPSMDB-1596-rancher
Open

K8SPSMDB add support for Rancher#2412
valmiranogueira wants to merge 7 commits into
mainfrom
K8SPSMDB-1596-rancher

Conversation

@valmiranogueira

@valmiranogueira valmiranogueira commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

CHANGE DESCRIPTION

Solution:

Fixes and improvements for Rancher tests

  • Fixed volume expansion validation: there is a difference between G and Gi units. 1G is converted to approximately 954Mi, which can cause issues with storage providers that enforce strict capacity calculations, such as Longhorn (https://longhorn.io/).
  • Improved monitoring support functions to properly handle generated passwords containing the @ character. Since this character is not URL-safe, it was causing intermittent test failures. In addition to that, created execute_curl function to run the request within the cluster to avoid intermittent requests
  • Refactored container runtime detection logic into a generic function and standardized the runtime class to runc. This improves compatibility with platforms such as EKS and Rancher, where Docker is no longer supported.
  • Enhanced PLATFORM variable support. The variable is now exported and supports predefined values such as EKS, AKS, RANCHER, MINIKUBE...

Additional changes

  • Removed obsolete comparison files related to OpenShift versions earlier than 4.x.
  • Added a dedicated variables file to centralize configuration and remove variable definitions from function scripts.
  • Removed function file imports during image build. Some imported files contained kubectl function calls executed during variable initialization, which are unnecessary during the build process.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported MongoDB version?
  • Does the change support oldest and newest supported Kubernetes version?

Copilot AI review requested due to automatic review settings June 23, 2026 20:00
@pull-request-size pull-request-size Bot added the size/XXL 1000+ lines label Jun 23, 2026
@github-actions github-actions Bot added the tests label Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the E2E test harness to run reliably on Rancher/RKE2 (and other managed Kubernetes platforms) by centralizing test configuration, normalizing storage sizing, and refactoring runtime-class / monitoring / snapshot helpers to be platform-aware.

Changes:

  • Centralized E2E environment variables and platform detection into e2e-tests/vars and refactored e2e-tests/functions to source it.
  • Normalized PVC resize/storage requests from G to Gi across resize/autoscaling tests to avoid provider-specific rounding issues (e.g., Longhorn).
  • Added Rancher-specific snapshot class support and hardened PMM/monitoring interactions by routing curl calls through a helper (to better handle special characters in credentials).

Reviewed changes

Copilot reviewed 81 out of 82 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
e2e-tests/vars New centralized variables/platform-detection script used by E2E functions.
e2e-tests/functions Refactor to source vars, add Rancher handling, runtime class helper, snapshot class helpers, and execute_curl.
e2e-tests/build Avoids sourcing functions during image build; computes git/image variables locally.
e2e-tests/release_versions Adds Rancher/RKE2 and cert-manager version entries used by the E2E release matrix.
e2e-tests/unsafe-psa/run Uses Gi units for PVC resize validation.
e2e-tests/storage/run Makes OpenShift detection check consistent ([[ -n \"$OPENSHIFT\" ]]).
e2e-tests/storage/conf/hostpath-helper.yml Adjusts cleanup container command/securityContext for hostpath helper behavior.
e2e-tests/security-context/run Makes OpenShift detection checks consistent/quoted.
e2e-tests/pvc-resize/run Converts GGi and standardizes EKS/OpenShift conditionals.
e2e-tests/pvc-resize/conf/some-name.yml Updates baseline PVC request 1G1Gi.
e2e-tests/pvc-resize/compare/statefulset_some-name-rs0.yml Updates expected PVC request 1G1Gi.
e2e-tests/pvc-resize/compare/statefulset_some-name-rs0-oc.yml Updates expected PVC request 1G1Gi.
e2e-tests/pvc-auto-resize/run Updates EKS/OpenShift checks and strengthens maxSize verification logic.
e2e-tests/pvc-auto-resize/conf/some-name.yml Updates baseline PVC request 1G1Gi.
e2e-tests/pvc-auto-resize/conf/some-name-eks.yml Updates baseline PVC request 1G1Gi.
e2e-tests/pvc-auto-resize/compare/statefulset_some-name-rs0.yml Updates expected PVC request 1G1Gi.
e2e-tests/pvc-auto-resize/compare/statefulset_some-name-rs0-oc.yml Updates expected PVC request 1G1Gi.
e2e-tests/pitr-sharded/run Replaces inline RuntimeClass logic with create_runtime_class.
e2e-tests/pitr-sharded/compare/statefulset_some-name-rs0-oc.yml Updates expected runtimeClassName and secret volume mounts for OC fixtures.
e2e-tests/pitr-sharded/compare/statefulset_some-name-rs1-oc.yml Updates OC fixture to include users secret volume/mount.
e2e-tests/pitr-sharded/compare/statefulset_some-name-rs2-oc.yml Updates OC fixture to include users secret volume/mount.
e2e-tests/pitr-sharded/compare/statefulset_some-name-cfg-oc.yml Updates OC fixture to include runtimeClassName.
e2e-tests/pitr-sharded/compare/statefulset_some-name-rs0-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/pitr-sharded/compare/statefulset_some-name-rs1-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/pitr-sharded/compare/statefulset_some-name-rs2-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/pitr-sharded/compare/statefulset_some-name-cfg-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/pitr-physical/compare/statefulset_some-name-rs1-oc.yml Updates OC fixture to include users secret volume/mount.
e2e-tests/pitr-physical/compare/statefulset_some-name-rs2-oc.yml Updates OC fixture to include users secret volume/mount.
e2e-tests/pitr-physical/compare/statefulset_some-name-rs2-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/pitr-physical/compare/statefulset_some-name-rs1-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/pitr-physical/compare/statefulset_some-name-rs0-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/pitr-physical/compare/statefulset_some-name-cfg-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/pitr-physical-backup-source/compare/statefulset_some-name-rs1-oc.yml Updates OC fixture to include users secret volume/mount.
e2e-tests/pitr-physical-backup-source/compare/statefulset_some-name-rs2-oc.yml Updates OC fixture to include users secret volume/mount.
e2e-tests/pitr-physical-backup-source/compare/statefulset_some-name-rs2-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/pitr-physical-backup-source/compare/statefulset_some-name-rs1-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/pitr-physical-backup-source/compare/statefulset_some-name-rs0-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/pitr-physical-backup-source/compare/statefulset_some-name-cfg-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/multi-cluster-service/run Uses safer numeric check for GKE flag and refactors RuntimeClass creation via helper.
e2e-tests/monitoring-pmm3/run Uses execute_curl and adjusts PMM inventory/QAN calls to avoid URL-unsafe password issues.
e2e-tests/monitoring-2-0/run Uses execute_curl for PMM API key and inventory requests; normalizes OpenShift checks.
e2e-tests/ldap/run Normalizes OpenShift checks.
e2e-tests/ldap-tls/run Normalizes OpenShift checks.
e2e-tests/init-deploy/run Replaces inline RuntimeClass logic with create_runtime_class.
e2e-tests/init-deploy/compare/statefulset_another-name-rs0-oc.yml Updates OC fixture for runtimeClassName and backup-agent container.
e2e-tests/init-deploy/compare/statefulset_another-name-rs0-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/expose-sharded/run Replaces inline RuntimeClass logic with create_runtime_class and removes explicit delete.
e2e-tests/expose-sharded/compare/statefulset_some-name-mongos-oc.yml Updates OC fixture (securityContext placement + runtimeClassName).
e2e-tests/expose-sharded/compare/statefulset_some-name-cfg-oc.yml Updates OC fixture to include runtimeClassName.
e2e-tests/expose-sharded/compare/statefulset_some-name-rs0-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/expose-sharded/compare/statefulset_some-name-mongos-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/expose-sharded/compare/statefulset_some-name-cfg-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/demand-backup-snapshot/run Defers snapshot class selection to helper and ensures class is deployed first.
e2e-tests/demand-backup-snapshot-vault/run Same snapshot class flow changes as non-vault snapshot test.
e2e-tests/demand-backup-sharded/run Replaces inline RuntimeClass logic with create_runtime_class.
e2e-tests/demand-backup-sharded/compare/statefulset_some-name-rs0-oc.yml Updates OC fixture to include runtimeClassName.
e2e-tests/demand-backup-sharded/compare/statefulset_some-name-mongos-oc.yml Updates OC fixture for runtimeClassName/securityContext expectations.
e2e-tests/demand-backup-sharded/compare/statefulset_some-name-cfg-oc.yml Updates OC fixture to include runtimeClassName.
e2e-tests/demand-backup-sharded/compare/statefulset_some-name-rs0-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/demand-backup-sharded/compare/statefulset_some-name-mongos-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/demand-backup-sharded/compare/statefulset_some-name-cfg-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/demand-backup-fs/run Normalizes OpenShift checks/quoting.
e2e-tests/demand-backup-eks-credentials/run Uses numeric EKS flag check consistent with new platform detection.
e2e-tests/demand-backup-eks-credentials-irsa/run Uses numeric EKS flag check consistent with new platform detection.
e2e-tests/default-cr/compare/statefulset_my-cluster-name-rs0.yml Updates expected volumes/mounts (keyfile removal) for default CR fixtures.
e2e-tests/default-cr/compare/statefulset_my-cluster-name-rs0-oc.yml Same fixture update for OpenShift.
e2e-tests/default-cr/compare/statefulset_my-cluster-name-cfg.yml Same fixture update for cfg statefulset.
e2e-tests/default-cr/compare/statefulset_my-cluster-name-cfg-oc.yml Same fixture update for cfg statefulset on OpenShift.
e2e-tests/default-cr/compare/statefulset_minimal-cluster-rs0.yml Updates expected volumes/mounts (keyfile removal) for minimal CR fixtures.
e2e-tests/default-cr/compare/statefulset_minimal-cluster-rs0-oc.yml Same fixture update for OpenShift.
e2e-tests/default-cr/compare/statefulset_minimal-cluster-cfg.yml Same fixture update for cfg statefulset.
e2e-tests/default-cr/compare/statefulset_minimal-cluster-cfg-oc.yml Same fixture update for cfg statefulset on OpenShift.
e2e-tests/custom-users-roles-sharded/run Replaces inline RuntimeClass logic with create_runtime_class.
e2e-tests/custom-users-roles-sharded/compare/run Same RuntimeClass helper change for compare runner.
e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-rs0-oc.yml Updates OC fixture to include runtimeClassName.
e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-mongos-oc.yml Updates OC fixture (securityContext placement + runtimeClassName).
e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-cfg-oc.yml Updates OC fixture to include runtimeClassName.
e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-rs0-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-mongos-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-cfg-4-oc.yml Removes obsolete OC compare fixture.
e2e-tests/conf/volume-snapshot-class-rancher.yaml Adds Longhorn/Rancher VolumeSnapshotClass definition.
e2e-tests/conf/volume-snapshot-class-gke.yaml Adds/defines GKE VolumeSnapshotClass definition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread e2e-tests/vars
Comment thread e2e-tests/vars
Comment thread e2e-tests/functions
Comment thread e2e-tests/functions
Comment thread e2e-tests/vars
@hors hors added this to the v1.23.0 milestone Jun 29, 2026
@valmiranogueira valmiranogueira force-pushed the K8SPSMDB-1596-rancher branch from 527a646 to acb5c4c Compare July 6, 2026 11:43
@valmiranogueira valmiranogueira marked this pull request as ready for review July 8, 2026 00:17
@JNKPercona

Copy link
Copy Markdown
Collaborator
Test Name Result Time
arbiter passed 00:00:00
balancer passed 00:16:39
cert-management-policy passed 00:00:00
clustersync passed 00:00:00
cross-site-sharded passed 00:00:00
custom-replset-name passed 00:00:00
custom-tls passed 00:00:00
custom-users-roles passed 00:00:00
custom-users-roles-sharded passed 00:00:00
data-at-rest-encryption passed 00:00:00
data-sharded passed 00:00:00
demand-backup passed 00:00:00
demand-backup-eks-credentials-irsa passed 00:00:00
demand-backup-fs passed 00:00:00
demand-backup-if-unhealthy passed 00:00:00
demand-backup-incremental-aws passed 00:00:00
demand-backup-incremental-azure passed 00:00:00
demand-backup-incremental-gcp-native passed 00:00:00
demand-backup-incremental-gcp-s3 passed 00:00:00
demand-backup-incremental-oss-s3 passed 00:00:00
demand-backup-incremental-oss-native passed 00:00:00
demand-backup-incremental-minio passed 00:00:00
demand-backup-incremental-sharded-aws passed 00:00:00
demand-backup-incremental-sharded-azure passed 00:00:00
demand-backup-incremental-sharded-gcp-native passed 00:00:00
demand-backup-incremental-sharded-gcp-s3 passed 00:00:00
demand-backup-incremental-sharded-oss-s3 passed 00:00:00
demand-backup-incremental-sharded-oss-native passed 00:00:00
demand-backup-incremental-sharded-minio passed 00:00:00
demand-backup-logical-minio-native-tls passed 00:00:00
demand-backup-physical-parallel passed 00:00:00
demand-backup-physical-aws passed 00:00:00
demand-backup-physical-azure passed 00:00:00
demand-backup-physical-gcp-s3 passed 00:00:00
demand-backup-gcs-workload-identity passed 00:00:00
demand-backup-physical-gcp-native passed 00:00:00
demand-backup-physical-oss-s3 passed 00:00:00
demand-backup-physical-oss-native passed 00:00:00
demand-backup-physical-minio passed 00:00:00
demand-backup-physical-minio-native passed 00:00:00
demand-backup-physical-minio-native-tls passed 00:00:00
demand-backup-physical-sharded-parallel passed 00:00:00
demand-backup-physical-sharded-aws passed 00:00:00
demand-backup-physical-sharded-azure passed 00:00:00
demand-backup-physical-sharded-gcp-native passed 00:00:00
demand-backup-physical-sharded-oss-s3 passed 00:00:00
demand-backup-physical-sharded-oss-native passed 00:00:00
demand-backup-physical-sharded-minio passed 00:00:00
demand-backup-physical-sharded-minio-native passed 00:00:00
demand-backup-sharded passed 00:00:00
demand-backup-snapshot passed 00:00:00
demand-backup-snapshot-vault passed 00:00:00
disabled-auth passed 00:00:00
expose-sharded passed 00:00:00
finalizer passed 00:00:00
ignore-labels-annotations passed 00:00:00
init-deploy passed 00:00:00
ldap passed 00:00:00
ldap-tls passed 00:00:00
limits passed 00:00:00
liveness passed 00:00:00
mongod-major-upgrade passed 00:00:00
mongod-major-upgrade-sharded passed 00:00:00
monitoring-2-0 passed 00:00:00
monitoring-pmm3 passed 00:00:00
multi-cluster-service passed 00:00:00
multi-storage passed 00:00:00
non-voting-and-hidden passed 00:00:00
one-pod passed 00:08:32
operator-self-healing-chaos passed 00:00:00
pitr passed 00:00:00
pitr-physical passed 00:00:00
pitr-sharded passed 00:00:00
pitr-to-new-cluster passed 00:00:00
pitr-physical-backup-source passed 00:00:00
preinit-updates passed 00:00:00
pvc-auto-resize passed 00:00:00
pvc-resize passed 00:16:38
recover-no-primary passed 00:00:00
replset-overrides passed 00:00:00
replset-remapping passed 00:00:00
replset-remapping-sharded passed 00:00:00
rs-shard-migration passed 00:00:00
scaling passed 00:00:00
scheduled-backup passed 00:00:00
security-context passed 00:00:00
self-healing-chaos passed 00:00:00
service-per-pod passed 00:00:00
serviceless-external-nodes passed 00:00:00
smart-update passed 00:00:00
split-horizon passed 00:00:00
split-horizon-manual-tls passed 00:00:00
stable-resource-version passed 00:00:00
storage passed 00:00:00
tls-clusterissuer-cert-manager passed 00:00:00
tls-issue-cert-manager passed 00:00:00
unsafe-psa passed 00:00:00
upgrade passed 00:00:00
upgrade-consistency passed 00:00:00
upgrade-consistency-sharded-tls passed 00:00:00
upgrade-sharded passed 00:00:00
upgrade-partial-backup passed 00:00:00
users passed 00:00:00
users-vault passed 00:00:00
vector-search passed 00:00:00
vector-search-sharded passed 00:00:00
version-service passed 00:00:00
Summary Value
Tests Run 107/107
Job Duration 00:52:38
Total Test Time 00:41:51

commit: 25599b5
image: perconalab/percona-server-mongodb-operator:PR-2412-25599b5d4

@hors hors requested a review from egegunes July 8, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants