downloading uv 0.13.9 x86_64-unknown-linux-gnu installing to /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/bin uv uvx everything's installed! To add /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/bin to your PATH, either restart your shell or run: source /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/bin/env (sh, bash, zsh) source /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/bin/env.fish (fish) WARN: The following commands are shadowed by other commands in your PATH: uv uvx mkdir -p e2e-tests/reports e2e-tests/logs ========================================================================================= test session starts ========================================================================================== platform linux -- Python 3.14.10, pytest-9.1.1, pluggy-1.7.0 -- /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/.venv/bin/python cachedir: .pytest_cache metadata: {'Python': '3.14.10', 'Platform': 'Linux-7.1.6-201.fc44.x86_64-x86_64-with-glibc2.43', 'Packages': {'pytest': '9.1.1', 'pluggy': '1.7.0'}, 'Plugins': {'json-report': '1.5.0', 'dependency': '0.6.1', 'html': '4.2.0', 'metadata': '3.1.1'}, 'CI': 'true', 'BUILD_NUMBER': '2', 'BUILD_ID': '2', 'BUILD_URL': 'https://cloud.cd.percona.com/job/cloud-psmdb-operator/job/PR-2742/2/', 'NODE_NAME': 'hcloud-bfkncubytbaldetv', 'JOB_NAME': 'cloud-psmdb-operator/PR-2742', 'BUILD_TAG': 'jenkins-cloud-psmdb-operator-PR-2742-2', 'EXECUTOR_NUMBER': '0', 'JENKINS_URL': 'https://cloud.cd.percona.com/', 'WORKSPACE': '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742', 'GIT_COMMIT': 'cf134fefe3b251937747923cc1a37f3d6e0fa43f', 'GIT_URL': 'https://github.com/percona/percona-server-mongodb-operator.git', 'GIT_BRANCH': 'PR-2742'} rootdir: /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742 configfile: pyproject.toml plugins: json-report-1.5.0, dependency-0.6.1, html-4.2.0, metadata-3.1.1 collecting ... collected 1 item e2e-tests/test_pytest_wrapper.py::test_bash_wrapper[custom-users-roles-sharded] [09:07:17.503265] WARNING kubectl error: Warning: version difference between client (1.37) and server (1.34) exceeds the supported minor version skew of +/-1 [09:07:18.687799] INFO Environment variables: KUBE_VERSION=1.34 PLATFORM=gke ARCH= EKS= GKE=1 AKS= OPENSHIFT= KIND= MINIKUBE= RANCHER= API=psmdb.percona.com/v1 REGISTRY_NAME=docker.io GIT_COMMIT=cf134fefe3b251937747923cc1a37f3d6e0fa43f GIT_BRANCH=PR-2742 OPERATOR_VERSION=1.24.0 IMAGE=docker.io/perconalab/percona-server-mongodb-operator:PR-2742-cf134fefe IMAGE_MONGOD=docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 IMAGE_MONGOD_CHAIN=docker.io/perconalab/percona-server-mongodb-operator:main-mongod7.0 docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.0 docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 IMAGE_SEARCH=docker.io/perconalab/percona-server-mongodb-operator:main-mongot IMAGE_BACKUP=docker.io/perconalab/percona-server-mongodb-operator:main-backup IMAGE_PMM_CLIENT=docker.io/perconalab/pmm-client:3-dev-latest IMAGE_PMM_SERVER=docker.io/perconalab/pmm-server:3-dev-latest IMAGE_LOGCOLLECTOR=docker.io/perconalab/fluentbit:main-logcollector IMAGE_CLUSTERSYNC=docker.io/percona/percona-clustersync-mongodb:1.0.0 IMAGE_AWS_CLI=docker.io/amazon/aws-cli:2.34.60 CERT_MANAGER_VER=1.21.0 CHAOS_MESH_VER=2.7.1 SEAWEEDFS_VER=4.47.0 PMM_SERVER_VER=9.9.9 CLEAN_NAMESPACE=1 DELETE_CRD_ON_START=1 SKIP_DELETE=0 SKIP_BACKUPS_TO_AWS_GCP_AZURE= UPDATE_COMPARE_FILES=0 Debug logging disabled. + cluster=some-name + create_infra custom-users-roles-sharded-25005 + local ns=custom-users-roles-sharded-25005 + echo custom-users-roles-sharded-25005 + destroy_cert_manager + [[ -n '' ]] + kubectl_bin delete mutatingwebhookconfiguration cert-manager-webhook --ignore-not-found ++ mktemp + local LAST_OUT=/tmp/tmp.KnCQArhYQO ++ mktemp + local LAST_ERR=/tmp/tmp.IFcjoJ4nWY + local exit_status=0 + local timeout=4 + local i + args=('delete' 'mutatingwebhookconfiguration' 'cert-manager-webhook' '--ignore-not-found') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ delete == \- ]] + [[ delete =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ mutatingwebhookconfiguration == \- ]] + [[ mutatingwebhookconfiguration =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ cert-manager-webhook == \- ]] + [[ cert-manager-webhook =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --ignore-not-found == \- ]] + [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl delete mutatingwebhookconfiguration cert-manager-webhook --ignore-not-found + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.KnCQArhYQO + cat /tmp/tmp.IFcjoJ4nWY + rm /tmp/tmp.KnCQArhYQO /tmp/tmp.IFcjoJ4nWY + return 0 + kubectl_bin delete validatingwebhookconfiguration cert-manager-webhook --ignore-not-found ++ mktemp + local LAST_OUT=/tmp/tmp.cR7CK4uvRa ++ mktemp + local LAST_ERR=/tmp/tmp.pSM18zVwZR + local exit_status=0 + local timeout=4 + local i + args=('delete' 'validatingwebhookconfiguration' 'cert-manager-webhook' '--ignore-not-found') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ delete == \- ]] + [[ delete =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ validatingwebhookconfiguration == \- ]] + [[ validatingwebhookconfiguration =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ cert-manager-webhook == \- ]] + [[ cert-manager-webhook =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --ignore-not-found == \- ]] + [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl delete validatingwebhookconfiguration cert-manager-webhook --ignore-not-found + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.cR7CK4uvRa + cat /tmp/tmp.pSM18zVwZR + rm /tmp/tmp.cR7CK4uvRa /tmp/tmp.pSM18zVwZR + return 0 + kubectl_bin delete -f https://github.com/cert-manager/cert-manager/releases/download/v1.21.0/cert-manager.yaml --ignore-not-found --wait=false + crds=('certificates.cert-manager.io' 'certificaterequests.cert-manager.io' 'issuers.cert-manager.io' 'clusterissuers.cert-manager.io' 'orders.acme.cert-manager.io' 'challenges.acme.cert-manager.io') + local crds + kubectl_bin delete crd certificates.cert-manager.io certificaterequests.cert-manager.io issuers.cert-manager.io clusterissuers.cert-manager.io orders.acme.cert-manager.io challenges.acme.cert-manager.io --ignore-not-found --wait=false ++ mktemp + local LAST_OUT=/tmp/tmp.Q8YxuGMiEF ++ mktemp + local LAST_ERR=/tmp/tmp.HSbcRTL06z + local exit_status=0 + local timeout=4 + local i + args=('delete' 'crd' 'certificates.cert-manager.io' 'certificaterequests.cert-manager.io' 'issuers.cert-manager.io' 'clusterissuers.cert-manager.io' 'orders.acme.cert-manager.io' 'challenges.acme.cert-manager.io' '--ignore-not-found' '--wait=false') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ delete == \- ]] + [[ delete =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ crd == \- ]] + [[ crd =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ certificates.cert-manager.io == \- ]] + [[ certificates.cert-manager.io =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ certificaterequests.cert-manager.io == \- ]] + [[ certificaterequests.cert-manager.io =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ issuers.cert-manager.io == \- ]] + [[ issuers.cert-manager.io =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ clusterissuers.cert-manager.io == \- ]] + [[ clusterissuers.cert-manager.io =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ orders.acme.cert-manager.io == \- ]] + [[ orders.acme.cert-manager.io =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ challenges.acme.cert-manager.io == \- ]] + [[ challenges.acme.cert-manager.io =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --ignore-not-found == \- ]] + [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --wait=false == \- ]] + [[ --wait=false =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl delete crd certificates.cert-manager.io certificaterequests.cert-manager.io issuers.cert-manager.io clusterissuers.cert-manager.io orders.acme.cert-manager.io challenges.acme.cert-manager.io --ignore-not-found --wait=false + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.Q8YxuGMiEF + cat /tmp/tmp.HSbcRTL06z + rm /tmp/tmp.Q8YxuGMiEF /tmp/tmp.HSbcRTL06z + return 0 + kubectl_bin delete namespace cert-manager --ignore-not-found --wait=false ++ mktemp + local LAST_OUT=/tmp/tmp.QycWErW6fp ++ mktemp + local LAST_ERR=/tmp/tmp.4vLAzyConx + local exit_status=0 + local timeout=4 + local i + args=('delete' 'namespace' 'cert-manager' '--ignore-not-found' '--wait=false') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ delete == \- ]] + [[ delete =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ namespace == \- ]] + [[ namespace =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ cert-manager == \- ]] + [[ cert-manager =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --ignore-not-found == \- ]] + [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --wait=false == \- ]] + [[ --wait=false =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl delete namespace cert-manager --ignore-not-found --wait=false + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.QycWErW6fp + cat /tmp/tmp.4vLAzyConx + rm /tmp/tmp.QycWErW6fp /tmp/tmp.4vLAzyConx + return 0 + local remaining + local attempt ++ seq 1 60 + for attempt in $(seq 1 60) ++ kubectl_bin get mutatingwebhookconfiguration cert-manager-webhook --ignore-not-found -o name +++ mktemp ++ local LAST_OUT=/tmp/tmp.SZnj7toJk4 +++ mktemp ++ local LAST_ERR=/tmp/tmp.gznM9aj1vB ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'mutatingwebhookconfiguration' 'cert-manager-webhook' '--ignore-not-found' '-o' 'name') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mutatingwebhookconfiguration == \- ]] ++ [[ mutatingwebhookconfiguration =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ cert-manager-webhook == \- ]] ++ [[ cert-manager-webhook =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --ignore-not-found == \- ]] ++ [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ name == \- ]] ++ [[ name =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get mutatingwebhookconfiguration cert-manager-webhook --ignore-not-found -o name ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.SZnj7toJk4 ++ cat /tmp/tmp.gznM9aj1vB ++ rm /tmp/tmp.SZnj7toJk4 /tmp/tmp.gznM9aj1vB ++ return 0 + remaining= ++ kubectl_bin get validatingwebhookconfiguration cert-manager-webhook --ignore-not-found -o name +++ mktemp ++ local LAST_OUT=/tmp/tmp.Y4noS3OURU +++ mktemp ++ local LAST_ERR=/tmp/tmp.6pnZ3oxs3X ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'validatingwebhookconfiguration' 'cert-manager-webhook' '--ignore-not-found' '-o' 'name') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ validatingwebhookconfiguration == \- ]] ++ [[ validatingwebhookconfiguration =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ cert-manager-webhook == \- ]] ++ [[ cert-manager-webhook =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --ignore-not-found == \- ]] ++ [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ name == \- ]] ++ [[ name =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get validatingwebhookconfiguration cert-manager-webhook --ignore-not-found -o name ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.Y4noS3OURU ++ cat /tmp/tmp.6pnZ3oxs3X ++ rm /tmp/tmp.Y4noS3OURU /tmp/tmp.6pnZ3oxs3X ++ return 0 + remaining+= ++ kubectl_bin get crd certificates.cert-manager.io certificaterequests.cert-manager.io issuers.cert-manager.io clusterissuers.cert-manager.io orders.acme.cert-manager.io challenges.acme.cert-manager.io --ignore-not-found -o name +++ mktemp ++ local LAST_OUT=/tmp/tmp.8MKq6VJzsF +++ mktemp ++ local LAST_ERR=/tmp/tmp.AQqdDHeq14 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'crd' 'certificates.cert-manager.io' 'certificaterequests.cert-manager.io' 'issuers.cert-manager.io' 'clusterissuers.cert-manager.io' 'orders.acme.cert-manager.io' 'challenges.acme.cert-manager.io' '--ignore-not-found' '-o' 'name') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ crd == \- ]] ++ [[ crd =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ certificates.cert-manager.io == \- ]] ++ [[ certificates.cert-manager.io =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ certificaterequests.cert-manager.io == \- ]] ++ [[ certificaterequests.cert-manager.io =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ issuers.cert-manager.io == \- ]] ++ [[ issuers.cert-manager.io =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ clusterissuers.cert-manager.io == \- ]] ++ [[ clusterissuers.cert-manager.io =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ orders.acme.cert-manager.io == \- ]] ++ [[ orders.acme.cert-manager.io =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ challenges.acme.cert-manager.io == \- ]] ++ [[ challenges.acme.cert-manager.io =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --ignore-not-found == \- ]] ++ [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ name == \- ]] ++ [[ name =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get crd certificates.cert-manager.io certificaterequests.cert-manager.io issuers.cert-manager.io clusterissuers.cert-manager.io orders.acme.cert-manager.io challenges.acme.cert-manager.io --ignore-not-found -o name ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.8MKq6VJzsF ++ cat /tmp/tmp.AQqdDHeq14 ++ rm /tmp/tmp.8MKq6VJzsF /tmp/tmp.AQqdDHeq14 ++ return 0 + remaining+= ++ kubectl_bin get namespace cert-manager --ignore-not-found -o name +++ mktemp ++ local LAST_OUT=/tmp/tmp.UK7SLLVlnv +++ mktemp ++ local LAST_ERR=/tmp/tmp.udoF0NgO0F ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'namespace' 'cert-manager' '--ignore-not-found' '-o' 'name') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ namespace == \- ]] ++ [[ namespace =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ cert-manager == \- ]] ++ [[ cert-manager =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --ignore-not-found == \- ]] ++ [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ name == \- ]] ++ [[ name =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get namespace cert-manager --ignore-not-found -o name ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.UK7SLLVlnv ++ cat /tmp/tmp.udoF0NgO0F ++ rm /tmp/tmp.UK7SLLVlnv /tmp/tmp.udoF0NgO0F ++ return 0 + remaining+= + [[ -z '' ]] + return 0 + [[ 1 == 1 ]] + delete_crd + desc 'get and delete old CRDs and RBAC' + set +o xtrace ----------------------------------------------------------------------------------- get and delete old CRDs and RBAC ----------------------------------------------------------------------------------- + kubectl_bin delete -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml --ignore-not-found --wait=false ++ mktemp + local LAST_OUT=/tmp/tmp.LzAZmkLB1a ++ mktemp + local LAST_ERR=/tmp/tmp.WlDm9xXlRf + local exit_status=0 + local timeout=4 + local i + args=('delete' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml' '--ignore-not-found' '--wait=false') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ delete == \- ]] + [[ delete =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --ignore-not-found == \- ]] + [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --wait=false == \- ]] + [[ --wait=false =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl delete -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml --ignore-not-found --wait=false + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.LzAZmkLB1a + cat /tmp/tmp.WlDm9xXlRf + rm /tmp/tmp.LzAZmkLB1a /tmp/tmp.WlDm9xXlRf + return 0 ++ yq eval .metadata.name /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml ++ grep -v '\-\-\-' grep: warning: stray \ before - grep: warning: stray \ before - + for crd_name in $(yq eval '.metadata.name' "${src_dir}/deploy/crd.yaml" | grep -v '\-\-\-') + kubectl get perconaservermongodbbackups.psmdb.percona.com --all-namespaces -o wide + grep -v NAMESPACE + xargs -L 1 sh -xc 'kubectl patch perconaservermongodbbackups.psmdb.percona.com -n $0 $1 --type=merge -p "{\"metadata\":{\"finalizers\":[]}}"' error: the server doesn't have a resource type "perconaservermongodbbackups" in group "psmdb.percona.com" + kubectl patch perconaservermongodbbackups.psmdb.percona.com -n sh --type=merge -p '{"metadata":{"finalizers":[]}}' error: the server doesn't have a resource type "perconaservermongodbbackups" in group "psmdb.percona.com" + : + kubectl get crd perconaservermongodbbackups.psmdb.percona.com + for crd_name in $(yq eval '.metadata.name' "${src_dir}/deploy/crd.yaml" | grep -v '\-\-\-') + kubectl get perconaservermongodbclustersyncs.psmdb.percona.com --all-namespaces -o wide + xargs -L 1 sh -xc 'kubectl patch perconaservermongodbclustersyncs.psmdb.percona.com -n $0 $1 --type=merge -p "{\"metadata\":{\"finalizers\":[]}}"' + grep -v NAMESPACE error: the server doesn't have a resource type "perconaservermongodbclustersyncs" in group "psmdb.percona.com" + kubectl patch perconaservermongodbclustersyncs.psmdb.percona.com -n sh --type=merge -p '{"metadata":{"finalizers":[]}}' error: the server doesn't have a resource type "perconaservermongodbclustersyncs" in group "psmdb.percona.com" + : + kubectl get crd perconaservermongodbclustersyncs.psmdb.percona.com + for crd_name in $(yq eval '.metadata.name' "${src_dir}/deploy/crd.yaml" | grep -v '\-\-\-') + kubectl get perconaservermongodbrestores.psmdb.percona.com --all-namespaces -o wide + grep -v NAMESPACE + xargs -L 1 sh -xc 'kubectl patch perconaservermongodbrestores.psmdb.percona.com -n $0 $1 --type=merge -p "{\"metadata\":{\"finalizers\":[]}}"' error: the server doesn't have a resource type "perconaservermongodbrestores" in group "psmdb.percona.com" + kubectl patch perconaservermongodbrestores.psmdb.percona.com -n sh --type=merge -p '{"metadata":{"finalizers":[]}}' error: the server doesn't have a resource type "perconaservermongodbrestores" in group "psmdb.percona.com" + : + kubectl get crd perconaservermongodbrestores.psmdb.percona.com + for crd_name in $(yq eval '.metadata.name' "${src_dir}/deploy/crd.yaml" | grep -v '\-\-\-') + kubectl get perconaservermongodbs.psmdb.percona.com --all-namespaces -o wide + grep -v NAMESPACE + xargs -L 1 sh -xc 'kubectl patch perconaservermongodbs.psmdb.percona.com -n $0 $1 --type=merge -p "{\"metadata\":{\"finalizers\":[]}}"' error: the server doesn't have a resource type "perconaservermongodbs" in group "psmdb.percona.com" + kubectl patch perconaservermongodbs.psmdb.percona.com -n sh --type=merge -p '{"metadata":{"finalizers":[]}}' error: the server doesn't have a resource type "perconaservermongodbs" in group "psmdb.percona.com" + : + kubectl get crd perconaservermongodbs.psmdb.percona.com + local rbac_yaml=rbac.yaml + '[' -n psmdb-operator ']' + rbac_yaml=cw-rbac.yaml + kubectl_bin delete -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/cw-rbac.yaml --ignore-not-found --wait=false ++ mktemp + local LAST_OUT=/tmp/tmp.6yEqwnkkTq ++ mktemp + local LAST_ERR=/tmp/tmp.F9U44xtTmz + local exit_status=0 + local timeout=4 + local i + args=('delete' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/cw-rbac.yaml' '--ignore-not-found' '--wait=false') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ delete == \- ]] + [[ delete =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/cw-rbac.yaml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/cw-rbac.yaml =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --ignore-not-found == \- ]] + [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --wait=false == \- ]] + [[ --wait=false =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl delete -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/cw-rbac.yaml --ignore-not-found --wait=false + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.6yEqwnkkTq + cat /tmp/tmp.F9U44xtTmz + rm /tmp/tmp.6yEqwnkkTq /tmp/tmp.F9U44xtTmz + return 0 + check_crd_for_deletion PR-2742 + local git_tag=PR-2742 ++ curl -s https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/PR-2742/deploy/crd.yaml ++ yq eval .metadata.name ++ /usr/sbin/sed s/---//g ++ /usr/sbin/sed ':a;N;$!ba;s/\n/ /g' + for crd_name in $(curl -s https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/${git_tag}/deploy/crd.yaml | yq eval '.metadata.name' | $sed 's/---//g' | $sed ':a;N;$!ba;s/\n/ /g') ++ kubectl_bin get crd/null -o 'jsonpath={.status.conditions[-1].type}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.1Lc5mbTeMi +++ mktemp ++ local LAST_ERR=/tmp/tmp.kUw5AaDheC ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'crd/null' '-o' 'jsonpath={.status.conditions[-1].type}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ crd/null == \- ]] ++ [[ crd/null =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.status.conditions[-1].type} == \- ]] ++ [[ jsonpath={.status.conditions[-1].type} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get crd/null -o 'jsonpath={.status.conditions[-1].type}' ++ exit_status=1 ++ set -e ++ [[ 1 == 0 ]] ++ [[ 0 == 9 ]] ++ grep -q 'Error from server (NotFound)' /tmp/tmp.kUw5AaDheC ++ break ++ cat /tmp/tmp.1Lc5mbTeMi ++ cat /tmp/tmp.kUw5AaDheC Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "null" not found ++ rm /tmp/tmp.1Lc5mbTeMi /tmp/tmp.kUw5AaDheC ++ return 1 + [[ '' == Terminating ]] + '[' -n psmdb-operator ']' + create_namespace psmdb-operator + local namespace=psmdb-operator + local skip_clean_namespace= + [[ 1 == 1 ]] + [[ -z '' ]] + destroy_chaos_mesh ++ helm list --all-namespaces --filter chaos-mesh ++ tail -n1 ++ awk '-F ' '{print $2}' ++ sed s/NAMESPACE// + local chaos_mesh_ns= + desc 'destroy chaos-mesh' + set +o xtrace ----------------------------------------------------------------------------------- destroy chaos-mesh ----------------------------------------------------------------------------------- + '[' -n '' ']' ++ kubectl get MutatingWebhookConfiguration ++ grep chaos-mesh ++ awk '{print $1}' + timeout 30 kubectl delete MutatingWebhookConfiguration error: resource(s) were provided, but no name was specified + : ++ grep chaos-mesh ++ kubectl get ValidatingWebhookConfiguration ++ awk '{print $1}' + timeout 30 kubectl delete ValidatingWebhookConfiguration error: resource(s) were provided, but no name was specified + : ++ kubectl get ValidatingWebhookConfiguration ++ awk '{print $1}' ++ grep validate-auth + timeout 30 kubectl delete ValidatingWebhookConfiguration error: resource(s) were provided, but no name was specified + : ++ grep chaos-mesh ++ kubectl api-resources ++ awk '{print $1}' ++ kubectl get crd ++ awk '{print $1}' ++ grep chaos-mesh.org + timeout 30 kubectl delete crd error: resource(s) were provided, but no name was specified + : ++ kubectl get clusterrolebinding ++ grep chaos-mesh ++ awk '{print $1}' + timeout 30 kubectl delete clusterrolebinding error: resource(s) were provided, but no name was specified + : ++ kubectl get clusterrole ++ awk '{print $1}' ++ grep chaos-mesh + timeout 30 kubectl delete clusterrole error: resource(s) were provided, but no name was specified + : + desc 'cleaned up all old namespaces' + set +o xtrace ----------------------------------------------------------------------------------- cleaned up all old namespaces ----------------------------------------------------------------------------------- + local 'ns_filter=^kube-|^default|Terminating|psmdb-operator|openshift|^gke-|^gmp-|^NAME' + [[ -n '' ]] + kubectl_bin get ns + awk '{print$1}' + grep -E -v '^kube-|^default|Terminating|psmdb-operator|openshift|^gke-|^gmp-|^NAME' ++ mktemp + [[ -n '' ]] + desc 'cleaned up old namespaces psmdb-operator' + set +o xtrace ----------------------------------------------------------------------------------- cleaned up old namespaces psmdb-operator ----------------------------------------------------------------------------------- + kubectl_bin delete namespace psmdb-operator --ignore-not-found + local LAST_OUT=/tmp/tmp.A0AeUhf6sY + xargs kubectl delete ns ++ mktemp ++ mktemp + local LAST_ERR=/tmp/tmp.XVAsqUUyxR + local exit_status=0 + local timeout=4 + local i + args=('get' 'ns') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ get == \- ]] + [[ get =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ ns == \- ]] + [[ ns =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay + local LAST_OUT=/tmp/tmp.TCVvHAQ3wH ++ mktemp + local LAST_ERR=/tmp/tmp.QktdxvHVD6 + local exit_status=0 + local timeout=4 + local i + args=('delete' 'namespace' 'psmdb-operator' '--ignore-not-found') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ delete == \- ]] + [[ delete =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" ++ seq 0 9 + [[ namespace == \- ]] + [[ namespace =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-operator == \- ]] + [[ psmdb-operator =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --ignore-not-found == \- ]] + [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl get ns + for attempt in $(seq 0 9) + set +e + kubectl delete namespace psmdb-operator --ignore-not-found + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.A0AeUhf6sY + cat /tmp/tmp.XVAsqUUyxR + rm /tmp/tmp.A0AeUhf6sY /tmp/tmp.XVAsqUUyxR + return 0 error: resource(s) were provided, but no name was specified + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.TCVvHAQ3wH + cat /tmp/tmp.QktdxvHVD6 + rm /tmp/tmp.TCVvHAQ3wH /tmp/tmp.QktdxvHVD6 + return 0 + kubectl_bin wait --for=delete namespace psmdb-operator ++ mktemp + local LAST_OUT=/tmp/tmp.DPAc3IVhxO ++ mktemp + local LAST_ERR=/tmp/tmp.VBF1pyPpnY + local exit_status=0 + local timeout=4 + local i + args=('wait' '--for=delete' 'namespace' 'psmdb-operator') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ wait == \- ]] + [[ wait =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --for=delete == \- ]] + [[ --for=delete =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ namespace == \- ]] + [[ namespace =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-operator == \- ]] + [[ psmdb-operator =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl wait --for=delete namespace psmdb-operator + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.DPAc3IVhxO + cat /tmp/tmp.VBF1pyPpnY + rm /tmp/tmp.DPAc3IVhxO /tmp/tmp.VBF1pyPpnY + return 0 + desc 'create namespace psmdb-operator' + set +o xtrace ----------------------------------------------------------------------------------- create namespace psmdb-operator ----------------------------------------------------------------------------------- + kubectl_bin create namespace psmdb-operator ++ mktemp + local LAST_OUT=/tmp/tmp.eu2lmZdF1I ++ mktemp + local LAST_ERR=/tmp/tmp.wirEc0FJ0x + local exit_status=0 + local timeout=4 + local i + args=('create' 'namespace' 'psmdb-operator') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ create == \- ]] + [[ create =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ namespace == \- ]] + [[ namespace =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-operator == \- ]] + [[ psmdb-operator =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl create namespace psmdb-operator + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.eu2lmZdF1I namespace/psmdb-operator created + cat /tmp/tmp.wirEc0FJ0x + rm /tmp/tmp.eu2lmZdF1I /tmp/tmp.wirEc0FJ0x + return 0 + set_kube_ctx psmdb-operator + local namespace=psmdb-operator ++ kubectl_bin config current-context +++ mktemp ++ local LAST_OUT=/tmp/tmp.l1Gk8JcGie +++ mktemp ++ local LAST_ERR=/tmp/tmp.FElYOWgxNL ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('config' 'current-context') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ config == \- ]] ++ [[ config =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ current-context == \- ]] ++ [[ current-context =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl config current-context ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.l1Gk8JcGie ++ cat /tmp/tmp.FElYOWgxNL ++ rm /tmp/tmp.l1Gk8JcGie /tmp/tmp.FElYOWgxNL ++ return 0 + kubectl_bin config set-context gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9 --namespace=psmdb-operator ++ mktemp + local LAST_OUT=/tmp/tmp.qnocHMFLyW ++ mktemp + local LAST_ERR=/tmp/tmp.Q9vkdTMmQb + local exit_status=0 + local timeout=4 + local i + args=('config' 'set-context' 'gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9' '--namespace=psmdb-operator') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ config == \- ]] + [[ config =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ set-context == \- ]] + [[ set-context =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9 == \- ]] + [[ gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --namespace=psmdb-operator == \- ]] + [[ --namespace=psmdb-operator =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl config set-context gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9 --namespace=psmdb-operator + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.qnocHMFLyW Context "gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9" modified. + cat /tmp/tmp.Q9vkdTMmQb + rm /tmp/tmp.qnocHMFLyW /tmp/tmp.Q9vkdTMmQb + return 0 + deploy_operator + desc 'start PSMDB operator: docker.io/perconalab/percona-server-mongodb-operator:PR-2742-cf134fefe' + set +o xtrace ----------------------------------------------------------------------------------- start PSMDB operator: docker.io/perconalab/percona-server-mongodb-operator:PR-2742-cf134fefe ----------------------------------------------------------------------------------- + local cr_file + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/conf/crd.yaml ']' + cr_file=/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml + kubectl_bin apply --server-side --force-conflicts -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml ++ mktemp + local LAST_OUT=/tmp/tmp.b1x8QcxMr3 ++ mktemp + local LAST_ERR=/tmp/tmp.wD03dk8UqS + local exit_status=0 + local timeout=4 + local i + args=('apply' '--server-side' '--force-conflicts' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ apply == \- ]] + [[ apply =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --server-side == \- ]] + [[ --server-side =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --force-conflicts == \- ]] + [[ --force-conflicts =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl apply --server-side --force-conflicts -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/crd.yaml + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.b1x8QcxMr3 customresourcedefinition.apiextensions.k8s.io/perconaservermongodbbackups.psmdb.percona.com serverside-applied customresourcedefinition.apiextensions.k8s.io/perconaservermongodbclustersyncs.psmdb.percona.com serverside-applied customresourcedefinition.apiextensions.k8s.io/perconaservermongodbrestores.psmdb.percona.com serverside-applied customresourcedefinition.apiextensions.k8s.io/perconaservermongodbs.psmdb.percona.com serverside-applied + cat /tmp/tmp.wD03dk8UqS + rm /tmp/tmp.b1x8QcxMr3 /tmp/tmp.wD03dk8UqS + return 0 + '[' -n psmdb-operator ']' + apply_rbac cw-rbac + local operator_namespace=psmdb-operator + local rbac=cw-rbac + cat /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/cw-rbac.yaml + sed -e 's^namespace: .*^namespace: psmdb-operator^' + kubectl_bin apply -n psmdb-operator -f - ++ mktemp + local LAST_OUT=/tmp/tmp.AdgAtbPGKh ++ mktemp + local LAST_ERR=/tmp/tmp.3vq0dHmiTN + local exit_status=0 + local timeout=4 + local i + args=('apply' '-n' 'psmdb-operator' '-f' '-') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ apply == \- ]] + [[ apply =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -n == \- ]] + [[ -n =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-operator == \- ]] + [[ psmdb-operator =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ - == \- ]] + [[ 4 -gt 0 ]] + [[ -f =~ ^(-f|--filename)$ ]] ++ mktemp + stdin_manifest=/tmp/tmp.zsHPsJTQBJ + cat + transformed_files+=("${stdin_manifest}") + args[$i]=/tmp/tmp.zsHPsJTQBJ + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl apply -n psmdb-operator -f /tmp/tmp.zsHPsJTQBJ + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.AdgAtbPGKh clusterrole.rbac.authorization.k8s.io/percona-server-mongodb-operator created serviceaccount/percona-server-mongodb-operator created clusterrolebinding.rbac.authorization.k8s.io/service-account-percona-server-mongodb-operator created + cat /tmp/tmp.3vq0dHmiTN + rm /tmp/tmp.AdgAtbPGKh /tmp/tmp.3vq0dHmiTN /tmp/tmp.zsHPsJTQBJ + return 0 + add_arch_to_podspecs - + yq eval $'\n\t\t\t(.spec.template.spec.containers[].image = "docker.io/perconalab/percona-server-mongodb-operator:PR-2742-cf134fefe") |\n\t\t\t((.. | select(.[] == "DISABLE_TELEMETRY")) |= .value="true") |\n\t\t\t((.. | select(.[] == "LOG_LEVEL")) |= .value="DEBUG")' /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/deploy/cw-operator.yaml + kubectl_bin apply -n psmdb-operator -f - + arch_scheduling_enabled + [[ -n '' ]] + cat - ++ mktemp + local LAST_OUT=/tmp/tmp.X1MYjMWkLd ++ mktemp + local LAST_ERR=/tmp/tmp.LO3CFR9YBW + local exit_status=0 + local timeout=4 + local i + args=('apply' '-n' 'psmdb-operator' '-f' '-') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ apply == \- ]] + [[ apply =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -n == \- ]] + [[ -n =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-operator == \- ]] + [[ psmdb-operator =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ - == \- ]] + [[ 4 -gt 0 ]] + [[ -f =~ ^(-f|--filename)$ ]] ++ mktemp + stdin_manifest=/tmp/tmp.bAMoWPWsfM + cat + return + transformed_files+=("${stdin_manifest}") + args[$i]=/tmp/tmp.bAMoWPWsfM + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl apply -n psmdb-operator -f /tmp/tmp.bAMoWPWsfM + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.X1MYjMWkLd deployment.apps/percona-server-mongodb-operator created + cat /tmp/tmp.LO3CFR9YBW + rm /tmp/tmp.X1MYjMWkLd /tmp/tmp.LO3CFR9YBW /tmp/tmp.bAMoWPWsfM + return 0 + sleep 20 ++ get_operator_pod ++ kubectl_bin get pods --selector=name=percona-server-mongodb-operator -o 'jsonpath={.items[].metadata.name}' -n psmdb-operator +++ mktemp ++ local LAST_OUT=/tmp/tmp.7kESaMd41T +++ mktemp ++ local LAST_ERR=/tmp/tmp.7ULLULm6Qq ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=percona-server-mongodb-operator' '-o' 'jsonpath={.items[].metadata.name}' '-n' 'psmdb-operator') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=percona-server-mongodb-operator == \- ]] ++ [[ --selector=name=percona-server-mongodb-operator =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -n == \- ]] ++ [[ -n =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-operator == \- ]] ++ [[ psmdb-operator =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=percona-server-mongodb-operator -o 'jsonpath={.items[].metadata.name}' -n psmdb-operator ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.7kESaMd41T ++ cat /tmp/tmp.7ULLULm6Qq ++ rm /tmp/tmp.7kESaMd41T /tmp/tmp.7ULLULm6Qq ++ return 0 + wait_operator_pod percona-server-mongodb-operator-977d8f786-g466w + local pod=percona-server-mongodb-operator-977d8f786-g466w + set +o xtrace waiting for pod/percona-server-mongodb-operator-977d8f786-g466w to be ready.OK + echo 'Print operator info from log' Print operator info from log + grep 'Manager starting up' ++ get_operator_pod ++ kubectl_bin get pods --selector=name=percona-server-mongodb-operator -o 'jsonpath={.items[].metadata.name}' -n psmdb-operator +++ mktemp ++ local LAST_OUT=/tmp/tmp.IXUrkoXsqq +++ mktemp ++ local LAST_ERR=/tmp/tmp.YpoeorHOvD ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=percona-server-mongodb-operator' '-o' 'jsonpath={.items[].metadata.name}' '-n' 'psmdb-operator') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=percona-server-mongodb-operator == \- ]] ++ [[ --selector=name=percona-server-mongodb-operator =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -n == \- ]] ++ [[ -n =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-operator == \- ]] ++ [[ psmdb-operator =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=percona-server-mongodb-operator -o 'jsonpath={.items[].metadata.name}' -n psmdb-operator ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.IXUrkoXsqq ++ cat /tmp/tmp.YpoeorHOvD ++ rm /tmp/tmp.IXUrkoXsqq /tmp/tmp.YpoeorHOvD ++ return 0 + kubectl_bin logs -n psmdb-operator percona-server-mongodb-operator-977d8f786-g466w ++ mktemp + local LAST_OUT=/tmp/tmp.hpVSVntLi1 ++ mktemp + local LAST_ERR=/tmp/tmp.v00CdUHTks + local exit_status=0 + local timeout=4 + local i + args=('logs' '-n' 'psmdb-operator' 'percona-server-mongodb-operator-977d8f786-g466w') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ logs == \- ]] + [[ logs =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -n == \- ]] + [[ -n =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-operator == \- ]] + [[ psmdb-operator =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ percona-server-mongodb-operator-977d8f786-g466w == \- ]] + [[ percona-server-mongodb-operator-977d8f786-g466w =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl logs -n psmdb-operator percona-server-mongodb-operator-977d8f786-g466w + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.hpVSVntLi1 + cat /tmp/tmp.v00CdUHTks + rm /tmp/tmp.hpVSVntLi1 /tmp/tmp.v00CdUHTks + return 0 2026-11-24T09:08:21.185Z INFO setup Manager starting up {"gitCommit": "cf134fefe3b251937747923cc1a37f3d6e0fa43f", "gitBranch": "PR-2742-cf134fefe", "buildTime": "", "goVersion": "go1.27.4", "os": "linux", "arch": "amd64"} + create_namespace custom-users-roles-sharded-25005 + local namespace=custom-users-roles-sharded-25005 + local skip_clean_namespace= + [[ 1 == 1 ]] + [[ -z '' ]] + destroy_chaos_mesh ++ helm list --all-namespaces --filter chaos-mesh ++ tail -n1 ++ awk '-F ' '{print $2}' ++ sed s/NAMESPACE// + local chaos_mesh_ns= + desc 'destroy chaos-mesh' + set +o xtrace ----------------------------------------------------------------------------------- destroy chaos-mesh ----------------------------------------------------------------------------------- + '[' -n '' ']' ++ kubectl get MutatingWebhookConfiguration ++ awk '{print $1}' ++ grep chaos-mesh + timeout 30 kubectl delete MutatingWebhookConfiguration error: resource(s) were provided, but no name was specified + : ++ kubectl get ValidatingWebhookConfiguration ++ grep chaos-mesh ++ awk '{print $1}' + timeout 30 kubectl delete ValidatingWebhookConfiguration error: resource(s) were provided, but no name was specified + : ++ kubectl get ValidatingWebhookConfiguration ++ grep validate-auth ++ awk '{print $1}' + timeout 30 kubectl delete ValidatingWebhookConfiguration error: resource(s) were provided, but no name was specified + : ++ kubectl api-resources ++ grep chaos-mesh ++ awk '{print $1}' ++ kubectl get crd ++ awk '{print $1}' ++ grep chaos-mesh.org + timeout 30 kubectl delete crd error: resource(s) were provided, but no name was specified + : ++ kubectl get clusterrolebinding ++ grep chaos-mesh ++ awk '{print $1}' + timeout 30 kubectl delete clusterrolebinding error: resource(s) were provided, but no name was specified + : ++ kubectl get clusterrole ++ grep chaos-mesh ++ awk '{print $1}' + timeout 30 kubectl delete clusterrole error: resource(s) were provided, but no name was specified + : + desc 'cleaned up all old namespaces' + set +o xtrace ----------------------------------------------------------------------------------- cleaned up all old namespaces ----------------------------------------------------------------------------------- + local 'ns_filter=^kube-|^default|Terminating|psmdb-operator|openshift|^gke-|^gmp-|^NAME' + [[ -n '' ]] + kubectl_bin get ns + grep -E -v '^kube-|^default|Terminating|psmdb-operator|openshift|^gke-|^gmp-|^NAME' + awk '{print$1}' + xargs kubectl delete ns + [[ -n '' ]] + desc 'cleaned up old namespaces custom-users-roles-sharded-25005' + set +o xtrace ----------------------------------------------------------------------------------- cleaned up old namespaces custom-users-roles-sharded-25005 ----------------------------------------------------------------------------------- + kubectl_bin delete namespace custom-users-roles-sharded-25005 --ignore-not-found ++ mktemp ++ mktemp + local LAST_OUT=/tmp/tmp.32vF9ebycM + local LAST_OUT=/tmp/tmp.W4tGrrwHTH ++ mktemp + local LAST_ERR=/tmp/tmp.UwJmsR2b8h + local exit_status=0 + local timeout=4 + local i + args=('get' 'ns') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ get == \- ]] + [[ get =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ ns == \- ]] + [[ ns =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ mktemp ++ seq 0 9 + local LAST_ERR=/tmp/tmp.AWyvVXI0AV + local exit_status=0 + local timeout=4 + local i + args=('delete' 'namespace' 'custom-users-roles-sharded-25005' '--ignore-not-found') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ delete == \- ]] + [[ delete =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ namespace == \- ]] + [[ namespace =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ custom-users-roles-sharded-25005 == \- ]] + [[ custom-users-roles-sharded-25005 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --ignore-not-found == \- ]] + [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl get ns + for attempt in $(seq 0 9) + set +e + kubectl delete namespace custom-users-roles-sharded-25005 --ignore-not-found + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.32vF9ebycM + cat /tmp/tmp.UwJmsR2b8h + rm /tmp/tmp.32vF9ebycM /tmp/tmp.UwJmsR2b8h + return 0 error: resource(s) were provided, but no name was specified + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.W4tGrrwHTH + cat /tmp/tmp.AWyvVXI0AV + rm /tmp/tmp.W4tGrrwHTH /tmp/tmp.AWyvVXI0AV + return 0 + kubectl_bin wait --for=delete namespace custom-users-roles-sharded-25005 ++ mktemp + local LAST_OUT=/tmp/tmp.enMqQ6kGlt ++ mktemp + local LAST_ERR=/tmp/tmp.H1H7ZzWUR0 + local exit_status=0 + local timeout=4 + local i + args=('wait' '--for=delete' 'namespace' 'custom-users-roles-sharded-25005') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ wait == \- ]] + [[ wait =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --for=delete == \- ]] + [[ --for=delete =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ namespace == \- ]] + [[ namespace =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ custom-users-roles-sharded-25005 == \- ]] + [[ custom-users-roles-sharded-25005 =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl wait --for=delete namespace custom-users-roles-sharded-25005 + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.enMqQ6kGlt + cat /tmp/tmp.H1H7ZzWUR0 + rm /tmp/tmp.enMqQ6kGlt /tmp/tmp.H1H7ZzWUR0 + return 0 + desc 'create namespace custom-users-roles-sharded-25005' + set +o xtrace ----------------------------------------------------------------------------------- create namespace custom-users-roles-sharded-25005 ----------------------------------------------------------------------------------- + kubectl_bin create namespace custom-users-roles-sharded-25005 ++ mktemp + local LAST_OUT=/tmp/tmp.1SQV1lJNTT ++ mktemp + local LAST_ERR=/tmp/tmp.JI8lg6Zk2O + local exit_status=0 + local timeout=4 + local i + args=('create' 'namespace' 'custom-users-roles-sharded-25005') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ create == \- ]] + [[ create =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ namespace == \- ]] + [[ namespace =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ custom-users-roles-sharded-25005 == \- ]] + [[ custom-users-roles-sharded-25005 =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl create namespace custom-users-roles-sharded-25005 + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.1SQV1lJNTT namespace/custom-users-roles-sharded-25005 created + cat /tmp/tmp.JI8lg6Zk2O + rm /tmp/tmp.1SQV1lJNTT /tmp/tmp.JI8lg6Zk2O + return 0 + set_kube_ctx custom-users-roles-sharded-25005 + local namespace=custom-users-roles-sharded-25005 ++ kubectl_bin config current-context +++ mktemp ++ local LAST_OUT=/tmp/tmp.HcwUCR0bEz +++ mktemp ++ local LAST_ERR=/tmp/tmp.23iallHWkW ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('config' 'current-context') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ config == \- ]] ++ [[ config =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ current-context == \- ]] ++ [[ current-context =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl config current-context ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.HcwUCR0bEz ++ cat /tmp/tmp.23iallHWkW ++ rm /tmp/tmp.HcwUCR0bEz /tmp/tmp.23iallHWkW ++ return 0 + kubectl_bin config set-context gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9 --namespace=custom-users-roles-sharded-25005 ++ mktemp + local LAST_OUT=/tmp/tmp.P455YrJa7G ++ mktemp + local LAST_ERR=/tmp/tmp.rgSB2OiG6l + local exit_status=0 + local timeout=4 + local i + args=('config' 'set-context' 'gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9' '--namespace=custom-users-roles-sharded-25005') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ config == \- ]] + [[ config =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ set-context == \- ]] + [[ set-context =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9 == \- ]] + [[ gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --namespace=custom-users-roles-sharded-25005 == \- ]] + [[ --namespace=custom-users-roles-sharded-25005 =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl config set-context gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9 --namespace=custom-users-roles-sharded-25005 + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.P455YrJa7G Context "gke_cloud-dev-112233_us-central1-a_jen-psmdb-2742-cf134fefe-2-cluster9" modified. + cat /tmp/tmp.rgSB2OiG6l + rm /tmp/tmp.P455YrJa7G /tmp/tmp.rgSB2OiG6l + return 0 + mongosUri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + desc 'create secrets' + set +o xtrace ----------------------------------------------------------------------------------- create secrets ----------------------------------------------------------------------------------- + kubectl_bin apply -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/secrets.yml -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/conf/app-user-secrets.yml ++ mktemp + local LAST_OUT=/tmp/tmp.EC7Z21abyh ++ mktemp + local LAST_ERR=/tmp/tmp.hyKRMzOPIq + local exit_status=0 + local timeout=4 + local i + args=('apply' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/secrets.yml' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/conf/app-user-secrets.yml') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ apply == \- ]] + [[ apply =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/secrets.yml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/secrets.yml =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/conf/app-user-secrets.yml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/conf/app-user-secrets.yml =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl apply -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/secrets.yml -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/conf/app-user-secrets.yml + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.EC7Z21abyh secret/some-users created secret/user-one created secret/user-two created + cat /tmp/tmp.hyKRMzOPIq + rm /tmp/tmp.EC7Z21abyh /tmp/tmp.hyKRMzOPIq + return 0 + apply_s3_storage_secrets + desc 'create secrets for cloud storages' + set +o xtrace ----------------------------------------------------------------------------------- create secrets for cloud storages ----------------------------------------------------------------------------------- + '[' -z '' ']' + kubectl_bin apply -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/s3-secret.yml -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/cloud-secret.yml ++ mktemp + local LAST_OUT=/tmp/tmp.qTnqzLL5BX ++ mktemp + local LAST_ERR=/tmp/tmp.n3vRV1s52H + local exit_status=0 + local timeout=4 + local i + args=('apply' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/s3-secret.yml' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/cloud-secret.yml') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ apply == \- ]] + [[ apply =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/s3-secret.yml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/s3-secret.yml =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/cloud-secret.yml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/cloud-secret.yml =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl apply -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/s3-secret.yml -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/cloud-secret.yml + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.qTnqzLL5BX secret/s3-secret created secret/aws-s3-secret created secret/alibaba-cloud-secret created secret/oci-secret created secret/gcp-cs-secret created secret/azure-secret created secret/gcp-cs-sa-key-secret created + cat /tmp/tmp.n3vRV1s52H + rm /tmp/tmp.qTnqzLL5BX /tmp/tmp.n3vRV1s52H + return 0 + create_runtime_class + kubectl_bin delete runtimeclass container-rc --ignore-not-found ++ mktemp + local LAST_OUT=/tmp/tmp.7bXEusisEN ++ mktemp + local LAST_ERR=/tmp/tmp.YkOu7ZJN4c + local exit_status=0 + local timeout=4 + local i + args=('delete' 'runtimeclass' 'container-rc' '--ignore-not-found') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ delete == \- ]] + [[ delete =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ runtimeclass == \- ]] + [[ runtimeclass =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ container-rc == \- ]] + [[ container-rc =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --ignore-not-found == \- ]] + [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl delete runtimeclass container-rc --ignore-not-found + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.7bXEusisEN + cat /tmp/tmp.YkOu7ZJN4c + rm /tmp/tmp.7bXEusisEN /tmp/tmp.YkOu7ZJN4c + return 0 + local handler=runc + desc 'Create RuntimeClass with handler runc' + set +o xtrace ----------------------------------------------------------------------------------- Create RuntimeClass with handler runc ----------------------------------------------------------------------------------- + kubectl_bin apply -f - + yq eval '.handler = "runc"' /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/container-rc.yaml ++ mktemp + local LAST_OUT=/tmp/tmp.E94RZq9LCa ++ mktemp + local LAST_ERR=/tmp/tmp.9s3c5HfOh6 + local exit_status=0 + local timeout=4 + local i + args=('apply' '-f' '-') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ apply == \- ]] + [[ apply =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ - == \- ]] + [[ 2 -gt 0 ]] + [[ -f =~ ^(-f|--filename)$ ]] ++ mktemp + stdin_manifest=/tmp/tmp.BqXmfDxNwz + cat + transformed_files+=("${stdin_manifest}") + args[$i]=/tmp/tmp.BqXmfDxNwz + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl apply -f /tmp/tmp.BqXmfDxNwz + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.E94RZq9LCa runtimeclass.node.k8s.io/container-rc created + cat /tmp/tmp.9s3c5HfOh6 + rm /tmp/tmp.E94RZq9LCa /tmp/tmp.9s3c5HfOh6 /tmp/tmp.BqXmfDxNwz + return 0 + desc 'create first PSMDB cluster' + set +o xtrace ----------------------------------------------------------------------------------- create first PSMDB cluster ----------------------------------------------------------------------------------- + apply_cluster /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/conf/some-name-rs0.yml + '[' -z '' ']' + cat_config /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/conf/some-name-rs0.yml + kubectl_bin apply -f - + cat /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/conf/some-name-rs0.yml + yq eval '(.spec | select(.image == null)).image = "docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3"' + yq eval '(.spec | select(has("pmm"))).pmm.image = "docker.io/perconalab/pmm-client:3-dev-latest"' ++ mktemp + yq eval '(.spec | select(has("initImage"))).initImage = "docker.io/perconalab/percona-server-mongodb-operator:PR-2742-cf134fefe"' + yq eval '(.spec | select(has("backup"))).backup.image = "docker.io/perconalab/percona-server-mongodb-operator:main-backup"' + [[ -n docker.io/perconalab/fluentbit:main-logcollector ]] + yq eval '(.spec | select(has("search"))).search.image = "docker.io/perconalab/percona-server-mongodb-operator:main-mongot"' + IMAGE_LOGCOLLECTOR=docker.io/perconalab/fluentbit:main-logcollector + yq eval '(.spec | select(has("logcollector"))).logcollector.image = strenv(IMAGE_LOGCOLLECTOR)' + /usr/sbin/sed -e s/NAME_SPACE/custom-users-roles-sharded-25005/g + local LAST_OUT=/tmp/tmp.uDq61ft7S8 + yq eval '.spec.upgradeOptions.apply="Never"' + add_arch_to_psmdb - + arch_scheduling_enabled + [[ -n '' ]] + cat - ++ mktemp + local LAST_ERR=/tmp/tmp.vSdNi6ynLe + local exit_status=0 + local timeout=4 + local i + args=('apply' '-f' '-') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ apply == \- ]] + [[ apply =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ - == \- ]] + [[ 2 -gt 0 ]] + [[ -f =~ ^(-f|--filename)$ ]] ++ mktemp + stdin_manifest=/tmp/tmp.i1Ppp7ACLh + cat + return + transformed_files+=("${stdin_manifest}") + args[$i]=/tmp/tmp.i1Ppp7ACLh + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl apply -f /tmp/tmp.i1Ppp7ACLh + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.uDq61ft7S8 perconaservermongodb.psmdb.percona.com/some-name created + cat /tmp/tmp.vSdNi6ynLe + rm /tmp/tmp.uDq61ft7S8 /tmp/tmp.vSdNi6ynLe /tmp/tmp.i1Ppp7ACLh + return 0 + desc 'check if all 3 Pods started' + set +o xtrace ----------------------------------------------------------------------------------- check if all 3 Pods started ----------------------------------------------------------------------------------- + wait_for_running some-name-rs0 3 + local name=some-name-rs0 + let last_pod=2 + local check_cluster_readiness=true + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=rs0 + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-rs0-0 + local pod=some-name-rs0-0 + set +o xtrace waiting for pod/some-name-rs0-0 to be ready....................OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-rs0-1 + local pod=some-name-rs0-1 + set +o xtrace waiting for pod/some-name-rs0-1 to be ready...............OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.gf7lEgRGmT +++ mktemp ++ local LAST_ERR=/tmp/tmp.WjuFagtNbM ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.gf7lEgRGmT ++ cat /tmp/tmp.WjuFagtNbM ++ rm /tmp/tmp.gf7lEgRGmT /tmp/tmp.WjuFagtNbM ++ return 0 + [[ '' == true ]] + wait_pod some-name-rs0-2 + local pod=some-name-rs0-2 + set +o xtrace waiting for pod/some-name-rs0-2 to be ready...................OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.xGjAntlfCJ +++ mktemp ++ local LAST_ERR=/tmp/tmp.rN76vfcVPS ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.xGjAntlfCJ ++ cat /tmp/tmp.rN76vfcVPS ++ rm /tmp/tmp.xGjAntlfCJ /tmp/tmp.rN76vfcVPS ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.H1MuYb35qa +++ mktemp ++ local LAST_ERR=/tmp/tmp.dwvzOTE2WX ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.H1MuYb35qa ++ cat /tmp/tmp.dwvzOTE2WX ++ rm /tmp/tmp.H1MuYb35qa /tmp/tmp.dwvzOTE2WX ++ return 0 + [[ '' == true ]] + sleep 10 + [[ true == true ]] + set +x Waiting for cluster some-name to be ready........... + wait_for_running some-name-cfg 3 false + local name=some-name-cfg + let last_pod=2 + local check_cluster_readiness=false + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=cfg + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-cfg-0 + local pod=some-name-cfg-0 + set +o xtrace waiting for pod/some-name-cfg-0 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-cfg-1 + local pod=some-name-cfg-1 + set +o xtrace waiting for pod/some-name-cfg-1 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="cfg")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.rfBe0or7BU +++ mktemp ++ local LAST_ERR=/tmp/tmp.sRP83gLr1v ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="cfg")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="cfg")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="cfg")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="cfg")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.rfBe0or7BU ++ cat /tmp/tmp.sRP83gLr1v ++ rm /tmp/tmp.rfBe0or7BU /tmp/tmp.sRP83gLr1v ++ return 0 + [[ '' == true ]] + wait_pod some-name-cfg-2 + local pod=some-name-cfg-2 + set +o xtrace waiting for pod/some-name-cfg-2 to be ready.OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="cfg")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.SpkyIN7ZsS +++ mktemp ++ local LAST_ERR=/tmp/tmp.i5O1FvCpzF ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="cfg")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="cfg")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="cfg")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="cfg")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.SpkyIN7ZsS ++ cat /tmp/tmp.i5O1FvCpzF ++ rm /tmp/tmp.SpkyIN7ZsS /tmp/tmp.i5O1FvCpzF ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="cfg")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.dQuvkSUQmk +++ mktemp ++ local LAST_ERR=/tmp/tmp.uiOnLDFIJ9 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="cfg")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="cfg")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="cfg")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="cfg")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.dQuvkSUQmk ++ cat /tmp/tmp.uiOnLDFIJ9 ++ rm /tmp/tmp.dQuvkSUQmk /tmp/tmp.uiOnLDFIJ9 ++ return 0 + [[ '' == true ]] + sleep 10 + [[ false == true ]] + wait_for_running some-name-mongos 3 + local name=some-name-mongos + let last_pod=2 + local check_cluster_readiness=true + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=mongos + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-mongos-0 + local pod=some-name-mongos-0 + set +o xtrace waiting for pod/some-name-mongos-0 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-mongos-1 + local pod=some-name-mongos-1 + set +o xtrace waiting for pod/some-name-mongos-1 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="mongos")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.5k16haNJlH +++ mktemp ++ local LAST_ERR=/tmp/tmp.p0Yciu6TXA ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="mongos")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="mongos")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="mongos")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="mongos")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.5k16haNJlH ++ cat /tmp/tmp.p0Yciu6TXA ++ rm /tmp/tmp.5k16haNJlH /tmp/tmp.p0Yciu6TXA ++ return 0 + [[ '' == true ]] + wait_pod some-name-mongos-2 + local pod=some-name-mongos-2 + set +o xtrace waiting for pod/some-name-mongos-2 to be ready.OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="mongos")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.6mmfc5Zkzr +++ mktemp ++ local LAST_ERR=/tmp/tmp.7nS8TbwgcO ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="mongos")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="mongos")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="mongos")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="mongos")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.6mmfc5Zkzr ++ cat /tmp/tmp.7nS8TbwgcO ++ rm /tmp/tmp.6mmfc5Zkzr /tmp/tmp.7nS8TbwgcO ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="mongos")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.9L8PDhtOM7 +++ mktemp ++ local LAST_ERR=/tmp/tmp.zkuU3JD7S2 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="mongos")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="mongos")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="mongos")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="mongos")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.9L8PDhtOM7 ++ cat /tmp/tmp.zkuU3JD7S2 ++ rm /tmp/tmp.9L8PDhtOM7 /tmp/tmp.zkuU3JD7S2 ++ return 0 + [[ '' == true ]] + sleep 10 + [[ true == true ]] + set +x Waiting for cluster some-name to be ready + wait_cluster_consistency some-name + local cluster_name=some-name + local wait_time=32 + retry=0 + sleep 7 + echo -n 'waiting for cluster some-name to be ready' waiting for cluster some-name to be ready++ kubectl_bin get psmdb some-name -o 'jsonpath={.status.state}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.IDIIFnCbZA +++ mktemp ++ local LAST_ERR=/tmp/tmp.ESMv0X2xM1 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.status.state}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.status.state} == \- ]] ++ [[ jsonpath={.status.state} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.status.state}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.IDIIFnCbZA ++ cat /tmp/tmp.ESMv0X2xM1 ++ rm /tmp/tmp.IDIIFnCbZA /tmp/tmp.ESMv0X2xM1 ++ return 0 + [[ ready == ready ]] + echo .OK .OK + desc 'start client' + set +o xtrace ----------------------------------------------------------------------------------- start client ----------------------------------------------------------------------------------- + kubectl_bin apply -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/client_with_tls.yml ++ mktemp + local LAST_OUT=/tmp/tmp.hXQ4Qbhkg0 ++ mktemp + local LAST_ERR=/tmp/tmp.eIrFKojsro + local exit_status=0 + local timeout=4 + local i + args=('apply' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/client_with_tls.yml') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ apply == \- ]] + [[ apply =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -f == \- ]] + [[ -f =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/client_with_tls.yml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/client_with_tls.yml =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl apply -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/conf/client_with_tls.yml + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.hXQ4Qbhkg0 deployment.apps/psmdb-client created + cat /tmp/tmp.eIrFKojsro + rm /tmp/tmp.hXQ4Qbhkg0 /tmp/tmp.eIrFKojsro + return 0 + kubectl_bin rollout status deployment/psmdb-client --timeout=360s ++ mktemp + local LAST_OUT=/tmp/tmp.S0bakyjR36 ++ mktemp + local LAST_ERR=/tmp/tmp.lxTsFbsUpQ + local exit_status=0 + local timeout=4 + local i + args=('rollout' 'status' 'deployment/psmdb-client' '--timeout=360s') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ rollout == \- ]] + [[ rollout =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ status == \- ]] + [[ status =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ deployment/psmdb-client == \- ]] + [[ deployment/psmdb-client =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --timeout=360s == \- ]] + [[ --timeout=360s =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl rollout status deployment/psmdb-client --timeout=360s + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.S0bakyjR36 Waiting for deployment "psmdb-client" rollout to finish: 0 of 1 updated replicas are available... deployment "psmdb-client" successfully rolled out + cat /tmp/tmp.lxTsFbsUpQ + rm /tmp/tmp.S0bakyjR36 /tmp/tmp.lxTsFbsUpQ + return 0 + desc 'check database admin connection strings' + set +o xtrace ----------------------------------------------------------------------------------- check database admin connection strings ----------------------------------------------------------------------------------- + retry 60 2 check_connection_strings some-name-databaseadmin-conn-str databaseAdmin_rs0 databaseAdmin_cfg + local max=60 + local delay=2 + shift 2 + local n=1 + check_connection_strings some-name-databaseadmin-conn-str databaseAdmin_rs0 databaseAdmin_cfg + local secret_name=some-name-databaseadmin-conn-str + shift + local key_prefix + local data_keys + local data_key ++ kubectl_bin get secret some-name-databaseadmin-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.XPK3TKRMse +++ mktemp ++ local LAST_ERR=/tmp/tmp.0mxl5n531l ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'some-name-databaseadmin-conn-str' '-o' 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name-databaseadmin-conn-str == \- ]] ++ [[ some-name-databaseadmin-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} == \- ]] ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret some-name-databaseadmin-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.XPK3TKRMse ++ cat /tmp/tmp.0mxl5n531l ++ rm /tmp/tmp.XPK3TKRMse /tmp/tmp.0mxl5n531l ++ return 0 + data_keys=$'databaseAdmin_cfg_connectionString\ndatabaseAdmin_cfg_connectionStringSrv\ndatabaseAdmin_mongos_connectionString\ndatabaseAdmin_rs0_connectionString\ndatabaseAdmin_rs0_connectionStringSrv' + '[' -z $'databaseAdmin_cfg_connectionString\ndatabaseAdmin_cfg_connectionStringSrv\ndatabaseAdmin_mongos_connectionString\ndatabaseAdmin_rs0_connectionString\ndatabaseAdmin_rs0_connectionStringSrv' ']' + for key_prefix in "$@" + grep -Fxq databaseAdmin_rs0_connectionString + grep -Fxq databaseAdmin_rs0_connectionStringSrv + for key_prefix in "$@" + grep -Fxq databaseAdmin_cfg_connectionString + grep -Fxq databaseAdmin_cfg_connectionStringSrv + IFS= + read -r data_key + '[' -z databaseAdmin_cfg_connectionString ']' + check_connection_string some-name-databaseadmin-conn-str databaseAdmin_cfg_connectionString + local secret_name=some-name-databaseadmin-conn-str + local data_key=databaseAdmin_cfg_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret some-name-databaseadmin-conn-str -o 'go-template={{index .data "databaseAdmin_cfg_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.bMasKuir7R +++ mktemp ++ local LAST_ERR=/tmp/tmp.UMDS3cI2me ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'some-name-databaseadmin-conn-str' '-o' 'go-template={{index .data "databaseAdmin_cfg_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name-databaseadmin-conn-str == \- ]] ++ [[ some-name-databaseadmin-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "databaseAdmin_cfg_connectionString"}} == \- ]] ++ [[ go-template={{index .data "databaseAdmin_cfg_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret some-name-databaseadmin-conn-str -o 'go-template={{index .data "databaseAdmin_cfg_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.bMasKuir7R ++ cat /tmp/tmp.UMDS3cI2me ++ rm /tmp/tmp.bMasKuir7R /tmp/tmp.UMDS3cI2me ++ return 0 + connection_string='mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=cfg&tls=true' + '[' -z 'mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=cfg&tls=true' ']' + [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=cfg&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.zmVMDvizxp +++ mktemp ++ local LAST_ERR=/tmp/tmp.WBUuQyfWD1 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.zmVMDvizxp ++ cat /tmp/tmp.WBUuQyfWD1 ++ rm /tmp/tmp.zmVMDvizxp /tmp/tmp.WBUuQyfWD1 ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=cfg&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.BHYdnAK4yf +++ mktemp ++ local LAST_ERR=/tmp/tmp.szhvRGgZcO ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=cfg&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=cfg&tls=true == \- ]] ++ [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=cfg&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=cfg&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.BHYdnAK4yf ++ cat /tmp/tmp.szhvRGgZcO ++ rm /tmp/tmp.BHYdnAK4yf /tmp/tmp.szhvRGgZcO ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + '[' -z databaseAdmin_cfg_connectionStringSrv ']' + check_connection_string some-name-databaseadmin-conn-str databaseAdmin_cfg_connectionStringSrv + local secret_name=some-name-databaseadmin-conn-str + local data_key=databaseAdmin_cfg_connectionStringSrv + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret some-name-databaseadmin-conn-str -o 'go-template={{index .data "databaseAdmin_cfg_connectionStringSrv"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.g10m22JXw3 +++ mktemp ++ local LAST_ERR=/tmp/tmp.eK6U3AB0Kq ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'some-name-databaseadmin-conn-str' '-o' 'go-template={{index .data "databaseAdmin_cfg_connectionStringSrv"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name-databaseadmin-conn-str == \- ]] ++ [[ some-name-databaseadmin-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "databaseAdmin_cfg_connectionStringSrv"}} == \- ]] ++ [[ go-template={{index .data "databaseAdmin_cfg_connectionStringSrv"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret some-name-databaseadmin-conn-str -o 'go-template={{index .data "databaseAdmin_cfg_connectionStringSrv"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.g10m22JXw3 ++ cat /tmp/tmp.eK6U3AB0Kq ++ rm /tmp/tmp.g10m22JXw3 /tmp/tmp.eK6U3AB0Kq ++ return 0 + connection_string='mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=cfg' + '[' -z 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=cfg' ']' + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=cfg == *tls\=true* ]] + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=cfg == *ssl\=true* ]] + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=cfg == mongodb+srv://* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.TTr7uB5iRh +++ mktemp ++ local LAST_ERR=/tmp/tmp.YaOh9CT3Mz ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.TTr7uB5iRh ++ cat /tmp/tmp.YaOh9CT3Mz ++ rm /tmp/tmp.TTr7uB5iRh /tmp/tmp.YaOh9CT3Mz ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=cfg' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.FMhxKgNETM +++ mktemp ++ local LAST_ERR=/tmp/tmp.VK7pX8mlSo ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=cfg' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=cfg == \- ]] ++ [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=cfg =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=cfg' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.FMhxKgNETM ++ cat /tmp/tmp.VK7pX8mlSo ++ rm /tmp/tmp.FMhxKgNETM /tmp/tmp.VK7pX8mlSo ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + '[' -z databaseAdmin_mongos_connectionString ']' + check_connection_string some-name-databaseadmin-conn-str databaseAdmin_mongos_connectionString + local secret_name=some-name-databaseadmin-conn-str + local data_key=databaseAdmin_mongos_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret some-name-databaseadmin-conn-str -o 'go-template={{index .data "databaseAdmin_mongos_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.bKGVZSJb47 +++ mktemp ++ local LAST_ERR=/tmp/tmp.T3sSD9dtwd ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'some-name-databaseadmin-conn-str' '-o' 'go-template={{index .data "databaseAdmin_mongos_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name-databaseadmin-conn-str == \- ]] ++ [[ some-name-databaseadmin-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "databaseAdmin_mongos_connectionString"}} == \- ]] ++ [[ go-template={{index .data "databaseAdmin_mongos_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret some-name-databaseadmin-conn-str -o 'go-template={{index .data "databaseAdmin_mongos_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.bKGVZSJb47 ++ cat /tmp/tmp.T3sSD9dtwd ++ rm /tmp/tmp.bKGVZSJb47 /tmp/tmp.T3sSD9dtwd ++ return 0 + connection_string='mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.lSDOrAPX5O +++ mktemp ++ local LAST_ERR=/tmp/tmp.565pHRsCWx ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.lSDOrAPX5O ++ cat /tmp/tmp.565pHRsCWx ++ rm /tmp/tmp.lSDOrAPX5O /tmp/tmp.565pHRsCWx ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ grep -E -v 'I NETWORK|W 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:' ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' +++ mktemp ++ local LAST_OUT=/tmp/tmp.FuhB439JOl +++ mktemp ++ local LAST_ERR=/tmp/tmp.D5S4fahuVl ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.FuhB439JOl ++ cat /tmp/tmp.D5S4fahuVl ++ rm /tmp/tmp.FuhB439JOl /tmp/tmp.D5S4fahuVl ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + '[' -z databaseAdmin_rs0_connectionString ']' + check_connection_string some-name-databaseadmin-conn-str databaseAdmin_rs0_connectionString + local secret_name=some-name-databaseadmin-conn-str + local data_key=databaseAdmin_rs0_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret some-name-databaseadmin-conn-str -o 'go-template={{index .data "databaseAdmin_rs0_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.jyN9jrIjOw +++ mktemp ++ local LAST_ERR=/tmp/tmp.bCR1ySr3tJ ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'some-name-databaseadmin-conn-str' '-o' 'go-template={{index .data "databaseAdmin_rs0_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name-databaseadmin-conn-str == \- ]] ++ [[ some-name-databaseadmin-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "databaseAdmin_rs0_connectionString"}} == \- ]] ++ [[ go-template={{index .data "databaseAdmin_rs0_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret some-name-databaseadmin-conn-str -o 'go-template={{index .data "databaseAdmin_rs0_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.jyN9jrIjOw ++ cat /tmp/tmp.bCR1ySr3tJ ++ rm /tmp/tmp.jyN9jrIjOw /tmp/tmp.bCR1ySr3tJ ++ return 0 + connection_string='mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=rs0&tls=true' + '[' -z 'mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=rs0&tls=true' ']' + [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=rs0&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.KofeceR9GW +++ mktemp ++ local LAST_ERR=/tmp/tmp.4x4rcRU3Gy ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.KofeceR9GW ++ cat /tmp/tmp.4x4rcRU3Gy ++ rm /tmp/tmp.KofeceR9GW /tmp/tmp.4x4rcRU3Gy ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=rs0&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.liacEHvC3j +++ mktemp ++ local LAST_ERR=/tmp/tmp.L9L4tY0eWK ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=rs0&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=rs0&tls=true == \- ]] ++ [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=rs0&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&replicaSet=rs0&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.liacEHvC3j ++ cat /tmp/tmp.L9L4tY0eWK ++ rm /tmp/tmp.liacEHvC3j /tmp/tmp.L9L4tY0eWK ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + '[' -z databaseAdmin_rs0_connectionStringSrv ']' + check_connection_string some-name-databaseadmin-conn-str databaseAdmin_rs0_connectionStringSrv + local secret_name=some-name-databaseadmin-conn-str + local data_key=databaseAdmin_rs0_connectionStringSrv + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret some-name-databaseadmin-conn-str -o 'go-template={{index .data "databaseAdmin_rs0_connectionStringSrv"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.PmWMI1QOGs +++ mktemp ++ local LAST_ERR=/tmp/tmp.LbxVSKhgBc ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'some-name-databaseadmin-conn-str' '-o' 'go-template={{index .data "databaseAdmin_rs0_connectionStringSrv"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name-databaseadmin-conn-str == \- ]] ++ [[ some-name-databaseadmin-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "databaseAdmin_rs0_connectionStringSrv"}} == \- ]] ++ [[ go-template={{index .data "databaseAdmin_rs0_connectionStringSrv"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret some-name-databaseadmin-conn-str -o 'go-template={{index .data "databaseAdmin_rs0_connectionStringSrv"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.PmWMI1QOGs ++ cat /tmp/tmp.LbxVSKhgBc ++ rm /tmp/tmp.PmWMI1QOGs /tmp/tmp.LbxVSKhgBc ++ return 0 + connection_string='mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=rs0' + '[' -z 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=rs0' ']' + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=rs0 == *tls\=true* ]] + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=rs0 == *ssl\=true* ]] + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=rs0 == mongodb+srv://* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.fRlU7Pq50m +++ mktemp ++ local LAST_ERR=/tmp/tmp.fqwRWQ0n2j ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.fRlU7Pq50m ++ cat /tmp/tmp.fqwRWQ0n2j ++ rm /tmp/tmp.fRlU7Pq50m /tmp/tmp.fqwRWQ0n2j ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ grep -E -v 'I NETWORK|W 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:' ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=rs0' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' +++ mktemp ++ local LAST_OUT=/tmp/tmp.M2R4cWIoq7 +++ mktemp ++ local LAST_ERR=/tmp/tmp.l8UIqmLW0r ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=rs0' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=rs0 == \- ]] ++ [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=rs0 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-25005.svc.cluster.local/?authSource=admin&replicaSet=rs0' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.M2R4cWIoq7 ++ cat /tmp/tmp.l8UIqmLW0r ++ rm /tmp/tmp.M2R4cWIoq7 /tmp/tmp.l8UIqmLW0r ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + desc 'check if service and statefulset created with expected config' + set +o xtrace ----------------------------------------------------------------------------------- check if service and statefulset created with expected config ----------------------------------------------------------------------------------- + compare_kubectl statefulset/some-name-rs0 + local resource=statefulset/some-name-rs0 + local postfix= + local skip_generation_check= + local expected_result=/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-rs0.yml + local new_result=/tmp/tmp.EvydOaBbs1/statefulset_some-name-rs0.yml + [[ -n '' ]] + yq eval $'\n\t\t\tdel(.metadata.ownerReferences[].apiVersion) |\n\t\t\tdel(.metadata.managedFields) |\n\t\t\tdel(.. | select(has("creationTimestamp")).creationTimestamp) |\n\t\t\tdel(.. | select(has("namespace")).namespace) |\n\t\t\tdel(.. | select(has("uid")).uid) |\n\t\t\tdel(.metadata.resourceVersion) |\n\t\t\tdel(.spec.template.spec.containers[].env[] | select(.name == "NAMESPACE")) |\n\t\t\tdel(.metadata.selfLink) |\n\t\t\tdel(.metadata.annotations."cloud.google.com/neg") |\n\t\t\tdel(.metadata.annotations."field.cattle.io/publicEndpoints") |\n\t\t\tdel(.metadata.annotations."metallb.io/ip-allocated-from-pool") |\n\t\t\tdel(.metadata.annotations."networking.gke.io/target-pool") |\n\t\t\tdel(.metadata.annotations."kubectl.kubernetes.io/last-applied-configuration") |\n\t\t\tdel(.. | select(has("image")).image) |\n\t\t\tdel(.. | select(has("clusterIP")).clusterIP) |\n\t\t\tdel(.. | select(has("clusterIPs")).clusterIPs) |\n\t\t\tdel(.. | select(has("dataSource")).dataSource) |\n\t\t\tdel(.. | select(has("procMount")).procMount) |\n\t\t\tdel(.. | select(has("storageClassName")).storageClassName) |\n\t\t\tdel(.. | select(has("finalizers")).finalizers) |\n\t\t\tdel(.. | select(has("kubernetes.io/pvc-protection"))."kubernetes.io/pvc-protection") |\n\t\t\tdel(.. | select(has("volumeName")).volumeName) |\n\t\t\tdel(.. | select(has("volume.beta.kubernetes.io/storage-provisioner"))."volume.beta.kubernetes.io/storage-provisioner") |\n\t\t\tdel(.. | select(has("volume.kubernetes.io/storage-provisioner"))."volume.kubernetes.io/storage-provisioner") |\n\t\t\tdel(.spec.volumeMode) |\n\t\t\tdel(.. | select(has("volume.kubernetes.io/selected-node"))."volume.kubernetes.io/selected-node") |\n\t\t\tdel(.. | select(has("percona.com/last-config-hash"))."percona.com/last-config-hash") |\n\t\t\tdel(.. | select(has("percona.com/configuration-hash"))."percona.com/configuration-hash") |\n\t\t\tdel(.. | select(has("percona.com/ssl-hash"))."percona.com/ssl-hash") |\n\t\t\tdel(.. | select(has("percona.com/ssl-internal-hash"))."percona.com/ssl-internal-hash") |\n\t\t\tdel(.. | select(has("percona.com/pbm-tls-hash"))."percona.com/pbm-tls-hash") |\n\t\t\tdel(.spec.volumeClaimTemplates[].spec.volumeMode | select(. == "Filesystem")) |\n\t\t\tdel(.. | select(has("healthCheckNodePort")).healthCheckNodePort) |\n\t\t\tdel(.. | select(has("nodePort")).nodePort) |\n\t\t\tdel(.status) |\n\t\t\t(.. | select(tag == "!!str")) |= sub("custom-users-roles-sharded-25005", "NAME_SPACE") |\n\t\t\tdel(.spec.volumeClaimTemplates[].apiVersion) |\n\t\t\tdel(.spec.volumeClaimTemplates[].kind) |\n\t\t\tdel(.spec.ipFamilies) |\n\t\t\tdel(.spec.ipFamilyPolicy) |\n\t\t\t(.. | select(. == "extensions/v1beta1")) = "apps/v1" |\n\t\t\t(.. | select(. == "batch/v1beta1")) = "batch/v1" ' - + kubectl_bin get -o yaml statefulset/some-name-rs0 ++ mktemp + local LAST_OUT=/tmp/tmp.qaf6VP5knm ++ mktemp + local LAST_ERR=/tmp/tmp.YTxRh1Cr9w + local exit_status=0 + local timeout=4 + local i + args=('get' '-o' 'yaml' 'statefulset/some-name-rs0') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ get == \- ]] + [[ get =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -o == \- ]] + [[ -o =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ yaml == \- ]] + [[ yaml =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ statefulset/some-name-rs0 == \- ]] + [[ statefulset/some-name-rs0 =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl get -o yaml statefulset/some-name-rs0 + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.qaf6VP5knm + cat /tmp/tmp.YTxRh1Cr9w + rm /tmp/tmp.qaf6VP5knm /tmp/tmp.YTxRh1Cr9w + return 0 + yq -i eval 'del(.spec.persistentVolumeClaimRetentionPolicy)' /tmp/tmp.EvydOaBbs1/statefulset_some-name-rs0.yml + arch_scheduling_enabled + [[ -n '' ]] + version_gt 1.22 ++ echo '1.34 >= 1.22' ++ bc -l + '[' 1 -eq 1 ']' + return 0 + yq -i eval 'del(.spec.internalTrafficPolicy)' /tmp/tmp.EvydOaBbs1/statefulset_some-name-rs0.yml + yq -i eval 'del(.spec.allocateLoadBalancerNodePorts)' /tmp/tmp.EvydOaBbs1/statefulset_some-name-rs0.yml + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-rs0.yml == */cronjob* ]] + '[' -n '' ']' + [[ 0 -eq 0 ]] + diff -u /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-rs0.yml /tmp/tmp.EvydOaBbs1/statefulset_some-name-rs0.yml + log 'compare_kubectl: statefulset/some-name-rs0 OK' + set +o xtrace [2026-11-24T09:12:48+0000] compare_kubectl: statefulset/some-name-rs0 OK + compare_kubectl statefulset/some-name-cfg + local resource=statefulset/some-name-cfg + local postfix= + local skip_generation_check= + local expected_result=/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-cfg.yml + local new_result=/tmp/tmp.EvydOaBbs1/statefulset_some-name-cfg.yml + [[ -n '' ]] + kubectl_bin get -o yaml statefulset/some-name-cfg + yq eval $'\n\t\t\tdel(.metadata.ownerReferences[].apiVersion) |\n\t\t\tdel(.metadata.managedFields) |\n\t\t\tdel(.. | select(has("creationTimestamp")).creationTimestamp) |\n\t\t\tdel(.. | select(has("namespace")).namespace) |\n\t\t\tdel(.. | select(has("uid")).uid) |\n\t\t\tdel(.metadata.resourceVersion) |\n\t\t\tdel(.spec.template.spec.containers[].env[] | select(.name == "NAMESPACE")) |\n\t\t\tdel(.metadata.selfLink) |\n\t\t\tdel(.metadata.annotations."cloud.google.com/neg") |\n\t\t\tdel(.metadata.annotations."field.cattle.io/publicEndpoints") |\n\t\t\tdel(.metadata.annotations."metallb.io/ip-allocated-from-pool") |\n\t\t\tdel(.metadata.annotations."networking.gke.io/target-pool") |\n\t\t\tdel(.metadata.annotations."kubectl.kubernetes.io/last-applied-configuration") |\n\t\t\tdel(.. | select(has("image")).image) |\n\t\t\tdel(.. | select(has("clusterIP")).clusterIP) |\n\t\t\tdel(.. | select(has("clusterIPs")).clusterIPs) |\n\t\t\tdel(.. | select(has("dataSource")).dataSource) |\n\t\t\tdel(.. | select(has("procMount")).procMount) |\n\t\t\tdel(.. | select(has("storageClassName")).storageClassName) |\n\t\t\tdel(.. | select(has("finalizers")).finalizers) |\n\t\t\tdel(.. | select(has("kubernetes.io/pvc-protection"))."kubernetes.io/pvc-protection") |\n\t\t\tdel(.. | select(has("volumeName")).volumeName) |\n\t\t\tdel(.. | select(has("volume.beta.kubernetes.io/storage-provisioner"))."volume.beta.kubernetes.io/storage-provisioner") |\n\t\t\tdel(.. | select(has("volume.kubernetes.io/storage-provisioner"))."volume.kubernetes.io/storage-provisioner") |\n\t\t\tdel(.spec.volumeMode) |\n\t\t\tdel(.. | select(has("volume.kubernetes.io/selected-node"))."volume.kubernetes.io/selected-node") |\n\t\t\tdel(.. | select(has("percona.com/last-config-hash"))."percona.com/last-config-hash") |\n\t\t\tdel(.. | select(has("percona.com/configuration-hash"))."percona.com/configuration-hash") |\n\t\t\tdel(.. | select(has("percona.com/ssl-hash"))."percona.com/ssl-hash") |\n\t\t\tdel(.. | select(has("percona.com/ssl-internal-hash"))."percona.com/ssl-internal-hash") |\n\t\t\tdel(.. | select(has("percona.com/pbm-tls-hash"))."percona.com/pbm-tls-hash") |\n\t\t\tdel(.spec.volumeClaimTemplates[].spec.volumeMode | select(. == "Filesystem")) |\n\t\t\tdel(.. | select(has("healthCheckNodePort")).healthCheckNodePort) |\n\t\t\tdel(.. | select(has("nodePort")).nodePort) |\n\t\t\tdel(.status) |\n\t\t\t(.. | select(tag == "!!str")) |= sub("custom-users-roles-sharded-25005", "NAME_SPACE") |\n\t\t\tdel(.spec.volumeClaimTemplates[].apiVersion) |\n\t\t\tdel(.spec.volumeClaimTemplates[].kind) |\n\t\t\tdel(.spec.ipFamilies) |\n\t\t\tdel(.spec.ipFamilyPolicy) |\n\t\t\t(.. | select(. == "extensions/v1beta1")) = "apps/v1" |\n\t\t\t(.. | select(. == "batch/v1beta1")) = "batch/v1" ' - ++ mktemp + local LAST_OUT=/tmp/tmp.FuzIsKEUtc ++ mktemp + local LAST_ERR=/tmp/tmp.4M5jlKQrHj + local exit_status=0 + local timeout=4 + local i + args=('get' '-o' 'yaml' 'statefulset/some-name-cfg') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ get == \- ]] + [[ get =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -o == \- ]] + [[ -o =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ yaml == \- ]] + [[ yaml =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ statefulset/some-name-cfg == \- ]] + [[ statefulset/some-name-cfg =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl get -o yaml statefulset/some-name-cfg + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.FuzIsKEUtc + cat /tmp/tmp.4M5jlKQrHj + rm /tmp/tmp.FuzIsKEUtc /tmp/tmp.4M5jlKQrHj + return 0 + yq -i eval 'del(.spec.persistentVolumeClaimRetentionPolicy)' /tmp/tmp.EvydOaBbs1/statefulset_some-name-cfg.yml + arch_scheduling_enabled + [[ -n '' ]] + version_gt 1.22 ++ echo '1.34 >= 1.22' ++ bc -l + '[' 1 -eq 1 ']' + return 0 + yq -i eval 'del(.spec.internalTrafficPolicy)' /tmp/tmp.EvydOaBbs1/statefulset_some-name-cfg.yml + yq -i eval 'del(.spec.allocateLoadBalancerNodePorts)' /tmp/tmp.EvydOaBbs1/statefulset_some-name-cfg.yml + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-cfg.yml == */cronjob* ]] + '[' -n '' ']' + [[ 0 -eq 0 ]] + diff -u /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-cfg.yml /tmp/tmp.EvydOaBbs1/statefulset_some-name-cfg.yml + log 'compare_kubectl: statefulset/some-name-cfg OK' + set +o xtrace [2026-11-24T09:12:48+0000] compare_kubectl: statefulset/some-name-cfg OK + compare_kubectl statefulset/some-name-mongos '' + local resource=statefulset/some-name-mongos + local postfix= + local skip_generation_check= + local expected_result=/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-mongos.yml + local new_result=/tmp/tmp.EvydOaBbs1/statefulset_some-name-mongos.yml + [[ -n '' ]] + kubectl_bin get -o yaml statefulset/some-name-mongos + yq eval $'\n\t\t\tdel(.metadata.ownerReferences[].apiVersion) |\n\t\t\tdel(.metadata.managedFields) |\n\t\t\tdel(.. | select(has("creationTimestamp")).creationTimestamp) |\n\t\t\tdel(.. | select(has("namespace")).namespace) |\n\t\t\tdel(.. | select(has("uid")).uid) |\n\t\t\tdel(.metadata.resourceVersion) |\n\t\t\tdel(.spec.template.spec.containers[].env[] | select(.name == "NAMESPACE")) |\n\t\t\tdel(.metadata.selfLink) |\n\t\t\tdel(.metadata.annotations."cloud.google.com/neg") |\n\t\t\tdel(.metadata.annotations."field.cattle.io/publicEndpoints") |\n\t\t\tdel(.metadata.annotations."metallb.io/ip-allocated-from-pool") |\n\t\t\tdel(.metadata.annotations."networking.gke.io/target-pool") |\n\t\t\tdel(.metadata.annotations."kubectl.kubernetes.io/last-applied-configuration") |\n\t\t\tdel(.. | select(has("image")).image) |\n\t\t\tdel(.. | select(has("clusterIP")).clusterIP) |\n\t\t\tdel(.. | select(has("clusterIPs")).clusterIPs) |\n\t\t\tdel(.. | select(has("dataSource")).dataSource) |\n\t\t\tdel(.. | select(has("procMount")).procMount) |\n\t\t\tdel(.. | select(has("storageClassName")).storageClassName) |\n\t\t\tdel(.. | select(has("finalizers")).finalizers) |\n\t\t\tdel(.. | select(has("kubernetes.io/pvc-protection"))."kubernetes.io/pvc-protection") |\n\t\t\tdel(.. | select(has("volumeName")).volumeName) |\n\t\t\tdel(.. | select(has("volume.beta.kubernetes.io/storage-provisioner"))."volume.beta.kubernetes.io/storage-provisioner") |\n\t\t\tdel(.. | select(has("volume.kubernetes.io/storage-provisioner"))."volume.kubernetes.io/storage-provisioner") |\n\t\t\tdel(.spec.volumeMode) |\n\t\t\tdel(.. | select(has("volume.kubernetes.io/selected-node"))."volume.kubernetes.io/selected-node") |\n\t\t\tdel(.. | select(has("percona.com/last-config-hash"))."percona.com/last-config-hash") |\n\t\t\tdel(.. | select(has("percona.com/configuration-hash"))."percona.com/configuration-hash") |\n\t\t\tdel(.. | select(has("percona.com/ssl-hash"))."percona.com/ssl-hash") |\n\t\t\tdel(.. | select(has("percona.com/ssl-internal-hash"))."percona.com/ssl-internal-hash") |\n\t\t\tdel(.. | select(has("percona.com/pbm-tls-hash"))."percona.com/pbm-tls-hash") |\n\t\t\tdel(.spec.volumeClaimTemplates[].spec.volumeMode | select(. == "Filesystem")) |\n\t\t\tdel(.. | select(has("healthCheckNodePort")).healthCheckNodePort) |\n\t\t\tdel(.. | select(has("nodePort")).nodePort) |\n\t\t\tdel(.status) |\n\t\t\t(.. | select(tag == "!!str")) |= sub("custom-users-roles-sharded-25005", "NAME_SPACE") |\n\t\t\tdel(.spec.volumeClaimTemplates[].apiVersion) |\n\t\t\tdel(.spec.volumeClaimTemplates[].kind) |\n\t\t\tdel(.spec.ipFamilies) |\n\t\t\tdel(.spec.ipFamilyPolicy) |\n\t\t\t(.. | select(. == "extensions/v1beta1")) = "apps/v1" |\n\t\t\t(.. | select(. == "batch/v1beta1")) = "batch/v1" ' - ++ mktemp + local LAST_OUT=/tmp/tmp.w4935Ms6HB ++ mktemp + local LAST_ERR=/tmp/tmp.tn2jB5XA24 + local exit_status=0 + local timeout=4 + local i + args=('get' '-o' 'yaml' 'statefulset/some-name-mongos') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ get == \- ]] + [[ get =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -o == \- ]] + [[ -o =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ yaml == \- ]] + [[ yaml =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ statefulset/some-name-mongos == \- ]] + [[ statefulset/some-name-mongos =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl get -o yaml statefulset/some-name-mongos + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.w4935Ms6HB + cat /tmp/tmp.tn2jB5XA24 + rm /tmp/tmp.w4935Ms6HB /tmp/tmp.tn2jB5XA24 + return 0 + yq -i eval 'del(.spec.persistentVolumeClaimRetentionPolicy)' /tmp/tmp.EvydOaBbs1/statefulset_some-name-mongos.yml + arch_scheduling_enabled + [[ -n '' ]] + version_gt 1.22 ++ echo '1.34 >= 1.22' ++ bc -l + '[' 1 -eq 1 ']' + return 0 + yq -i eval 'del(.spec.internalTrafficPolicy)' /tmp/tmp.EvydOaBbs1/statefulset_some-name-mongos.yml + yq -i eval 'del(.spec.allocateLoadBalancerNodePorts)' /tmp/tmp.EvydOaBbs1/statefulset_some-name-mongos.yml + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-mongos.yml == */cronjob* ]] + '[' -n '' ']' + [[ 0 -eq 0 ]] + diff -u /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-mongos.yml /tmp/tmp.EvydOaBbs1/statefulset_some-name-mongos.yml + log 'compare_kubectl: statefulset/some-name-mongos OK' + set +o xtrace [2026-11-24T09:12:50+0000] compare_kubectl: statefulset/some-name-mongos OK + desc 'check user created on cluster creation' + set +o xtrace ----------------------------------------------------------------------------------- check user created on cluster creation ----------------------------------------------------------------------------------- + userOne=user-one ++ getSecretData user-one userOnePassKey ++ local secretName=user-one ++ local dataKey=userOnePassKey +++ kubectl get secrets/user-one '--template={{.data.userOnePassKey}}' +++ base64 -d ++ local data=clusterMonitor ++ echo clusterMonitor + userOnePass=clusterMonitor ++ get_user_cmd '"user-one"' ++ local 'user="user-one"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-one");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-one");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare admin $'(function() {\n\tvar user = db.getUser("user-one");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-one + local database=admin + local $'command=(function() {\n\tvar user = db.getUser("user-one");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-one + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-one-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use admin\\n (function() {\n\tvar user = db.getUser("user-one");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + grep -E -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 '/"userId"/d' + local $'command=use admin\\n (function() {\n\tvar user = db.getUser("user-one");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.hX16QqTrDJ +++ mktemp ++ local LAST_ERR=/tmp/tmp.G3aOZG9bNS ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.hX16QqTrDJ ++ cat /tmp/tmp.G3aOZG9bNS ++ rm /tmp/tmp.hX16QqTrDJ /tmp/tmp.G3aOZG9bNS ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-one");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.k0T7E2Cd8D ++ mktemp + local LAST_ERR=/tmp/tmp.Az8Pjm9duy + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var user = db.getUser("user-one"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-one"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-one"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-one");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.k0T7E2Cd8D + cat /tmp/tmp.Az8Pjm9duy + rm /tmp/tmp.k0T7E2Cd8D /tmp/tmp.Az8Pjm9duy + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-one.json /tmp/tmp.EvydOaBbs1/user-one + check_auth user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 + local uri=user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 '' '' --quiet ++ grep -E -v 'I NETWORK|W 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:' ++ local 'command=db.runCommand({ ping: 1 }).ok' ++ local uri=user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 ++ local driver=mongodb ++ local suffix=.svc.cluster.local ++ local mongo_flag=--quiet ++ local port=27017 ++ local mongo_bin=mongo +++ echo .svc.cluster.local +++ awk -F: '{print $2}' ++ suffix_port= ++ [[ -z '' ]] ++ suffix=.svc.cluster.local:27017 +++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++++ mktemp +++ local LAST_OUT=/tmp/tmp.OEhgcePUGJ ++++ mktemp +++ local LAST_ERR=/tmp/tmp.VK5AcVk8Me +++ local exit_status=0 +++ local timeout=4 +++ local i +++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') +++ local args +++ transformed_files=() +++ local transformed_files +++ local stdin_manifest +++ for i in "${!args[@]}" +++ [[ get == \- ]] +++ [[ get =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ pods == \- ]] +++ [[ pods =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ --selector=name=psmdb-client == \- ]] +++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ -o == \- ]] +++ [[ -o =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ jsonpath={.items[].metadata.name} == \- ]] +++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ local attempt +++ local delay ++++ seq 0 9 +++ for attempt in $(seq 0 9) +++ set +e +++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ exit_status=0 +++ set -e +++ [[ 0 == 0 ]] +++ break +++ cat /tmp/tmp.OEhgcePUGJ +++ cat /tmp/tmp.VK5AcVk8Me +++ rm /tmp/tmp.OEhgcePUGJ /tmp/tmp.VK5AcVk8Me +++ return 0 ++ local client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.lS3zQTKVao +++ mktemp ++ local LAST_ERR=/tmp/tmp.AYe2jJUugl ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ bash == \- ]] ++ [[ bash =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -c == \- ]] ++ [[ -c =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet == \- ]] ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.lS3zQTKVao ++ cat /tmp/tmp.AYe2jJUugl ++ rm /tmp/tmp.lS3zQTKVao /tmp/tmp.AYe2jJUugl ++ return 0 + ping=1 + desc 'ping return' + set +o xtrace ----------------------------------------------------------------------------------- ping return ----------------------------------------------------------------------------------- + '[' 1 '!=' 1 ']' + retry 60 2 check_connection_strings user-one-conn-str + local max=60 + local delay=2 + shift 2 + local n=1 + check_connection_strings user-one-conn-str + local secret_name=user-one-conn-str + shift + local key_prefix + local data_keys + local data_key ++ kubectl_bin get secret user-one-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.U6XFapg9vG +++ mktemp ++ local LAST_ERR=/tmp/tmp.KBosNoowRb ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-one-conn-str' '-o' 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-one-conn-str == \- ]] ++ [[ user-one-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} == \- ]] ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-one-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.U6XFapg9vG ++ cat /tmp/tmp.KBosNoowRb ++ rm /tmp/tmp.U6XFapg9vG /tmp/tmp.KBosNoowRb ++ return 0 + data_keys=user-one_mongos_connectionString + '[' -z user-one_mongos_connectionString ']' + IFS= + read -r data_key + '[' -z user-one_mongos_connectionString ']' + check_connection_string user-one-conn-str user-one_mongos_connectionString + local secret_name=user-one-conn-str + local data_key=user-one_mongos_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret user-one-conn-str -o 'go-template={{index .data "user-one_mongos_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.gGEmGIeo6Q +++ mktemp ++ local LAST_ERR=/tmp/tmp.CAohdq2q3N ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-one-conn-str' '-o' 'go-template={{index .data "user-one_mongos_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-one-conn-str == \- ]] ++ [[ user-one-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "user-one_mongos_connectionString"}} == \- ]] ++ [[ go-template={{index .data "user-one_mongos_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-one-conn-str -o 'go-template={{index .data "user-one_mongos_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.gGEmGIeo6Q ++ cat /tmp/tmp.CAohdq2q3N ++ rm /tmp/tmp.gGEmGIeo6Q /tmp/tmp.CAohdq2q3N ++ return 0 + connection_string='mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.5YbyZQlqR6 +++ mktemp ++ local LAST_ERR=/tmp/tmp.xUmyXeIiyD ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.5YbyZQlqR6 ++ cat /tmp/tmp.xUmyXeIiyD ++ rm /tmp/tmp.5YbyZQlqR6 /tmp/tmp.xUmyXeIiyD ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.nGFR2dKH1G +++ mktemp ++ local LAST_ERR=/tmp/tmp.GepcYEAr4v ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.nGFR2dKH1G ++ cat /tmp/tmp.GepcYEAr4v ++ rm /tmp/tmp.nGFR2dKH1G /tmp/tmp.GepcYEAr4v ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + generatedUserSecret=some-name-custom-user-secret ++ kubectl_bin get secret some-name-custom-user-secret -o 'jsonpath={.data.user-gen}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.G2UDCKOI4J +++ mktemp ++ local LAST_ERR=/tmp/tmp.gSNJ1XZS4f ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'some-name-custom-user-secret' '-o' 'jsonpath={.data.user-gen}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name-custom-user-secret == \- ]] ++ [[ some-name-custom-user-secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.data.user-gen} == \- ]] ++ [[ jsonpath={.data.user-gen} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret some-name-custom-user-secret -o 'jsonpath={.data.user-gen}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.G2UDCKOI4J ++ cat /tmp/tmp.gSNJ1XZS4f ++ rm /tmp/tmp.G2UDCKOI4J /tmp/tmp.gSNJ1XZS4f ++ return 0 + generatedPass=bevEaKTt0K8wiOB0 ++ get_user_cmd '"user-gen"' ++ local 'user="user-gen"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-gen");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-gen");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare admin $'(function() {\n\tvar user = db.getUser("user-gen");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-gen + local database=admin + local $'command=(function() {\n\tvar user = db.getUser("user-gen");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-gen + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-gen-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use admin\\n (function() {\n\tvar user = db.getUser("user-gen");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use admin\\n (function() {\n\tvar user = db.getUser("user-gen");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + grep -E -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:' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.MdrzMjhiRz +++ mktemp ++ local LAST_ERR=/tmp/tmp.mlxzTKFeSy ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.MdrzMjhiRz ++ cat /tmp/tmp.mlxzTKFeSy ++ rm /tmp/tmp.MdrzMjhiRz /tmp/tmp.mlxzTKFeSy ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-gen");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.fRMDbWVLAt ++ mktemp + local LAST_ERR=/tmp/tmp.STL7o7GUPG + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var user = db.getUser("user-gen"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-gen"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-gen"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-gen");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.fRMDbWVLAt + cat /tmp/tmp.STL7o7GUPG + rm /tmp/tmp.fRMDbWVLAt /tmp/tmp.STL7o7GUPG + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-gen.json /tmp/tmp.EvydOaBbs1/user-gen + check_auth user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005 + local uri=user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005 ++ grep -E -v 'I NETWORK|W 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:' ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005 '' '' --quiet ++ local 'command=db.runCommand({ ping: 1 }).ok' ++ local uri=user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005 ++ local driver=mongodb ++ local suffix=.svc.cluster.local ++ local mongo_flag=--quiet ++ local port=27017 ++ local mongo_bin=mongo +++ echo .svc.cluster.local +++ awk -F: '{print $2}' ++ suffix_port= ++ [[ -z '' ]] ++ suffix=.svc.cluster.local:27017 +++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++++ mktemp +++ local LAST_OUT=/tmp/tmp.EwlZGhvTkz ++++ mktemp +++ local LAST_ERR=/tmp/tmp.z8TqCvlbSC +++ local exit_status=0 +++ local timeout=4 +++ local i +++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') +++ local args +++ transformed_files=() +++ local transformed_files +++ local stdin_manifest +++ for i in "${!args[@]}" +++ [[ get == \- ]] +++ [[ get =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ pods == \- ]] +++ [[ pods =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ --selector=name=psmdb-client == \- ]] +++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ -o == \- ]] +++ [[ -o =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ jsonpath={.items[].metadata.name} == \- ]] +++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ local attempt +++ local delay ++++ seq 0 9 +++ for attempt in $(seq 0 9) +++ set +e +++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ exit_status=0 +++ set -e +++ [[ 0 == 0 ]] +++ break +++ cat /tmp/tmp.EwlZGhvTkz +++ cat /tmp/tmp.z8TqCvlbSC +++ rm /tmp/tmp.EwlZGhvTkz /tmp/tmp.z8TqCvlbSC +++ return 0 ++ local client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.ZEAbsQ6Rcw +++ mktemp ++ local LAST_ERR=/tmp/tmp.F4Qpt1GGjP ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ bash == \- ]] ++ [[ bash =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -c == \- ]] ++ [[ -c =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet == \- ]] ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.ZEAbsQ6Rcw ++ cat /tmp/tmp.F4Qpt1GGjP ++ rm /tmp/tmp.ZEAbsQ6Rcw /tmp/tmp.F4Qpt1GGjP ++ return 0 + ping=1 + desc 'ping return' + set +o xtrace ----------------------------------------------------------------------------------- ping return ----------------------------------------------------------------------------------- + '[' 1 '!=' 1 ']' + retry 60 2 check_connection_strings some-name-custom-user-secret-conn-str + local max=60 + local delay=2 + shift 2 + local n=1 + check_connection_strings some-name-custom-user-secret-conn-str + local secret_name=some-name-custom-user-secret-conn-str + shift + local key_prefix + local data_keys + local data_key ++ kubectl_bin get secret some-name-custom-user-secret-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.KUnBcQUuKW +++ mktemp ++ local LAST_ERR=/tmp/tmp.0lOjK9v0bu ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'some-name-custom-user-secret-conn-str' '-o' 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name-custom-user-secret-conn-str == \- ]] ++ [[ some-name-custom-user-secret-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} == \- ]] ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret some-name-custom-user-secret-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.KUnBcQUuKW ++ cat /tmp/tmp.0lOjK9v0bu ++ rm /tmp/tmp.KUnBcQUuKW /tmp/tmp.0lOjK9v0bu ++ return 0 + data_keys=user-gen_mongos_connectionString + '[' -z user-gen_mongos_connectionString ']' + IFS= + read -r data_key + '[' -z user-gen_mongos_connectionString ']' + check_connection_string some-name-custom-user-secret-conn-str user-gen_mongos_connectionString + local secret_name=some-name-custom-user-secret-conn-str + local data_key=user-gen_mongos_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret some-name-custom-user-secret-conn-str -o 'go-template={{index .data "user-gen_mongos_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.Vvp8O9bTbG +++ mktemp ++ local LAST_ERR=/tmp/tmp.Il9TLiuBSD ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'some-name-custom-user-secret-conn-str' '-o' 'go-template={{index .data "user-gen_mongos_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name-custom-user-secret-conn-str == \- ]] ++ [[ some-name-custom-user-secret-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "user-gen_mongos_connectionString"}} == \- ]] ++ [[ go-template={{index .data "user-gen_mongos_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret some-name-custom-user-secret-conn-str -o 'go-template={{index .data "user-gen_mongos_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.Vvp8O9bTbG ++ cat /tmp/tmp.Il9TLiuBSD ++ rm /tmp/tmp.Vvp8O9bTbG /tmp/tmp.Il9TLiuBSD ++ return 0 + connection_string='mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.oQ1UCsp5e8 +++ mktemp ++ local LAST_ERR=/tmp/tmp.URGNwkEmn9 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.oQ1UCsp5e8 ++ cat /tmp/tmp.URGNwkEmn9 ++ rm /tmp/tmp.oQ1UCsp5e8 /tmp/tmp.URGNwkEmn9 ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.M5RQYeLdxp +++ mktemp ++ local LAST_ERR=/tmp/tmp.qF9a5xvlGy ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-gen:bevEaKTt0K8wiOB0@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.M5RQYeLdxp ++ cat /tmp/tmp.qF9a5xvlGy ++ rm /tmp/tmp.M5RQYeLdxp /tmp/tmp.qF9a5xvlGy ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key ++ get_user_cmd '"user-external"' ++ local 'user="user-external"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-external");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-external");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare '$external' $'(function() {\n\tvar user = db.getUser("user-external");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-external + local 'database=$external' + local $'command=(function() {\n\tvar user = db.getUser("user-external");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-external + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-external-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use $external\\n (function() {\n\tvar user = db.getUser("user-external");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use $external\\n (function() {\n\tvar user = db.getUser("user-external");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + grep -E -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 '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.irT74A6xjj +++ mktemp ++ local LAST_ERR=/tmp/tmp.jHbEZYWwYe ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.irT74A6xjj ++ cat /tmp/tmp.jHbEZYWwYe ++ rm /tmp/tmp.irT74A6xjj /tmp/tmp.jHbEZYWwYe ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use $external\\n (function() {\n\tvar user = db.getUser("user-external");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.GadtlEKZ2i ++ mktemp + local LAST_ERR=/tmp/tmp.OEYUh8v8he + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use $external\n (function() { var user = db.getUser("user-external"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use $external\n (function() { var user = db.getUser("user-external"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use $external\n (function() { var user = db.getUser("user-external"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use $external\\n (function() {\n\tvar user = db.getUser("user-external");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.GadtlEKZ2i + cat /tmp/tmp.OEYUh8v8he + rm /tmp/tmp.GadtlEKZ2i /tmp/tmp.OEYUh8v8he + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-external.json /tmp/tmp.EvydOaBbs1/user-external + desc 'delete initial user from CR and create a new one' + set +o xtrace ----------------------------------------------------------------------------------- delete initial user from CR and create a new one ----------------------------------------------------------------------------------- + kubectl_bin patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"users":[\n\t\t\t{\n\t\t\t\t"name":"user-two",\n\t\t\t\t"db":"admin",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-two",\n\t\t\t\t\t"key": "userTwoPassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{"db":"admin","name":"userAdminAnyDatabase"}, \n\t\t\t\t\t{"db":"admin","name":"clusterAdmin"}\n\t\t\t\t]\n\t\t\t}\n\t\t]}\n\t}' ++ mktemp + local LAST_OUT=/tmp/tmp.h8oveqRxIl ++ mktemp + local LAST_ERR=/tmp/tmp.ZNA2pxJxjb + local exit_status=0 + local timeout=4 + local i + args=('patch' 'psmdb' 'some-name' '--type=merge' '--patch' '{ "spec": {"users":[ { "name":"user-two", "db":"admin", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"userAdminAnyDatabase"}, {"db":"admin","name":"clusterAdmin"} ] } ]} }') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ patch == \- ]] + [[ patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb == \- ]] + [[ psmdb =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ some-name == \- ]] + [[ some-name =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --type=merge == \- ]] + [[ --type=merge =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --patch == \- ]] + [[ --patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ { "spec": {"users":[ { "name":"user-two", "db":"admin", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"userAdminAnyDatabase"}, {"db":"admin","name":"clusterAdmin"} ] } ]} } == \- ]] + [[ { "spec": {"users":[ { "name":"user-two", "db":"admin", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"userAdminAnyDatabase"}, {"db":"admin","name":"clusterAdmin"} ] } ]} } =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"users":[\n\t\t\t{\n\t\t\t\t"name":"user-two",\n\t\t\t\t"db":"admin",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-two",\n\t\t\t\t\t"key": "userTwoPassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{"db":"admin","name":"userAdminAnyDatabase"}, \n\t\t\t\t\t{"db":"admin","name":"clusterAdmin"}\n\t\t\t\t]\n\t\t\t}\n\t\t]}\n\t}' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.h8oveqRxIl perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.ZNA2pxJxjb + rm /tmp/tmp.h8oveqRxIl /tmp/tmp.ZNA2pxJxjb + return 0 + wait_for_running some-name-rs0 3 + local name=some-name-rs0 + let last_pod=2 + local check_cluster_readiness=true + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=rs0 + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-rs0-0 + local pod=some-name-rs0-0 + set +o xtrace waiting for pod/some-name-rs0-0 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-rs0-1 + local pod=some-name-rs0-1 + set +o xtrace waiting for pod/some-name-rs0-1 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.X4tgN6xE9n +++ mktemp ++ local LAST_ERR=/tmp/tmp.OTH1YIVbFy ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.X4tgN6xE9n ++ cat /tmp/tmp.OTH1YIVbFy ++ rm /tmp/tmp.X4tgN6xE9n /tmp/tmp.OTH1YIVbFy ++ return 0 + [[ '' == true ]] + wait_pod some-name-rs0-2 + local pod=some-name-rs0-2 + set +o xtrace waiting for pod/some-name-rs0-2 to be ready.OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.CGKGIDbYHD +++ mktemp ++ local LAST_ERR=/tmp/tmp.gHTq9RqXkO ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.CGKGIDbYHD ++ cat /tmp/tmp.gHTq9RqXkO ++ rm /tmp/tmp.CGKGIDbYHD /tmp/tmp.gHTq9RqXkO ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.6tpMbSKu2W +++ mktemp ++ local LAST_ERR=/tmp/tmp.3aitTzS7WN ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.6tpMbSKu2W ++ cat /tmp/tmp.3aitTzS7WN ++ rm /tmp/tmp.6tpMbSKu2W /tmp/tmp.3aitTzS7WN ++ return 0 + [[ '' == true ]] + sleep 10 + [[ true == true ]] + set +x Waiting for cluster some-name to be ready ++ get_user_cmd '"user-two"' ++ local 'user="user-two"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare admin $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-two + local database=admin + local $'command=(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-two + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-two-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + grep -E -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 '/"userId"/d' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.6WZe9mpfR8 +++ mktemp ++ local LAST_ERR=/tmp/tmp.TczbYqwcmb ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.6WZe9mpfR8 ++ cat /tmp/tmp.TczbYqwcmb ++ rm /tmp/tmp.6WZe9mpfR8 /tmp/tmp.TczbYqwcmb ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.tcEAOUyxmn ++ mktemp + local LAST_ERR=/tmp/tmp.nTHgkT9wrg + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.tcEAOUyxmn + cat /tmp/tmp.nTHgkT9wrg + rm /tmp/tmp.tcEAOUyxmn /tmp/tmp.nTHgkT9wrg + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-two.json /tmp/tmp.EvydOaBbs1/user-two + userTwo=user-two ++ getSecretData user-two userTwoPassKey ++ local secretName=user-two ++ local dataKey=userTwoPassKey +++ kubectl get secrets/user-two '--template={{.data.userTwoPassKey}}' +++ base64 -d ++ local data=clusterMonitor ++ echo clusterMonitor + userTwoPass=clusterMonitor + check_auth user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 + local uri=user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 ++ grep -E -v 'I NETWORK|W 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:' ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 '' '' --quiet ++ local 'command=db.runCommand({ ping: 1 }).ok' ++ local uri=user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 ++ local driver=mongodb ++ local suffix=.svc.cluster.local ++ local mongo_flag=--quiet ++ local port=27017 ++ local mongo_bin=mongo +++ echo .svc.cluster.local +++ awk -F: '{print $2}' ++ suffix_port= ++ [[ -z '' ]] ++ suffix=.svc.cluster.local:27017 +++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++++ mktemp +++ local LAST_OUT=/tmp/tmp.IvcMvkYboY ++++ mktemp +++ local LAST_ERR=/tmp/tmp.WbZyPi3uq4 +++ local exit_status=0 +++ local timeout=4 +++ local i +++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') +++ local args +++ transformed_files=() +++ local transformed_files +++ local stdin_manifest +++ for i in "${!args[@]}" +++ [[ get == \- ]] +++ [[ get =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ pods == \- ]] +++ [[ pods =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ --selector=name=psmdb-client == \- ]] +++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ -o == \- ]] +++ [[ -o =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ jsonpath={.items[].metadata.name} == \- ]] +++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ local attempt +++ local delay ++++ seq 0 9 +++ for attempt in $(seq 0 9) +++ set +e +++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ exit_status=0 +++ set -e +++ [[ 0 == 0 ]] +++ break +++ cat /tmp/tmp.IvcMvkYboY +++ cat /tmp/tmp.WbZyPi3uq4 +++ rm /tmp/tmp.IvcMvkYboY /tmp/tmp.WbZyPi3uq4 +++ return 0 ++ local client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.PW9NHvEys3 +++ mktemp ++ local LAST_ERR=/tmp/tmp.4cphyo7r24 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ bash == \- ]] ++ [[ bash =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -c == \- ]] ++ [[ -c =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet == \- ]] ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.PW9NHvEys3 ++ cat /tmp/tmp.4cphyo7r24 ++ rm /tmp/tmp.PW9NHvEys3 /tmp/tmp.4cphyo7r24 ++ return 0 + ping=1 + desc 'ping return' + set +o xtrace ----------------------------------------------------------------------------------- ping return ----------------------------------------------------------------------------------- + '[' 1 '!=' 1 ']' + check_auth user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 + local uri=user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 '' '' --quiet ++ grep -E -v 'I NETWORK|W 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:' ++ local 'command=db.runCommand({ ping: 1 }).ok' ++ local uri=user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005 ++ local driver=mongodb ++ local suffix=.svc.cluster.local ++ local mongo_flag=--quiet ++ local port=27017 ++ local mongo_bin=mongo +++ echo .svc.cluster.local +++ awk -F: '{print $2}' ++ suffix_port= ++ [[ -z '' ]] ++ suffix=.svc.cluster.local:27017 +++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++++ mktemp +++ local LAST_OUT=/tmp/tmp.oVkjrVeFQb ++++ mktemp +++ local LAST_ERR=/tmp/tmp.y74YaIzgwB +++ local exit_status=0 +++ local timeout=4 +++ local i +++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') +++ local args +++ transformed_files=() +++ local transformed_files +++ local stdin_manifest +++ for i in "${!args[@]}" +++ [[ get == \- ]] +++ [[ get =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ pods == \- ]] +++ [[ pods =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ --selector=name=psmdb-client == \- ]] +++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ -o == \- ]] +++ [[ -o =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ jsonpath={.items[].metadata.name} == \- ]] +++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ local attempt +++ local delay ++++ seq 0 9 +++ for attempt in $(seq 0 9) +++ set +e +++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ exit_status=0 +++ set -e +++ [[ 0 == 0 ]] +++ break +++ cat /tmp/tmp.oVkjrVeFQb +++ cat /tmp/tmp.y74YaIzgwB +++ rm /tmp/tmp.oVkjrVeFQb /tmp/tmp.y74YaIzgwB +++ return 0 ++ local client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.BzTPm8AbQN +++ mktemp ++ local LAST_ERR=/tmp/tmp.dV2uDg2RnL ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ bash == \- ]] ++ [[ bash =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -c == \- ]] ++ [[ -c =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet == \- ]] ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.BzTPm8AbQN ++ cat /tmp/tmp.dV2uDg2RnL ++ rm /tmp/tmp.BzTPm8AbQN /tmp/tmp.dV2uDg2RnL ++ return 0 + ping=1 + desc 'ping return' + set +o xtrace ----------------------------------------------------------------------------------- ping return ----------------------------------------------------------------------------------- + '[' 1 '!=' 1 ']' + retry 60 2 check_connection_strings user-two-conn-str + local max=60 + local delay=2 + shift 2 + local n=1 + check_connection_strings user-two-conn-str + local secret_name=user-two-conn-str + shift + local key_prefix + local data_keys + local data_key ++ kubectl_bin get secret user-two-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.hHQn7Rm72t +++ mktemp ++ local LAST_ERR=/tmp/tmp.LuQksDt5jV ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-two-conn-str' '-o' 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-two-conn-str == \- ]] ++ [[ user-two-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} == \- ]] ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-two-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.hHQn7Rm72t ++ cat /tmp/tmp.LuQksDt5jV ++ rm /tmp/tmp.hHQn7Rm72t /tmp/tmp.LuQksDt5jV ++ return 0 + data_keys=user-two_mongos_connectionString + '[' -z user-two_mongos_connectionString ']' + IFS= + read -r data_key + '[' -z user-two_mongos_connectionString ']' + check_connection_string user-two-conn-str user-two_mongos_connectionString + local secret_name=user-two-conn-str + local data_key=user-two_mongos_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret user-two-conn-str -o 'go-template={{index .data "user-two_mongos_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.ghmC1fqgoU +++ mktemp ++ local LAST_ERR=/tmp/tmp.USG4nqYbvd ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-two-conn-str' '-o' 'go-template={{index .data "user-two_mongos_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-two-conn-str == \- ]] ++ [[ user-two-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "user-two_mongos_connectionString"}} == \- ]] ++ [[ go-template={{index .data "user-two_mongos_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-two-conn-str -o 'go-template={{index .data "user-two_mongos_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.ghmC1fqgoU ++ cat /tmp/tmp.USG4nqYbvd ++ rm /tmp/tmp.ghmC1fqgoU /tmp/tmp.USG4nqYbvd ++ return 0 + connection_string='mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.yDOq6J6XhR +++ mktemp ++ local LAST_ERR=/tmp/tmp.0B8Q89POcK ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.yDOq6J6XhR ++ cat /tmp/tmp.0B8Q89POcK ++ rm /tmp/tmp.yDOq6J6XhR /tmp/tmp.0B8Q89POcK ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.YUveLGaZue +++ mktemp ++ local LAST_ERR=/tmp/tmp.ZSSiiRGvx0 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.YUveLGaZue ++ cat /tmp/tmp.ZSSiiRGvx0 ++ rm /tmp/tmp.YUveLGaZue /tmp/tmp.ZSSiiRGvx0 ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + desc 'check password change' + set +o xtrace ----------------------------------------------------------------------------------- check password change ----------------------------------------------------------------------------------- + userTwoNewPass=new-user-two-password ++ echo -n new-user-two-password ++ base64 + patch_secret user-two userTwoPassKey bmV3LXVzZXItdHdvLXBhc3N3b3Jk + local secret=user-two + local key=userTwoPassKey + local value=bmV3LXVzZXItdHdvLXBhc3N3b3Jk + kubectl patch secret user-two '-p={"data":{"userTwoPassKey": "bmV3LXVzZXItdHdvLXBhc3N3b3Jk"}}' secret/user-two patched + retry 30 5 check_auth user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 + local max=30 + local delay=5 + shift 2 + local n=1 + check_auth user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 + local uri=user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 '' '' --quiet ++ local 'command=db.runCommand({ ping: 1 }).ok' ++ local uri=user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 ++ local driver=mongodb ++ local suffix=.svc.cluster.local ++ local mongo_flag=--quiet ++ local port=27017 ++ local mongo_bin=mongo ++ grep -E -v 'I NETWORK|W 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:' +++ echo .svc.cluster.local +++ awk -F: '{print $2}' ++ suffix_port= ++ [[ -z '' ]] ++ suffix=.svc.cluster.local:27017 +++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++++ mktemp +++ local LAST_OUT=/tmp/tmp.BjXcfsO9re ++++ mktemp +++ local LAST_ERR=/tmp/tmp.hMkTOenQNm +++ local exit_status=0 +++ local timeout=4 +++ local i +++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') +++ local args +++ transformed_files=() +++ local transformed_files +++ local stdin_manifest +++ for i in "${!args[@]}" +++ [[ get == \- ]] +++ [[ get =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ pods == \- ]] +++ [[ pods =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ --selector=name=psmdb-client == \- ]] +++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ -o == \- ]] +++ [[ -o =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ jsonpath={.items[].metadata.name} == \- ]] +++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ local attempt +++ local delay ++++ seq 0 9 +++ for attempt in $(seq 0 9) +++ set +e +++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ exit_status=0 +++ set -e +++ [[ 0 == 0 ]] +++ break +++ cat /tmp/tmp.BjXcfsO9re +++ cat /tmp/tmp.hMkTOenQNm +++ rm /tmp/tmp.BjXcfsO9re /tmp/tmp.hMkTOenQNm +++ return 0 ++ local client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.KLCBf1XrpZ +++ mktemp ++ local LAST_ERR=/tmp/tmp.CD33PZH3WG ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ bash == \- ]] ++ [[ bash =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -c == \- ]] ++ [[ -c =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet == \- ]] ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' ++ exit_status=1 ++ set -e ++ [[ 1 == 0 ]] ++ [[ 0 == 9 ]] ++ grep -q 'Error from server (NotFound)' /tmp/tmp.CD33PZH3WG ++ grep -qE 'ENHANCE_YOUR_CALM|ResourceExhausted|TooManyRequests|TLS handshake timeout|etcdserver: request timed out|the server is currently unable to handle the request|Unable to connect to the server|connection reset by peer' /tmp/tmp.CD33PZH3WG ++ [[ -n 1 ]] ++ [[ 0 -lt 2 ]] ++ delay=0 ++ cat /tmp/tmp.KLCBf1XrpZ /tmp/tmp.CD33PZH3WG Error: Authentication failed. : connect@src/mongo/shell/mongo.js:374:17 @(connect):3:6 exception: connect failed exiting with code 1 command terminated with exit code 1 ++ sleep 0 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' ++ exit_status=1 ++ set -e ++ [[ 1 == 0 ]] ++ [[ 1 == 9 ]] ++ grep -q 'Error from server (NotFound)' /tmp/tmp.CD33PZH3WG ++ grep -qE 'ENHANCE_YOUR_CALM|ResourceExhausted|TooManyRequests|TLS handshake timeout|etcdserver: request timed out|the server is currently unable to handle the request|Unable to connect to the server|connection reset by peer' /tmp/tmp.CD33PZH3WG ++ [[ -n 1 ]] ++ [[ 1 -lt 2 ]] ++ delay=4 ++ cat /tmp/tmp.KLCBf1XrpZ /tmp/tmp.CD33PZH3WG Error: Authentication failed. : connect@src/mongo/shell/mongo.js:374:17 @(connect):3:6 exception: connect failed exiting with code 1 command terminated with exit code 1 ++ sleep 4 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.KLCBf1XrpZ ++ cat /tmp/tmp.CD33PZH3WG ++ rm /tmp/tmp.KLCBf1XrpZ /tmp/tmp.CD33PZH3WG ++ return 0 + ping=1 + desc 'ping return' + set +o xtrace ----------------------------------------------------------------------------------- ping return ----------------------------------------------------------------------------------- + '[' 1 '!=' 1 ']' + retry 60 2 check_connection_strings user-two-conn-str + local max=60 + local delay=2 + shift 2 + local n=1 + check_connection_strings user-two-conn-str + local secret_name=user-two-conn-str + shift + local key_prefix + local data_keys + local data_key ++ kubectl_bin get secret user-two-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.SUYmhdCQ2x +++ mktemp ++ local LAST_ERR=/tmp/tmp.2KT9SS9o3I ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-two-conn-str' '-o' 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-two-conn-str == \- ]] ++ [[ user-two-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} == \- ]] ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-two-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.SUYmhdCQ2x ++ cat /tmp/tmp.2KT9SS9o3I ++ rm /tmp/tmp.SUYmhdCQ2x /tmp/tmp.2KT9SS9o3I ++ return 0 + data_keys=user-two_mongos_connectionString + '[' -z user-two_mongos_connectionString ']' + IFS= + read -r data_key + '[' -z user-two_mongos_connectionString ']' + check_connection_string user-two-conn-str user-two_mongos_connectionString + local secret_name=user-two-conn-str + local data_key=user-two_mongos_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret user-two-conn-str -o 'go-template={{index .data "user-two_mongos_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.UhS8XwZJ25 +++ mktemp ++ local LAST_ERR=/tmp/tmp.9C63PlUGd9 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-two-conn-str' '-o' 'go-template={{index .data "user-two_mongos_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-two-conn-str == \- ]] ++ [[ user-two-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "user-two_mongos_connectionString"}} == \- ]] ++ [[ go-template={{index .data "user-two_mongos_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-two-conn-str -o 'go-template={{index .data "user-two_mongos_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.UhS8XwZJ25 ++ cat /tmp/tmp.9C63PlUGd9 ++ rm /tmp/tmp.UhS8XwZJ25 /tmp/tmp.9C63PlUGd9 ++ return 0 + connection_string='mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.drrf4Dp7G9 +++ mktemp ++ local LAST_ERR=/tmp/tmp.8OJ8QpEkfM ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.drrf4Dp7G9 ++ cat /tmp/tmp.8OJ8QpEkfM ++ rm /tmp/tmp.drrf4Dp7G9 /tmp/tmp.8OJ8QpEkfM ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.OGa7wo0g64 +++ mktemp ++ local LAST_ERR=/tmp/tmp.qVWunGttsE ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.OGa7wo0g64 ++ cat /tmp/tmp.qVWunGttsE ++ rm /tmp/tmp.OGa7wo0g64 /tmp/tmp.qVWunGttsE ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + desc 'check user roles update from CR' + set +o xtrace ----------------------------------------------------------------------------------- check user roles update from CR ----------------------------------------------------------------------------------- + kubectl_bin patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"users":[\n\t\t\t{\n\t\t\t\t"name":"user-two",\n\t\t\t\t"db":"admin",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-two",\n\t\t\t\t\t"key": "userTwoPassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{"db":"admin","name":"clusterAdmin"}\n\t\t\t\t]\n\t\t\t}\n\t\t]}\n\t}' ++ mktemp + local LAST_OUT=/tmp/tmp.bJJOKIm0Ql ++ mktemp + local LAST_ERR=/tmp/tmp.FWoIjRscJL + local exit_status=0 + local timeout=4 + local i + args=('patch' 'psmdb' 'some-name' '--type=merge' '--patch' '{ "spec": {"users":[ { "name":"user-two", "db":"admin", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} }') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ patch == \- ]] + [[ patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb == \- ]] + [[ psmdb =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ some-name == \- ]] + [[ some-name =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --type=merge == \- ]] + [[ --type=merge =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --patch == \- ]] + [[ --patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ { "spec": {"users":[ { "name":"user-two", "db":"admin", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} } == \- ]] + [[ { "spec": {"users":[ { "name":"user-two", "db":"admin", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} } =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"users":[\n\t\t\t{\n\t\t\t\t"name":"user-two",\n\t\t\t\t"db":"admin",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-two",\n\t\t\t\t\t"key": "userTwoPassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{"db":"admin","name":"clusterAdmin"}\n\t\t\t\t]\n\t\t\t}\n\t\t]}\n\t}' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.bJJOKIm0Ql perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.FWoIjRscJL + rm /tmp/tmp.bJJOKIm0Ql /tmp/tmp.FWoIjRscJL + return 0 + wait_for_running some-name-rs0 3 + local name=some-name-rs0 + let last_pod=2 + local check_cluster_readiness=true + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=rs0 + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-rs0-0 + local pod=some-name-rs0-0 + set +o xtrace waiting for pod/some-name-rs0-0 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-rs0-1 + local pod=some-name-rs0-1 + set +o xtrace waiting for pod/some-name-rs0-1 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.QYb5YRQPbP +++ mktemp ++ local LAST_ERR=/tmp/tmp.lQKLk0OOra ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.QYb5YRQPbP ++ cat /tmp/tmp.lQKLk0OOra ++ rm /tmp/tmp.QYb5YRQPbP /tmp/tmp.lQKLk0OOra ++ return 0 + [[ '' == true ]] + wait_pod some-name-rs0-2 + local pod=some-name-rs0-2 + set +o xtrace waiting for pod/some-name-rs0-2 to be ready.OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.fNfkaEU5fe +++ mktemp ++ local LAST_ERR=/tmp/tmp.vhZuXuY1X1 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.fNfkaEU5fe ++ cat /tmp/tmp.vhZuXuY1X1 ++ rm /tmp/tmp.fNfkaEU5fe /tmp/tmp.vhZuXuY1X1 ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.YuNsNA9RGy +++ mktemp ++ local LAST_ERR=/tmp/tmp.5tFjSfIhwT ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.YuNsNA9RGy ++ cat /tmp/tmp.5tFjSfIhwT ++ rm /tmp/tmp.YuNsNA9RGy /tmp/tmp.5tFjSfIhwT ++ return 0 + [[ '' == true ]] + sleep 10 + [[ true == true ]] + set +x Waiting for cluster some-name to be ready ++ get_user_cmd '"user-two"' ++ local 'user="user-two"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare admin $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-two-update-roles + local database=admin + local $'command=(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-two-update-roles + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + grep -E -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:' + local $'command=use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + local mongo_bin=mongo + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.Dbj6n36rWb +++ mktemp ++ local LAST_ERR=/tmp/tmp.s1VnD0PCYZ ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.Dbj6n36rWb ++ cat /tmp/tmp.s1VnD0PCYZ ++ rm /tmp/tmp.Dbj6n36rWb /tmp/tmp.s1VnD0PCYZ ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.XcSZmeIVEX ++ mktemp + local LAST_ERR=/tmp/tmp.Hxjn4BPlks + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.XcSZmeIVEX + cat /tmp/tmp.Hxjn4BPlks + rm /tmp/tmp.XcSZmeIVEX /tmp/tmp.Hxjn4BPlks + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles.json /tmp/tmp.EvydOaBbs1/user-two-update-roles + desc 'check user roles update from DB' + set +o xtrace ----------------------------------------------------------------------------------- check user roles update from DB ----------------------------------------------------------------------------------- + run_mongos 'use admin\n db.updateUser("user-two", { roles : [{ role : "userAdminAnyDatabase", db: "admin"}]})' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local 'command=use admin\n db.updateUser("user-two", { roles : [{ role : "userAdminAnyDatabase", db: "admin"}]})' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.mb8XAuL0rT +++ mktemp ++ local LAST_ERR=/tmp/tmp.VAMYwtqCzQ ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.mb8XAuL0rT ++ cat /tmp/tmp.VAMYwtqCzQ ++ rm /tmp/tmp.mb8XAuL0rT /tmp/tmp.VAMYwtqCzQ ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''use admin\n db.updateUser("user-two", { roles : [{ role : "userAdminAnyDatabase", db: "admin"}]})\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.lrVRVz9BdQ ++ mktemp + local LAST_ERR=/tmp/tmp.OjXLeqLFi9 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n db.updateUser("user-two", { roles : [{ role : "userAdminAnyDatabase", db: "admin"}]})\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n db.updateUser("user-two", { roles : [{ role : "userAdminAnyDatabase", db: "admin"}]})\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n db.updateUser("user-two", { roles : [{ role : "userAdminAnyDatabase", db: "admin"}]})\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''use admin\n db.updateUser("user-two", { roles : [{ role : "userAdminAnyDatabase", db: "admin"}]})\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.lrVRVz9BdQ Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("b8f5e77e-04c0-4838-ab83-ce84881c6475") } Percona Server for MongoDB server version: v8.3.17-5 WARNING: shell and server versions do not match switched to db admin bye + cat /tmp/tmp.OjXLeqLFi9 + rm /tmp/tmp.lrVRVz9BdQ /tmp/tmp.OjXLeqLFi9 + return 0 ++ get_user_cmd '"user-two"' ++ local 'user="user-two"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + retry 30 5 compare admin $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-two-update-roles + local max=30 + local delay=5 + shift 2 + local n=1 + compare admin $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-two-update-roles + local database=admin + local $'command=(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-two-update-roles + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + grep -E -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:' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + local $'command=use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + sed '/"userId"/d' + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.Bd9DgYVnnR +++ mktemp ++ local LAST_ERR=/tmp/tmp.IpuWIjlqjX ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.Bd9DgYVnnR ++ cat /tmp/tmp.IpuWIjlqjX ++ rm /tmp/tmp.Bd9DgYVnnR /tmp/tmp.IpuWIjlqjX ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.aVdFyXaNu1 ++ mktemp + local LAST_ERR=/tmp/tmp.NcsLQWQJRc + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.aVdFyXaNu1 + cat /tmp/tmp.NcsLQWQJRc + rm /tmp/tmp.aVdFyXaNu1 /tmp/tmp.NcsLQWQJRc + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles.json /tmp/tmp.EvydOaBbs1/user-two-update-roles + desc 'check user recreated after deleted from DB' + set +o xtrace ----------------------------------------------------------------------------------- check user recreated after deleted from DB ----------------------------------------------------------------------------------- + run_mongos 'use admin\n db.dropUser("user-two")' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local 'command=use admin\n db.dropUser("user-two")' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.kI6RE9ofKt +++ mktemp ++ local LAST_ERR=/tmp/tmp.iZyUAYy1Zf ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.kI6RE9ofKt ++ cat /tmp/tmp.iZyUAYy1Zf ++ rm /tmp/tmp.kI6RE9ofKt /tmp/tmp.iZyUAYy1Zf ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''use admin\n db.dropUser("user-two")\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.FKta3b9M9c ++ mktemp + local LAST_ERR=/tmp/tmp.1qoBuW1x1A + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n db.dropUser("user-two")\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n db.dropUser("user-two")\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n db.dropUser("user-two")\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''use admin\n db.dropUser("user-two")\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.FKta3b9M9c Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("491e7f29-9c1c-46ef-92fd-5e0509c4fcd0") } Percona Server for MongoDB server version: v8.3.17-5 WARNING: shell and server versions do not match switched to db admin true bye + cat /tmp/tmp.1qoBuW1x1A + rm /tmp/tmp.FKta3b9M9c /tmp/tmp.1qoBuW1x1A + return 0 ++ get_user_cmd '"user-two"' ++ local 'user="user-two"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + retry 30 5 compare admin $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-two-update-roles + local max=30 + local delay=5 + shift 2 + local n=1 + compare admin $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-two-update-roles + local database=admin + local $'command=(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-two-update-roles + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + grep -E -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:' + local mongo_flag= + local port=27017 + local mongo_bin=mongo + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.W1m5HvoYE6 +++ mktemp ++ local LAST_ERR=/tmp/tmp.cQKPw75qI9 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.W1m5HvoYE6 ++ cat /tmp/tmp.cQKPw75qI9 ++ rm /tmp/tmp.W1m5HvoYE6 /tmp/tmp.cQKPw75qI9 ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.xWFkgcRVAI ++ mktemp + local LAST_ERR=/tmp/tmp.yy7Xy4LevC + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.xWFkgcRVAI + cat /tmp/tmp.yy7Xy4LevC + rm /tmp/tmp.xWFkgcRVAI /tmp/tmp.yy7Xy4LevC + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles.json /tmp/tmp.EvydOaBbs1/user-two-update-roles + desc 'check new user created after updated user name via CR' + set +o xtrace ----------------------------------------------------------------------------------- check new user created after updated user name via CR ----------------------------------------------------------------------------------- + kubectl_bin patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"users":[\n\t\t\t{\n\t\t\t\t"name":"user-three",\n\t\t\t\t"db":"admin",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-two",\n\t\t\t\t\t"key": "userTwoPassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{"db":"admin","name":"clusterAdmin"}\n\t\t\t\t]\n\t\t\t}\n\t\t]}\n\t}' ++ mktemp + local LAST_OUT=/tmp/tmp.UnkTtishBl ++ mktemp + local LAST_ERR=/tmp/tmp.OkDJljAGrf + local exit_status=0 + local timeout=4 + local i + args=('patch' 'psmdb' 'some-name' '--type=merge' '--patch' '{ "spec": {"users":[ { "name":"user-three", "db":"admin", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} }') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ patch == \- ]] + [[ patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb == \- ]] + [[ psmdb =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ some-name == \- ]] + [[ some-name =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --type=merge == \- ]] + [[ --type=merge =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --patch == \- ]] + [[ --patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ { "spec": {"users":[ { "name":"user-three", "db":"admin", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} } == \- ]] + [[ { "spec": {"users":[ { "name":"user-three", "db":"admin", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} } =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"users":[\n\t\t\t{\n\t\t\t\t"name":"user-three",\n\t\t\t\t"db":"admin",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-two",\n\t\t\t\t\t"key": "userTwoPassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{"db":"admin","name":"clusterAdmin"}\n\t\t\t\t]\n\t\t\t}\n\t\t]}\n\t}' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.UnkTtishBl perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.OkDJljAGrf + rm /tmp/tmp.UnkTtishBl /tmp/tmp.OkDJljAGrf + return 0 + wait_for_running some-name-rs0 3 + local name=some-name-rs0 + let last_pod=2 + local check_cluster_readiness=true + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=rs0 + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-rs0-0 + local pod=some-name-rs0-0 + set +o xtrace waiting for pod/some-name-rs0-0 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-rs0-1 + local pod=some-name-rs0-1 + set +o xtrace waiting for pod/some-name-rs0-1 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.lvtEkmqw5W +++ mktemp ++ local LAST_ERR=/tmp/tmp.3TDPX1yNbG ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.lvtEkmqw5W ++ cat /tmp/tmp.3TDPX1yNbG ++ rm /tmp/tmp.lvtEkmqw5W /tmp/tmp.3TDPX1yNbG ++ return 0 + [[ '' == true ]] + wait_pod some-name-rs0-2 + local pod=some-name-rs0-2 + set +o xtrace waiting for pod/some-name-rs0-2 to be ready.OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.efupqLiZ0Z +++ mktemp ++ local LAST_ERR=/tmp/tmp.F2pI0LeU5a ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.efupqLiZ0Z ++ cat /tmp/tmp.F2pI0LeU5a ++ rm /tmp/tmp.efupqLiZ0Z /tmp/tmp.F2pI0LeU5a ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.Ovkw3zKqBE +++ mktemp ++ local LAST_ERR=/tmp/tmp.Tc4y425xWW ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.Ovkw3zKqBE ++ cat /tmp/tmp.Tc4y425xWW ++ rm /tmp/tmp.Ovkw3zKqBE /tmp/tmp.Tc4y425xWW ++ return 0 + [[ '' == true ]] + sleep 10 + [[ true == true ]] + set +x Waiting for cluster some-name to be ready ++ get_user_cmd '"user-three"' ++ local 'user="user-three"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare admin $'(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-three-admin-db + local database=admin + local $'command=(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-three-admin-db + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-three-admin-db-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + grep -E -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 '/"userId"/d' + run_mongos $'use admin\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use admin\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.3tYo3N4PSP +++ mktemp ++ local LAST_ERR=/tmp/tmp.8BLjCGmOFB ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.3tYo3N4PSP ++ cat /tmp/tmp.8BLjCGmOFB ++ rm /tmp/tmp.3tYo3N4PSP /tmp/tmp.8BLjCGmOFB ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.oDFJtPUMGg ++ mktemp + local LAST_ERR=/tmp/tmp.5V1LSlCWXm + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var user = db.getUser("user-three"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-three"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-three"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.oDFJtPUMGg + cat /tmp/tmp.5V1LSlCWXm + rm /tmp/tmp.oDFJtPUMGg /tmp/tmp.5V1LSlCWXm + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-three-admin-db.json /tmp/tmp.EvydOaBbs1/user-three-admin-db ++ get_user_cmd '"user-two"' ++ local 'user="user-two"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare admin $'(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-two-update-roles + local database=admin + local $'command=(function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-two-update-roles + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + grep -E -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:' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.QgnaGsEPsz +++ mktemp ++ local LAST_ERR=/tmp/tmp.KoAczN3hYS ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.QgnaGsEPsz ++ cat /tmp/tmp.KoAczN3hYS ++ rm /tmp/tmp.QgnaGsEPsz /tmp/tmp.KoAczN3hYS ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.jY8LsNN9O8 ++ mktemp + local LAST_ERR=/tmp/tmp.NeCVZOfwwB + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-two"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-two");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.jY8LsNN9O8 + cat /tmp/tmp.NeCVZOfwwB + rm /tmp/tmp.jY8LsNN9O8 /tmp/tmp.NeCVZOfwwB + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles.json /tmp/tmp.EvydOaBbs1/user-two-update-roles + check_auth user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 + local uri=user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 '' '' --quiet ++ grep -E -v 'I NETWORK|W 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:' ++ local 'command=db.runCommand({ ping: 1 }).ok' ++ local uri=user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 ++ local driver=mongodb ++ local suffix=.svc.cluster.local ++ local mongo_flag=--quiet ++ local port=27017 ++ local mongo_bin=mongo +++ echo .svc.cluster.local +++ awk -F: '{print $2}' ++ suffix_port= ++ [[ -z '' ]] ++ suffix=.svc.cluster.local:27017 +++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++++ mktemp +++ local LAST_OUT=/tmp/tmp.7PZQPH35x8 ++++ mktemp +++ local LAST_ERR=/tmp/tmp.dShM49lCsW +++ local exit_status=0 +++ local timeout=4 +++ local i +++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') +++ local args +++ transformed_files=() +++ local transformed_files +++ local stdin_manifest +++ for i in "${!args[@]}" +++ [[ get == \- ]] +++ [[ get =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ pods == \- ]] +++ [[ pods =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ --selector=name=psmdb-client == \- ]] +++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ -o == \- ]] +++ [[ -o =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ jsonpath={.items[].metadata.name} == \- ]] +++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ local attempt +++ local delay ++++ seq 0 9 +++ for attempt in $(seq 0 9) +++ set +e +++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ exit_status=0 +++ set -e +++ [[ 0 == 0 ]] +++ break +++ cat /tmp/tmp.7PZQPH35x8 +++ cat /tmp/tmp.dShM49lCsW +++ rm /tmp/tmp.7PZQPH35x8 /tmp/tmp.dShM49lCsW +++ return 0 ++ local client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.4ZmkIvBedu +++ mktemp ++ local LAST_ERR=/tmp/tmp.r8YL4fV8vM ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ bash == \- ]] ++ [[ bash =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -c == \- ]] ++ [[ -c =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet == \- ]] ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.4ZmkIvBedu ++ cat /tmp/tmp.r8YL4fV8vM ++ rm /tmp/tmp.4ZmkIvBedu /tmp/tmp.r8YL4fV8vM ++ return 0 + ping=1 + desc 'ping return' + set +o xtrace ----------------------------------------------------------------------------------- ping return ----------------------------------------------------------------------------------- + '[' 1 '!=' 1 ']' + check_auth user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 + local uri=user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 '' '' --quiet ++ grep -E -v 'I NETWORK|W 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:' ++ local 'command=db.runCommand({ ping: 1 }).ok' ++ local uri=user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005 ++ local driver=mongodb ++ local suffix=.svc.cluster.local ++ local mongo_flag=--quiet ++ local port=27017 ++ local mongo_bin=mongo +++ echo .svc.cluster.local +++ awk -F: '{print $2}' ++ suffix_port= ++ [[ -z '' ]] ++ suffix=.svc.cluster.local:27017 +++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++++ mktemp +++ local LAST_OUT=/tmp/tmp.64Tb6u2gox ++++ mktemp +++ local LAST_ERR=/tmp/tmp.cDNn4krFkK +++ local exit_status=0 +++ local timeout=4 +++ local i +++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') +++ local args +++ transformed_files=() +++ local transformed_files +++ local stdin_manifest +++ for i in "${!args[@]}" +++ [[ get == \- ]] +++ [[ get =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ pods == \- ]] +++ [[ pods =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ --selector=name=psmdb-client == \- ]] +++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ -o == \- ]] +++ [[ -o =~ ^(-f|--filename)=-$ ]] +++ for i in "${!args[@]}" +++ [[ jsonpath={.items[].metadata.name} == \- ]] +++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ arch_scheduling_enabled +++ [[ -n '' ]] +++ local attempt +++ local delay ++++ seq 0 9 +++ for attempt in $(seq 0 9) +++ set +e +++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ exit_status=0 +++ set -e +++ [[ 0 == 0 ]] +++ break +++ cat /tmp/tmp.64Tb6u2gox +++ cat /tmp/tmp.cDNn4krFkK +++ rm /tmp/tmp.64Tb6u2gox /tmp/tmp.cDNn4krFkK +++ return 0 ++ local client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.tNMqFbrMgn +++ mktemp ++ local LAST_ERR=/tmp/tmp.aDC3YpRoDL ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ bash == \- ]] ++ [[ bash =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -c == \- ]] ++ [[ -c =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet == \- ]] ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.tNMqFbrMgn ++ cat /tmp/tmp.aDC3YpRoDL ++ rm /tmp/tmp.tNMqFbrMgn /tmp/tmp.aDC3YpRoDL ++ return 0 + ping=1 + desc 'ping return' + set +o xtrace ----------------------------------------------------------------------------------- ping return ----------------------------------------------------------------------------------- + '[' 1 '!=' 1 ']' + retry 60 2 check_connection_strings user-two-conn-str + local max=60 + local delay=2 + shift 2 + local n=1 + check_connection_strings user-two-conn-str + local secret_name=user-two-conn-str + shift + local key_prefix + local data_keys + local data_key ++ kubectl_bin get secret user-two-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.V9tBZdLe3n +++ mktemp ++ local LAST_ERR=/tmp/tmp.T7RdjkpOfJ ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-two-conn-str' '-o' 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-two-conn-str == \- ]] ++ [[ user-two-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} == \- ]] ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-two-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.V9tBZdLe3n ++ cat /tmp/tmp.T7RdjkpOfJ ++ rm /tmp/tmp.V9tBZdLe3n /tmp/tmp.T7RdjkpOfJ ++ return 0 + data_keys=user-three_mongos_connectionString + '[' -z user-three_mongos_connectionString ']' + IFS= + read -r data_key + '[' -z user-three_mongos_connectionString ']' + check_connection_string user-two-conn-str user-three_mongos_connectionString + local secret_name=user-two-conn-str + local data_key=user-three_mongos_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret user-two-conn-str -o 'go-template={{index .data "user-three_mongos_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.tM3VTdoTGh +++ mktemp ++ local LAST_ERR=/tmp/tmp.rQqsZHKLYO ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-two-conn-str' '-o' 'go-template={{index .data "user-three_mongos_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-two-conn-str == \- ]] ++ [[ user-two-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "user-three_mongos_connectionString"}} == \- ]] ++ [[ go-template={{index .data "user-three_mongos_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-two-conn-str -o 'go-template={{index .data "user-three_mongos_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.tM3VTdoTGh ++ cat /tmp/tmp.rQqsZHKLYO ++ rm /tmp/tmp.tM3VTdoTGh /tmp/tmp.rQqsZHKLYO ++ return 0 + connection_string='mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.JYkSCR5a5h +++ mktemp ++ local LAST_ERR=/tmp/tmp.oWyawR1WXW ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.JYkSCR5a5h ++ cat /tmp/tmp.oWyawR1WXW ++ rm /tmp/tmp.JYkSCR5a5h /tmp/tmp.oWyawR1WXW ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.66BKvLyfG5 +++ mktemp ++ local LAST_ERR=/tmp/tmp.3iDxUdcLSR ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.66BKvLyfG5 ++ cat /tmp/tmp.3iDxUdcLSR ++ rm /tmp/tmp.66BKvLyfG5 /tmp/tmp.3iDxUdcLSR ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + desc 'check new user created after updated user db via CR' + set +o xtrace ----------------------------------------------------------------------------------- check new user created after updated user db via CR ----------------------------------------------------------------------------------- + kubectl_bin patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"users":[\n\t\t\t{\n\t\t\t\t"name":"user-three",\n\t\t\t\t"db":"newDb",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-two",\n\t\t\t\t\t"key": "userTwoPassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{"db":"admin","name":"clusterAdmin"}\n\t\t\t\t]\n\t\t\t}\n\t\t]}\n\t}' ++ mktemp + local LAST_OUT=/tmp/tmp.XWk2DatsSh ++ mktemp + local LAST_ERR=/tmp/tmp.UZUy1sBqyp + local exit_status=0 + local timeout=4 + local i + args=('patch' 'psmdb' 'some-name' '--type=merge' '--patch' '{ "spec": {"users":[ { "name":"user-three", "db":"newDb", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} }') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ patch == \- ]] + [[ patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb == \- ]] + [[ psmdb =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ some-name == \- ]] + [[ some-name =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --type=merge == \- ]] + [[ --type=merge =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --patch == \- ]] + [[ --patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ { "spec": {"users":[ { "name":"user-three", "db":"newDb", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} } == \- ]] + [[ { "spec": {"users":[ { "name":"user-three", "db":"newDb", "passwordSecretRef": { "name": "user-two", "key": "userTwoPassKey" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} } =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"users":[\n\t\t\t{\n\t\t\t\t"name":"user-three",\n\t\t\t\t"db":"newDb",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-two",\n\t\t\t\t\t"key": "userTwoPassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{"db":"admin","name":"clusterAdmin"}\n\t\t\t\t]\n\t\t\t}\n\t\t]}\n\t}' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.XWk2DatsSh perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.UZUy1sBqyp + rm /tmp/tmp.XWk2DatsSh /tmp/tmp.UZUy1sBqyp + return 0 + wait_for_running some-name-rs0 3 + local name=some-name-rs0 + let last_pod=2 + local check_cluster_readiness=true + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=rs0 + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-rs0-0 + local pod=some-name-rs0-0 + set +o xtrace waiting for pod/some-name-rs0-0 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-rs0-1 + local pod=some-name-rs0-1 + set +o xtrace waiting for pod/some-name-rs0-1 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.EKOa451Pnj +++ mktemp ++ local LAST_ERR=/tmp/tmp.jwexDTMdHT ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.EKOa451Pnj ++ cat /tmp/tmp.jwexDTMdHT ++ rm /tmp/tmp.EKOa451Pnj /tmp/tmp.jwexDTMdHT ++ return 0 + [[ '' == true ]] + wait_pod some-name-rs0-2 + local pod=some-name-rs0-2 + set +o xtrace waiting for pod/some-name-rs0-2 to be ready.OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.6qyBVEMyMd +++ mktemp ++ local LAST_ERR=/tmp/tmp.SqwKYYpFxv ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.6qyBVEMyMd ++ cat /tmp/tmp.SqwKYYpFxv ++ rm /tmp/tmp.6qyBVEMyMd /tmp/tmp.SqwKYYpFxv ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.lskjDBQK0M +++ mktemp ++ local LAST_ERR=/tmp/tmp.aUV2XlSLZ6 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.lskjDBQK0M ++ cat /tmp/tmp.aUV2XlSLZ6 ++ rm /tmp/tmp.lskjDBQK0M /tmp/tmp.aUV2XlSLZ6 ++ return 0 + [[ '' == true ]] + sleep 10 + [[ true == true ]] + set +x Waiting for cluster some-name to be ready ++ get_user_cmd '"user-three"' ++ local 'user="user-three"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare newDb $'(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-three-newDb-db + local database=newDb + local $'command=(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-three-newDb-db + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-three-newDb-db-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + grep -E -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:' + run_mongos $'use newDb\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use newDb\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.2LUNetYjTj +++ mktemp ++ local LAST_ERR=/tmp/tmp.5we88nkqAu ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.2LUNetYjTj ++ cat /tmp/tmp.5we88nkqAu ++ rm /tmp/tmp.2LUNetYjTj /tmp/tmp.5we88nkqAu ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use newDb\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.brTc1d7j04 ++ mktemp + local LAST_ERR=/tmp/tmp.1B98KHeezK + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use newDb\n (function() { var user = db.getUser("user-three"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use newDb\n (function() { var user = db.getUser("user-three"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use newDb\n (function() { var user = db.getUser("user-three"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use newDb\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.brTc1d7j04 + cat /tmp/tmp.1B98KHeezK + rm /tmp/tmp.brTc1d7j04 /tmp/tmp.1B98KHeezK + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-three-newDb-db.json /tmp/tmp.EvydOaBbs1/user-three-newDb-db ++ get_user_cmd '"user-three"' ++ local 'user="user-three"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare admin $'(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-three-admin-db + local database=admin + local $'command=(function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-three-admin-db + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-three-admin-db-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + grep -E -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:' + run_mongos $'use admin\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + sed '/"userId"/d' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + local $'command=use admin\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.2RjQt7clAy +++ mktemp ++ local LAST_ERR=/tmp/tmp.nfCa7pF5DS ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.2RjQt7clAy ++ cat /tmp/tmp.nfCa7pF5DS ++ rm /tmp/tmp.2RjQt7clAy /tmp/tmp.nfCa7pF5DS ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.GgH3zi5hZY ++ mktemp + local LAST_ERR=/tmp/tmp.XxTyyjlTj5 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var user = db.getUser("user-three"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-three"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user-three"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user-three");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.GgH3zi5hZY + cat /tmp/tmp.XxTyyjlTj5 + rm /tmp/tmp.GgH3zi5hZY /tmp/tmp.XxTyyjlTj5 + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-three-admin-db.json /tmp/tmp.EvydOaBbs1/user-three-admin-db + retry 60 2 check_connection_strings user-two-conn-str + local max=60 + local delay=2 + shift 2 + local n=1 + check_connection_strings user-two-conn-str + local secret_name=user-two-conn-str + shift + local key_prefix + local data_keys + local data_key ++ kubectl_bin get secret user-two-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.q5VmgU4dWx +++ mktemp ++ local LAST_ERR=/tmp/tmp.0bdUplUevg ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-two-conn-str' '-o' 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-two-conn-str == \- ]] ++ [[ user-two-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} == \- ]] ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-two-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.q5VmgU4dWx ++ cat /tmp/tmp.0bdUplUevg ++ rm /tmp/tmp.q5VmgU4dWx /tmp/tmp.0bdUplUevg ++ return 0 + data_keys=user-three_mongos_connectionString + '[' -z user-three_mongos_connectionString ']' + IFS= + read -r data_key + '[' -z user-three_mongos_connectionString ']' + check_connection_string user-two-conn-str user-three_mongos_connectionString + local secret_name=user-two-conn-str + local data_key=user-three_mongos_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret user-two-conn-str -o 'go-template={{index .data "user-three_mongos_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.m9BPRCkxJm +++ mktemp ++ local LAST_ERR=/tmp/tmp.pVtdb6Nuvo ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-two-conn-str' '-o' 'go-template={{index .data "user-three_mongos_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-two-conn-str == \- ]] ++ [[ user-two-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "user-three_mongos_connectionString"}} == \- ]] ++ [[ go-template={{index .data "user-three_mongos_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-two-conn-str -o 'go-template={{index .data "user-three_mongos_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.m9BPRCkxJm ++ cat /tmp/tmp.pVtdb6Nuvo ++ rm /tmp/tmp.m9BPRCkxJm /tmp/tmp.pVtdb6Nuvo ++ return 0 + connection_string='mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=newDb&tls=true' + '[' -z 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=newDb&tls=true' ']' + [[ mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=newDb&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.MdEH9hW2Gh +++ mktemp ++ local LAST_ERR=/tmp/tmp.uDOstX36im ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.MdEH9hW2Gh ++ cat /tmp/tmp.uDOstX36im ++ rm /tmp/tmp.MdEH9hW2Gh /tmp/tmp.uDOstX36im ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=newDb&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.xPK0HApE0D +++ mktemp ++ local LAST_ERR=/tmp/tmp.nYEVlzNFZf ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=newDb&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=newDb&tls=true == \- ]] ++ [[ mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=newDb&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=newDb&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.xPK0HApE0D ++ cat /tmp/tmp.nYEVlzNFZf ++ rm /tmp/tmp.xPK0HApE0D /tmp/tmp.nYEVlzNFZf ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + desc 'check new user created with default db and secret password key' + set +o xtrace ----------------------------------------------------------------------------------- check new user created with default db and secret password key ----------------------------------------------------------------------------------- + kubectl_bin patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"users":[\n\t\t\t{\n\t\t\t\t"name":"user/four",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-two"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{"db":"admin","name":"clusterAdmin"}\n\t\t\t\t]\n\t\t\t}\n\t\t]}\n\t}' ++ mktemp + local LAST_OUT=/tmp/tmp.OX8SGYfSoE ++ mktemp + local LAST_ERR=/tmp/tmp.ap9Oue50ZB + local exit_status=0 + local timeout=4 + local i + args=('patch' 'psmdb' 'some-name' '--type=merge' '--patch' '{ "spec": {"users":[ { "name":"user/four", "passwordSecretRef": { "name": "user-two" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} }') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ patch == \- ]] + [[ patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb == \- ]] + [[ psmdb =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ some-name == \- ]] + [[ some-name =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --type=merge == \- ]] + [[ --type=merge =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --patch == \- ]] + [[ --patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ { "spec": {"users":[ { "name":"user/four", "passwordSecretRef": { "name": "user-two" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} } == \- ]] + [[ { "spec": {"users":[ { "name":"user/four", "passwordSecretRef": { "name": "user-two" }, "roles": [ {"db":"admin","name":"clusterAdmin"} ] } ]} } =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"users":[\n\t\t\t{\n\t\t\t\t"name":"user/four",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-two"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{"db":"admin","name":"clusterAdmin"}\n\t\t\t\t]\n\t\t\t}\n\t\t]}\n\t}' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.OX8SGYfSoE perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.ap9Oue50ZB + rm /tmp/tmp.OX8SGYfSoE /tmp/tmp.ap9Oue50ZB + return 0 + wait_for_running some-name-rs0 3 + local name=some-name-rs0 + let last_pod=2 + local check_cluster_readiness=true + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=rs0 + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-rs0-0 + local pod=some-name-rs0-0 + set +o xtrace waiting for pod/some-name-rs0-0 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-rs0-1 + local pod=some-name-rs0-1 + set +o xtrace waiting for pod/some-name-rs0-1 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.OyVla0FGcF +++ mktemp ++ local LAST_ERR=/tmp/tmp.iWEIUnnemh ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.OyVla0FGcF ++ cat /tmp/tmp.iWEIUnnemh ++ rm /tmp/tmp.OyVla0FGcF /tmp/tmp.iWEIUnnemh ++ return 0 + [[ '' == true ]] + wait_pod some-name-rs0-2 + local pod=some-name-rs0-2 + set +o xtrace waiting for pod/some-name-rs0-2 to be ready.OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.tDfiPweaVC +++ mktemp ++ local LAST_ERR=/tmp/tmp.zVpLiiQf0V ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.tDfiPweaVC ++ cat /tmp/tmp.zVpLiiQf0V ++ rm /tmp/tmp.tDfiPweaVC /tmp/tmp.zVpLiiQf0V ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.9Z8t1DhFiF +++ mktemp ++ local LAST_ERR=/tmp/tmp.nmuupS6qOk ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.9Z8t1DhFiF ++ cat /tmp/tmp.nmuupS6qOk ++ rm /tmp/tmp.9Z8t1DhFiF /tmp/tmp.nmuupS6qOk ++ return 0 + [[ '' == true ]] + sleep 10 + [[ true == true ]] + set +x Waiting for cluster some-name to be ready ++ get_user_cmd '"user/four"' ++ local 'user="user/four"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user/four");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user/four");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare admin $'(function() {\n\tvar user = db.getUser("user/four");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-four + local database=admin + local $'command=(function() {\n\tvar user = db.getUser("user/four");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-four + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-four-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use admin\\n (function() {\n\tvar user = db.getUser("user/four");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use admin\\n (function() {\n\tvar user = db.getUser("user/four");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + grep -E -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:' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.BLLrU7ZW64 +++ mktemp ++ local LAST_ERR=/tmp/tmp.Dv73yogmfm ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.BLLrU7ZW64 ++ cat /tmp/tmp.Dv73yogmfm ++ rm /tmp/tmp.BLLrU7ZW64 /tmp/tmp.Dv73yogmfm ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user/four");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.Yw5jE1H9nW ++ mktemp + local LAST_ERR=/tmp/tmp.J2Er9sMITw + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var user = db.getUser("user/four"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user/four"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var user = db.getUser("user/four"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar user = db.getUser("user/four");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.Yw5jE1H9nW + cat /tmp/tmp.J2Er9sMITw + rm /tmp/tmp.Yw5jE1H9nW /tmp/tmp.J2Er9sMITw + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-four.json /tmp/tmp.EvydOaBbs1/user-four + retry 60 2 check_connection_strings user-two-conn-str + local max=60 + local delay=2 + shift 2 + local n=1 + check_connection_strings user-two-conn-str + local secret_name=user-two-conn-str + shift + local key_prefix + local data_keys + local data_key ++ kubectl_bin get secret user-two-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.WOdAcPqNFE +++ mktemp ++ local LAST_ERR=/tmp/tmp.yKXaGrFyiz ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-two-conn-str' '-o' 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-two-conn-str == \- ]] ++ [[ user-two-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} == \- ]] ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-two-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.WOdAcPqNFE ++ cat /tmp/tmp.yKXaGrFyiz ++ rm /tmp/tmp.WOdAcPqNFE /tmp/tmp.yKXaGrFyiz ++ return 0 + data_keys=user_four_mongos_connectionString + '[' -z user_four_mongos_connectionString ']' + IFS= + read -r data_key + '[' -z user_four_mongos_connectionString ']' + check_connection_string user-two-conn-str user_four_mongos_connectionString + local secret_name=user-two-conn-str + local data_key=user_four_mongos_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret user-two-conn-str -o 'go-template={{index .data "user_four_mongos_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.qVWfA61zgZ +++ mktemp ++ local LAST_ERR=/tmp/tmp.Wwa1rwfwIr ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-two-conn-str' '-o' 'go-template={{index .data "user_four_mongos_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-two-conn-str == \- ]] ++ [[ user-two-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "user_four_mongos_connectionString"}} == \- ]] ++ [[ go-template={{index .data "user_four_mongos_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-two-conn-str -o 'go-template={{index .data "user_four_mongos_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.qVWfA61zgZ ++ cat /tmp/tmp.Wwa1rwfwIr ++ rm /tmp/tmp.qVWfA61zgZ /tmp/tmp.Wwa1rwfwIr ++ return 0 + connection_string='mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.UD3Njc3QBx +++ mktemp ++ local LAST_ERR=/tmp/tmp.2uxLU9nGN8 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.UD3Njc3QBx ++ cat /tmp/tmp.2uxLU9nGN8 ++ rm /tmp/tmp.UD3Njc3QBx /tmp/tmp.2uxLU9nGN8 ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.veSbDlNkr6 +++ mktemp ++ local LAST_ERR=/tmp/tmp.442sZWy5rq ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=admin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.veSbDlNkr6 ++ cat /tmp/tmp.442sZWy5rq ++ rm /tmp/tmp.veSbDlNkr6 /tmp/tmp.442sZWy5rq ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + desc 'check user role on cluster initialization' + set +o xtrace ----------------------------------------------------------------------------------- check user role on cluster initialization ----------------------------------------------------------------------------------- ++ get_role_cmd '"role-one"' ++ local 'role="role-one"' ++ cmd=$'(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' ++ echo $'(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + compare admin $'(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 role-one + local database=admin + local $'command=(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=role-one + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-one-83.json ']' + target=role-one-83 + run_mongos $'use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + grep -E -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:' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + local $'command=use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + sed '/"userId"/d' + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.wJ1B8YH6T1 +++ mktemp ++ local LAST_ERR=/tmp/tmp.RaQXUDouIN ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.wJ1B8YH6T1 ++ cat /tmp/tmp.RaQXUDouIN ++ rm /tmp/tmp.wJ1B8YH6T1 /tmp/tmp.RaQXUDouIN ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.pjWVwPiUZn ++ mktemp + local LAST_ERR=/tmp/tmp.PkVrMMujQ5 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.pjWVwPiUZn + cat /tmp/tmp.PkVrMMujQ5 + rm /tmp/tmp.pjWVwPiUZn /tmp/tmp.PkVrMMujQ5 + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-one-83.json /tmp/tmp.EvydOaBbs1/role-one-83 + desc 'check role recreated after deleted from DB' + set +o xtrace ----------------------------------------------------------------------------------- check role recreated after deleted from DB ----------------------------------------------------------------------------------- + run_mongos 'use admin\n db.dropRole("role-one")' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local 'command=use admin\n db.dropRole("role-one")' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.aVBTVPC02h +++ mktemp ++ local LAST_ERR=/tmp/tmp.FS0mZtHwWa ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.aVBTVPC02h ++ cat /tmp/tmp.FS0mZtHwWa ++ rm /tmp/tmp.aVBTVPC02h /tmp/tmp.FS0mZtHwWa ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''use admin\n db.dropRole("role-one")\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.Df41Mcpiq4 ++ mktemp + local LAST_ERR=/tmp/tmp.JJGiA1EMtM + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n db.dropRole("role-one")\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n db.dropRole("role-one")\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n db.dropRole("role-one")\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''use admin\n db.dropRole("role-one")\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.Df41Mcpiq4 Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("e655fc43-28d5-4bfa-9cb1-98ed160c1a50") } Percona Server for MongoDB server version: v8.3.17-5 WARNING: shell and server versions do not match switched to db admin true bye + cat /tmp/tmp.JJGiA1EMtM + rm /tmp/tmp.Df41Mcpiq4 /tmp/tmp.JJGiA1EMtM + return 0 ++ get_role_cmd '"role-one"' ++ local 'role="role-one"' ++ cmd=$'(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' ++ echo $'(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + retry 30 5 compare admin $'(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 role-one + local max=30 + local delay=5 + shift 2 + local n=1 + compare admin $'(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 role-one + local database=admin + local $'command=(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=role-one + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-one-83.json ']' + target=role-one-83 + run_mongos $'use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + grep -E -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:' + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.2WhWkWFDc0 +++ mktemp ++ local LAST_ERR=/tmp/tmp.O9spZHmone ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.2WhWkWFDc0 ++ cat /tmp/tmp.O9spZHmone ++ rm /tmp/tmp.2WhWkWFDc0 /tmp/tmp.O9spZHmone ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.KHiBLGnwg0 ++ mktemp + local LAST_ERR=/tmp/tmp.9ARP0tuvWv + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=1 + set -e + [[ 1 == 0 ]] + [[ 0 == 9 ]] + grep -q 'Error from server (NotFound)' /tmp/tmp.9ARP0tuvWv + grep -qE 'ENHANCE_YOUR_CALM|ResourceExhausted|TooManyRequests|TLS handshake timeout|etcdserver: request timed out|the server is currently unable to handle the request|Unable to connect to the server|connection reset by peer' /tmp/tmp.9ARP0tuvWv + [[ -n 1 ]] + [[ 0 -lt 2 ]] + delay=0 + cat /tmp/tmp.KHiBLGnwg0 /tmp/tmp.9ARP0tuvWv Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("8e909df1-3fb3-4b26-ab38-3f4881056fb6") } Percona Server for MongoDB server version: v8.3.17-5 WARNING: shell and server versions do not match switched to db admin uncaught exception: TypeError: role is null : @(shell):3:6 @(shell):1:2 bye command terminated with exit code 1 + sleep 0 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=1 + set -e + [[ 1 == 0 ]] + [[ 1 == 9 ]] + grep -q 'Error from server (NotFound)' /tmp/tmp.9ARP0tuvWv + grep -qE 'ENHANCE_YOUR_CALM|ResourceExhausted|TooManyRequests|TLS handshake timeout|etcdserver: request timed out|the server is currently unable to handle the request|Unable to connect to the server|connection reset by peer' /tmp/tmp.9ARP0tuvWv + [[ -n 1 ]] + [[ 1 -lt 2 ]] + delay=4 + cat /tmp/tmp.KHiBLGnwg0 /tmp/tmp.9ARP0tuvWv Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("70410e40-1fab-4481-9f61-4e48e31eae36") } Percona Server for MongoDB server version: v8.3.17-5 WARNING: shell and server versions do not match switched to db admin uncaught exception: TypeError: role is null : @(shell):3:6 @(shell):1:2 bye command terminated with exit code 1 + sleep 4 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.KHiBLGnwg0 + cat /tmp/tmp.9ARP0tuvWv + rm /tmp/tmp.KHiBLGnwg0 /tmp/tmp.9ARP0tuvWv + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-one-83.json /tmp/tmp.EvydOaBbs1/role-one-83 + desc 'delete initial role from CR and create a new one' + set +o xtrace ----------------------------------------------------------------------------------- delete initial role from CR and create a new one ----------------------------------------------------------------------------------- + kubectl_bin patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"roles":[\n\t\t\t{\n\t\t\t\t"role": "role-two",\n\t\t\t\t"db": "admin",\n\t\t\t\t"privileges": [\n\t\t\t\t\t{\n\t\t\t\t\t\t"resource": {\n\t\t\t\t\t\t\t"db": "config",\n\t\t\t\t\t\t\t"collection": ""\n\t\t\t\t\t\t},\n\t\t\t\t\t\t"actions": [\n\t\t\t\t\t\t\t"find"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t"roles": [\n\t\t\t\t\t{\n\t\t\t\t\t\t"role": "read",\n\t\t\t\t\t\t"db": "admin"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t}}' ++ mktemp + local LAST_OUT=/tmp/tmp.GPNcx6paql ++ mktemp + local LAST_ERR=/tmp/tmp.ILRterfAFv + local exit_status=0 + local timeout=4 + local i + args=('patch' 'psmdb' 'some-name' '--type=merge' '--patch' '{ "spec": {"roles":[ { "role": "role-two", "db": "admin", "privileges": [ { "resource": { "db": "config", "collection": "" }, "actions": [ "find" ] } ], "roles": [ { "role": "read", "db": "admin" } ] } ] }}') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ patch == \- ]] + [[ patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb == \- ]] + [[ psmdb =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ some-name == \- ]] + [[ some-name =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --type=merge == \- ]] + [[ --type=merge =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --patch == \- ]] + [[ --patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ { "spec": {"roles":[ { "role": "role-two", "db": "admin", "privileges": [ { "resource": { "db": "config", "collection": "" }, "actions": [ "find" ] } ], "roles": [ { "role": "read", "db": "admin" } ] } ] }} == \- ]] + [[ { "spec": {"roles":[ { "role": "role-two", "db": "admin", "privileges": [ { "resource": { "db": "config", "collection": "" }, "actions": [ "find" ] } ], "roles": [ { "role": "read", "db": "admin" } ] } ] }} =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"roles":[\n\t\t\t{\n\t\t\t\t"role": "role-two",\n\t\t\t\t"db": "admin",\n\t\t\t\t"privileges": [\n\t\t\t\t\t{\n\t\t\t\t\t\t"resource": {\n\t\t\t\t\t\t\t"db": "config",\n\t\t\t\t\t\t\t"collection": ""\n\t\t\t\t\t\t},\n\t\t\t\t\t\t"actions": [\n\t\t\t\t\t\t\t"find"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t"roles": [\n\t\t\t\t\t{\n\t\t\t\t\t\t"role": "read",\n\t\t\t\t\t\t"db": "admin"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t}}' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.GPNcx6paql perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.ILRterfAFv + rm /tmp/tmp.GPNcx6paql /tmp/tmp.ILRterfAFv + return 0 + wait_for_running some-name-rs0 3 + local name=some-name-rs0 + let last_pod=2 + local check_cluster_readiness=true + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=rs0 + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-rs0-0 + local pod=some-name-rs0-0 + set +o xtrace waiting for pod/some-name-rs0-0 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-rs0-1 + local pod=some-name-rs0-1 + set +o xtrace waiting for pod/some-name-rs0-1 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.EfoXdfV7eZ +++ mktemp ++ local LAST_ERR=/tmp/tmp.T7Xq1EE0z4 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.EfoXdfV7eZ ++ cat /tmp/tmp.T7Xq1EE0z4 ++ rm /tmp/tmp.EfoXdfV7eZ /tmp/tmp.T7Xq1EE0z4 ++ return 0 + [[ '' == true ]] + wait_pod some-name-rs0-2 + local pod=some-name-rs0-2 + set +o xtrace waiting for pod/some-name-rs0-2 to be ready.OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.lmaLc7J5Mi +++ mktemp ++ local LAST_ERR=/tmp/tmp.dBzQn6DZwI ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.lmaLc7J5Mi ++ cat /tmp/tmp.dBzQn6DZwI ++ rm /tmp/tmp.lmaLc7J5Mi /tmp/tmp.dBzQn6DZwI ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.XIxUrB5vL2 +++ mktemp ++ local LAST_ERR=/tmp/tmp.oqrkKSInSi ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.XIxUrB5vL2 ++ cat /tmp/tmp.oqrkKSInSi ++ rm /tmp/tmp.XIxUrB5vL2 /tmp/tmp.oqrkKSInSi ++ return 0 + [[ '' == true ]] + sleep 10 + [[ true == true ]] + set +x Waiting for cluster some-name to be ready ++ get_role_cmd '"role-one"' ++ local 'role="role-one"' ++ cmd=$'(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' ++ echo $'(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + compare admin $'(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 role-one + local database=admin + local $'command=(function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=role-one + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-one-83.json ']' + target=role-one-83 + run_mongos $'use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + grep -E -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:' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.UqXk7XnGH1 +++ mktemp ++ local LAST_ERR=/tmp/tmp.4AVep9moY2 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.UqXk7XnGH1 ++ cat /tmp/tmp.4AVep9moY2 ++ rm /tmp/tmp.UqXk7XnGH1 /tmp/tmp.4AVep9moY2 ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.pEkhp59sZi ++ mktemp + local LAST_ERR=/tmp/tmp.Ii2nWJJ5cI + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-one", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.pEkhp59sZi + cat /tmp/tmp.Ii2nWJJ5cI + rm /tmp/tmp.pEkhp59sZi /tmp/tmp.Ii2nWJJ5cI + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-one-83.json /tmp/tmp.EvydOaBbs1/role-one-83 ++ get_role_cmd '"role-two"' ++ local 'role="role-two"' ++ cmd=$'(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' ++ echo $'(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + compare admin $'(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 role-two + local database=admin + local $'command=(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=role-two + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-two-83.json ']' + target=role-two-83 + run_mongos $'use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + grep -E -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:' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.DOX19ZxOPn +++ mktemp ++ local LAST_ERR=/tmp/tmp.qyWdjNQnab ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.DOX19ZxOPn ++ cat /tmp/tmp.qyWdjNQnab ++ rm /tmp/tmp.DOX19ZxOPn /tmp/tmp.qyWdjNQnab ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.QOFVRxx7CX ++ mktemp + local LAST_ERR=/tmp/tmp.98dEaVvTiL + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.QOFVRxx7CX + cat /tmp/tmp.98dEaVvTiL + rm /tmp/tmp.QOFVRxx7CX /tmp/tmp.98dEaVvTiL + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-two-83.json /tmp/tmp.EvydOaBbs1/role-two-83 + desc 'check role update from CR' + set +o xtrace ----------------------------------------------------------------------------------- check role update from CR ----------------------------------------------------------------------------------- + kubectl_bin patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"roles":[\n\t\t\t{\n\t\t\t\t"role": "role-two",\n\t\t\t\t"db": "admin",\n\t\t\t\t"privileges": [\n\t\t\t\t\t{\n\t\t\t\t\t\t"resource": {\n\t\t\t\t\t\t\t"db": "config",\n\t\t\t\t\t\t\t"collection": ""\n\t\t\t\t\t\t},\n\t\t\t\t\t\t"actions": [\n\t\t\t\t\t\t\t"find"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t}}' ++ mktemp + local LAST_OUT=/tmp/tmp.y5Jwvi3wBC ++ mktemp + local LAST_ERR=/tmp/tmp.7BX6TlZrP8 + local exit_status=0 + local timeout=4 + local i + args=('patch' 'psmdb' 'some-name' '--type=merge' '--patch' '{ "spec": {"roles":[ { "role": "role-two", "db": "admin", "privileges": [ { "resource": { "db": "config", "collection": "" }, "actions": [ "find" ] } ] } ] }}') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ patch == \- ]] + [[ patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb == \- ]] + [[ psmdb =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ some-name == \- ]] + [[ some-name =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --type=merge == \- ]] + [[ --type=merge =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --patch == \- ]] + [[ --patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ { "spec": {"roles":[ { "role": "role-two", "db": "admin", "privileges": [ { "resource": { "db": "config", "collection": "" }, "actions": [ "find" ] } ] } ] }} == \- ]] + [[ { "spec": {"roles":[ { "role": "role-two", "db": "admin", "privileges": [ { "resource": { "db": "config", "collection": "" }, "actions": [ "find" ] } ] } ] }} =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"roles":[\n\t\t\t{\n\t\t\t\t"role": "role-two",\n\t\t\t\t"db": "admin",\n\t\t\t\t"privileges": [\n\t\t\t\t\t{\n\t\t\t\t\t\t"resource": {\n\t\t\t\t\t\t\t"db": "config",\n\t\t\t\t\t\t\t"collection": ""\n\t\t\t\t\t\t},\n\t\t\t\t\t\t"actions": [\n\t\t\t\t\t\t\t"find"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t}}' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.y5Jwvi3wBC perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.7BX6TlZrP8 + rm /tmp/tmp.y5Jwvi3wBC /tmp/tmp.7BX6TlZrP8 + return 0 + wait_for_running some-name-rs0 3 + local name=some-name-rs0 + let last_pod=2 + local check_cluster_readiness=true + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=rs0 + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-rs0-0 + local pod=some-name-rs0-0 + set +o xtrace waiting for pod/some-name-rs0-0 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-rs0-1 + local pod=some-name-rs0-1 + set +o xtrace waiting for pod/some-name-rs0-1 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.ucmbLHeB8c +++ mktemp ++ local LAST_ERR=/tmp/tmp.bSa62qOScR ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.ucmbLHeB8c ++ cat /tmp/tmp.bSa62qOScR ++ rm /tmp/tmp.ucmbLHeB8c /tmp/tmp.bSa62qOScR ++ return 0 + [[ '' == true ]] + wait_pod some-name-rs0-2 + local pod=some-name-rs0-2 + set +o xtrace waiting for pod/some-name-rs0-2 to be ready.OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.OKG41W2kyt +++ mktemp ++ local LAST_ERR=/tmp/tmp.tJ3biBdBav ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.OKG41W2kyt ++ cat /tmp/tmp.tJ3biBdBav ++ rm /tmp/tmp.OKG41W2kyt /tmp/tmp.tJ3biBdBav ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.SVoYImAUu4 +++ mktemp ++ local LAST_ERR=/tmp/tmp.kHcczWuEdF ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.SVoYImAUu4 ++ cat /tmp/tmp.kHcczWuEdF ++ rm /tmp/tmp.SVoYImAUu4 /tmp/tmp.kHcczWuEdF ++ return 0 + [[ '' == true ]] + sleep 10 + [[ true == true ]] + set +x Waiting for cluster some-name to be ready ++ get_role_cmd '"role-two"' ++ local 'role="role-two"' ++ cmd=$'(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' ++ echo $'(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + compare admin $'(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 role-two-updated + local database=admin + local $'command=(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=role-two-updated + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-two-updated-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + grep -E -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:' + local $'command=use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.hC0pqbF1Vt +++ mktemp ++ local LAST_ERR=/tmp/tmp.IlMMsrZKny ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.hC0pqbF1Vt ++ cat /tmp/tmp.IlMMsrZKny ++ rm /tmp/tmp.hC0pqbF1Vt /tmp/tmp.IlMMsrZKny ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.tsQICdoN8P ++ mktemp + local LAST_ERR=/tmp/tmp.mFjkNO9m1Q + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.tsQICdoN8P + cat /tmp/tmp.mFjkNO9m1Q + rm /tmp/tmp.tsQICdoN8P /tmp/tmp.mFjkNO9m1Q + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-two-updated.json /tmp/tmp.EvydOaBbs1/role-two-updated + desc 'check role update from DB' + set +o xtrace ----------------------------------------------------------------------------------- check role update from DB ----------------------------------------------------------------------------------- + run_mongos 'use admin\n db.updateRole( "role-two",{privileges:[{resource: {db:"config", collection:"" }, actions: ["find", "update"]}]})' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local 'command=use admin\n db.updateRole( "role-two",{privileges:[{resource: {db:"config", collection:"" }, actions: ["find", "update"]}]})' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.QaNww8iEki +++ mktemp ++ local LAST_ERR=/tmp/tmp.LuvPNMFjV6 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.QaNww8iEki ++ cat /tmp/tmp.LuvPNMFjV6 ++ rm /tmp/tmp.QaNww8iEki /tmp/tmp.LuvPNMFjV6 ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''use admin\n db.updateRole( "role-two",{privileges:[{resource: {db:"config", collection:"" }, actions: ["find", "update"]}]})\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.BZ9k0Qdb8S ++ mktemp + local LAST_ERR=/tmp/tmp.CjoSwdH3cX + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n db.updateRole( "role-two",{privileges:[{resource: {db:"config", collection:"" }, actions: ["find", "update"]}]})\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n db.updateRole( "role-two",{privileges:[{resource: {db:"config", collection:"" }, actions: ["find", "update"]}]})\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n db.updateRole( "role-two",{privileges:[{resource: {db:"config", collection:"" }, actions: ["find", "update"]}]})\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c 'export HOME=/tmp; printf '\''use admin\n db.updateRole( "role-two",{privileges:[{resource: {db:"config", collection:"" }, actions: ["find", "update"]}]})\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.BZ9k0Qdb8S Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("02e15407-0bac-4ebb-98b4-5ddca6dba60e") } Percona Server for MongoDB server version: v8.3.17-5 WARNING: shell and server versions do not match switched to db admin bye + cat /tmp/tmp.CjoSwdH3cX + rm /tmp/tmp.BZ9k0Qdb8S /tmp/tmp.CjoSwdH3cX + return 0 ++ get_role_cmd '"role-two"' ++ local 'role="role-two"' ++ cmd=$'(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' ++ echo $'(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + retry 30 5 compare admin $'(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 role-two-updated + local max=30 + local delay=5 + shift 2 + local n=1 + compare admin $'(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 role-two-updated + local database=admin + local $'command=(function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=role-two-updated + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-two-updated-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + grep -E -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:' + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.yed3tA6tp2 +++ mktemp ++ local LAST_ERR=/tmp/tmp.wOmUARaqEr ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.yed3tA6tp2 ++ cat /tmp/tmp.wOmUARaqEr ++ rm /tmp/tmp.yed3tA6tp2 /tmp/tmp.wOmUARaqEr ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.yBajXlKWjy ++ mktemp + local LAST_ERR=/tmp/tmp.3WKJG7g2Jq + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-two", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.yBajXlKWjy + cat /tmp/tmp.3WKJG7g2Jq + rm /tmp/tmp.yBajXlKWjy /tmp/tmp.3WKJG7g2Jq + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-two-updated.json /tmp/tmp.EvydOaBbs1/role-two-updated + desc 'check new role created after updated role name via CR' + set +o xtrace ----------------------------------------------------------------------------------- check new role created after updated role name via CR ----------------------------------------------------------------------------------- + kubectl_bin patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"roles":[\n\t\t\t{\n\t\t\t\t"role": "role-three",\n\t\t\t\t"db": "admin",\n\t\t\t\t"privileges": [\n\t\t\t\t\t{\n\t\t\t\t\t\t"resource": {\n\t\t\t\t\t\t\t"db": "config",\n\t\t\t\t\t\t\t"collection": ""\n\t\t\t\t\t\t},\n\t\t\t\t\t\t"actions": [\n\t\t\t\t\t\t\t"find"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t}}' ++ mktemp + local LAST_OUT=/tmp/tmp.lSEKCGXvTD ++ mktemp + local LAST_ERR=/tmp/tmp.HJ9XfBjw0c + local exit_status=0 + local timeout=4 + local i + args=('patch' 'psmdb' 'some-name' '--type=merge' '--patch' '{ "spec": {"roles":[ { "role": "role-three", "db": "admin", "privileges": [ { "resource": { "db": "config", "collection": "" }, "actions": [ "find" ] } ] } ] }}') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ patch == \- ]] + [[ patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb == \- ]] + [[ psmdb =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ some-name == \- ]] + [[ some-name =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --type=merge == \- ]] + [[ --type=merge =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --patch == \- ]] + [[ --patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ { "spec": {"roles":[ { "role": "role-three", "db": "admin", "privileges": [ { "resource": { "db": "config", "collection": "" }, "actions": [ "find" ] } ] } ] }} == \- ]] + [[ { "spec": {"roles":[ { "role": "role-three", "db": "admin", "privileges": [ { "resource": { "db": "config", "collection": "" }, "actions": [ "find" ] } ] } ] }} =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {"roles":[\n\t\t\t{\n\t\t\t\t"role": "role-three",\n\t\t\t\t"db": "admin",\n\t\t\t\t"privileges": [\n\t\t\t\t\t{\n\t\t\t\t\t\t"resource": {\n\t\t\t\t\t\t\t"db": "config",\n\t\t\t\t\t\t\t"collection": ""\n\t\t\t\t\t\t},\n\t\t\t\t\t\t"actions": [\n\t\t\t\t\t\t\t"find"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t}}' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.lSEKCGXvTD perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.HJ9XfBjw0c + rm /tmp/tmp.lSEKCGXvTD /tmp/tmp.HJ9XfBjw0c + return 0 + wait_for_running some-name-rs0 3 + local name=some-name-rs0 + let last_pod=2 + local check_cluster_readiness=true + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=rs0 + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-rs0-0 + local pod=some-name-rs0-0 + set +o xtrace waiting for pod/some-name-rs0-0 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-rs0-1 + local pod=some-name-rs0-1 + set +o xtrace waiting for pod/some-name-rs0-1 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.r6wo5Nco7z +++ mktemp ++ local LAST_ERR=/tmp/tmp.9RHGPNJ85i ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.r6wo5Nco7z ++ cat /tmp/tmp.9RHGPNJ85i ++ rm /tmp/tmp.r6wo5Nco7z /tmp/tmp.9RHGPNJ85i ++ return 0 + [[ '' == true ]] + wait_pod some-name-rs0-2 + local pod=some-name-rs0-2 + set +o xtrace waiting for pod/some-name-rs0-2 to be ready.OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.3lhclQFPGL +++ mktemp ++ local LAST_ERR=/tmp/tmp.P5XbKPfVvY ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.3lhclQFPGL ++ cat /tmp/tmp.P5XbKPfVvY ++ rm /tmp/tmp.3lhclQFPGL /tmp/tmp.P5XbKPfVvY ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.eQEtI8JWuP +++ mktemp ++ local LAST_ERR=/tmp/tmp.WDKSNiANoQ ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.eQEtI8JWuP ++ cat /tmp/tmp.WDKSNiANoQ ++ rm /tmp/tmp.eQEtI8JWuP /tmp/tmp.WDKSNiANoQ ++ return 0 + [[ '' == true ]] + sleep 10 + [[ true == true ]] + set +x Waiting for cluster some-name to be ready ++ get_role_cmd '"role-three"' ++ local 'role="role-three"' ++ cmd=$'(function() {\n\tvar role = db.getRole("role-three", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' ++ echo $'(function() {\n\tvar role = db.getRole("role-three", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + compare admin $'(function() {\n\tvar role = db.getRole("role-three", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 role-three + local database=admin + local $'command=(function() {\n\tvar role = db.getRole("role-three", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=role-three + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-three-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use admin\\n (function() {\n\tvar role = db.getRole("role-three", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + grep -E -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:' + local $'command=use admin\\n (function() {\n\tvar role = db.getRole("role-three", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.koIESRgMYi +++ mktemp ++ local LAST_ERR=/tmp/tmp.AxuZSxAQiI ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.koIESRgMYi ++ cat /tmp/tmp.AxuZSxAQiI ++ rm /tmp/tmp.koIESRgMYi /tmp/tmp.AxuZSxAQiI ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-three", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.KVUW7T1aCT ++ mktemp + local LAST_ERR=/tmp/tmp.Bleuk6ubWC + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use admin\n (function() { var role = db.getRole("role-three", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-three", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use admin\n (function() { var role = db.getRole("role-three", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use admin\\n (function() {\n\tvar role = db.getRole("role-three", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.KVUW7T1aCT + cat /tmp/tmp.Bleuk6ubWC + rm /tmp/tmp.KVUW7T1aCT /tmp/tmp.Bleuk6ubWC + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-three.json /tmp/tmp.EvydOaBbs1/role-three + desc 'check creating multiple roles and the users in a single CR apply' + set +o xtrace ----------------------------------------------------------------------------------- check creating multiple roles and the users in a single CR apply ----------------------------------------------------------------------------------- + kubectl_bin patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {\n\t\t\t"roles": [\n\t\t\t\t{\n\t\t\t\t"role": "role-four",\n\t\t\t\t"db": "testAdmin1",\n\t\t\t\t"privileges": [\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin1",\n\t\t\t\t\t\t"collection": ""\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"find",\n\t\t\t\t\t\t"listIndexes",\n\t\t\t\t\t\t"listCollections"\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin1",\n\t\t\t\t\t\t"collection": "system.profile"\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"dbStats",\n\t\t\t\t\t\t"collStats",\n\t\t\t\t\t\t"indexStats"\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin1",\n\t\t\t\t\t\t"collection": "system.version"\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"find"\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t"role": "role-five",\n\t\t\t\t"db": "testAdmin2",\n\t\t\t\t"privileges": [\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin2",\n\t\t\t\t\t\t"collection": ""\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"find",\n\t\t\t\t\t\t"listIndexes",\n\t\t\t\t\t\t"listCollections"\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin2",\n\t\t\t\t\t\t"collection": "system.profile"\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"dbStats",\n\t\t\t\t\t\t"collStats",\n\t\t\t\t\t\t"indexStats"\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin2",\n\t\t\t\t\t\t"collection": "system.version"\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"find"\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\t\t\t"users": [\n\t\t\t\t{\n\t\t\t\t"name": "user-five",\n\t\t\t\t"db": "testAdmin",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-one",\n\t\t\t\t\t"key": "userOnePassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{\n\t\t\t\t\t\t"name": "role-four",\n\t\t\t\t\t\t"db": "testAdmin1"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t"name": "role-five",\n\t\t\t\t\t\t"db": "testAdmin2"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t"name": "user-six",\n\t\t\t\t"db": "testAdmin",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-one",\n\t\t\t\t\t"key": "userOnePassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{\n\t\t\t\t\t"name": "role-five",\n\t\t\t\t\t"db": "testAdmin2"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t}}' ++ mktemp + local LAST_OUT=/tmp/tmp.vc44rbS9T7 ++ mktemp + local LAST_ERR=/tmp/tmp.Gn4Ks61a43 + local exit_status=0 + local timeout=4 + local i + args=('patch' 'psmdb' 'some-name' '--type=merge' '--patch' '{ "spec": { "roles": [ { "role": "role-four", "db": "testAdmin1", "privileges": [ { "resource": { "db": "testAdmin1", "collection": "" }, "actions": [ "find", "listIndexes", "listCollections" ] }, { "resource": { "db": "testAdmin1", "collection": "system.profile" }, "actions": [ "dbStats", "collStats", "indexStats" ] }, { "resource": { "db": "testAdmin1", "collection": "system.version" }, "actions": [ "find" ] } ] }, { "role": "role-five", "db": "testAdmin2", "privileges": [ { "resource": { "db": "testAdmin2", "collection": "" }, "actions": [ "find", "listIndexes", "listCollections" ] }, { "resource": { "db": "testAdmin2", "collection": "system.profile" }, "actions": [ "dbStats", "collStats", "indexStats" ] }, { "resource": { "db": "testAdmin2", "collection": "system.version" }, "actions": [ "find" ] } ] } ], "users": [ { "name": "user-five", "db": "testAdmin", "passwordSecretRef": { "name": "user-one", "key": "userOnePassKey" }, "roles": [ { "name": "role-four", "db": "testAdmin1" }, { "name": "role-five", "db": "testAdmin2" } ] }, { "name": "user-six", "db": "testAdmin", "passwordSecretRef": { "name": "user-one", "key": "userOnePassKey" }, "roles": [ { "name": "role-five", "db": "testAdmin2" } ] } ] }}') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ patch == \- ]] + [[ patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb == \- ]] + [[ psmdb =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ some-name == \- ]] + [[ some-name =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --type=merge == \- ]] + [[ --type=merge =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --patch == \- ]] + [[ --patch =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ { "spec": { "roles": [ { "role": "role-four", "db": "testAdmin1", "privileges": [ { "resource": { "db": "testAdmin1", "collection": "" }, "actions": [ "find", "listIndexes", "listCollections" ] }, { "resource": { "db": "testAdmin1", "collection": "system.profile" }, "actions": [ "dbStats", "collStats", "indexStats" ] }, { "resource": { "db": "testAdmin1", "collection": "system.version" }, "actions": [ "find" ] } ] }, { "role": "role-five", "db": "testAdmin2", "privileges": [ { "resource": { "db": "testAdmin2", "collection": "" }, "actions": [ "find", "listIndexes", "listCollections" ] }, { "resource": { "db": "testAdmin2", "collection": "system.profile" }, "actions": [ "dbStats", "collStats", "indexStats" ] }, { "resource": { "db": "testAdmin2", "collection": "system.version" }, "actions": [ "find" ] } ] } ], "users": [ { "name": "user-five", "db": "testAdmin", "passwordSecretRef": { "name": "user-one", "key": "userOnePassKey" }, "roles": [ { "name": "role-four", "db": "testAdmin1" }, { "name": "role-five", "db": "testAdmin2" } ] }, { "name": "user-six", "db": "testAdmin", "passwordSecretRef": { "name": "user-one", "key": "userOnePassKey" }, "roles": [ { "name": "role-five", "db": "testAdmin2" } ] } ] }} == \- ]] + [[ { "spec": { "roles": [ { "role": "role-four", "db": "testAdmin1", "privileges": [ { "resource": { "db": "testAdmin1", "collection": "" }, "actions": [ "find", "listIndexes", "listCollections" ] }, { "resource": { "db": "testAdmin1", "collection": "system.profile" }, "actions": [ "dbStats", "collStats", "indexStats" ] }, { "resource": { "db": "testAdmin1", "collection": "system.version" }, "actions": [ "find" ] } ] }, { "role": "role-five", "db": "testAdmin2", "privileges": [ { "resource": { "db": "testAdmin2", "collection": "" }, "actions": [ "find", "listIndexes", "listCollections" ] }, { "resource": { "db": "testAdmin2", "collection": "system.profile" }, "actions": [ "dbStats", "collStats", "indexStats" ] }, { "resource": { "db": "testAdmin2", "collection": "system.version" }, "actions": [ "find" ] } ] } ], "users": [ { "name": "user-five", "db": "testAdmin", "passwordSecretRef": { "name": "user-one", "key": "userOnePassKey" }, "roles": [ { "name": "role-four", "db": "testAdmin1" }, { "name": "role-five", "db": "testAdmin2" } ] }, { "name": "user-six", "db": "testAdmin", "passwordSecretRef": { "name": "user-one", "key": "userOnePassKey" }, "roles": [ { "name": "role-five", "db": "testAdmin2" } ] } ] }} =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl patch psmdb some-name --type=merge --patch $'{\n\t\t"spec": {\n\t\t\t"roles": [\n\t\t\t\t{\n\t\t\t\t"role": "role-four",\n\t\t\t\t"db": "testAdmin1",\n\t\t\t\t"privileges": [\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin1",\n\t\t\t\t\t\t"collection": ""\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"find",\n\t\t\t\t\t\t"listIndexes",\n\t\t\t\t\t\t"listCollections"\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin1",\n\t\t\t\t\t\t"collection": "system.profile"\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"dbStats",\n\t\t\t\t\t\t"collStats",\n\t\t\t\t\t\t"indexStats"\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin1",\n\t\t\t\t\t\t"collection": "system.version"\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"find"\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t"role": "role-five",\n\t\t\t\t"db": "testAdmin2",\n\t\t\t\t"privileges": [\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin2",\n\t\t\t\t\t\t"collection": ""\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"find",\n\t\t\t\t\t\t"listIndexes",\n\t\t\t\t\t\t"listCollections"\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin2",\n\t\t\t\t\t\t"collection": "system.profile"\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"dbStats",\n\t\t\t\t\t\t"collStats",\n\t\t\t\t\t\t"indexStats"\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t"resource": {\n\t\t\t\t\t\t"db": "testAdmin2",\n\t\t\t\t\t\t"collection": "system.version"\n\t\t\t\t\t},\n\t\t\t\t\t"actions": [\n\t\t\t\t\t\t"find"\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\t\t\t"users": [\n\t\t\t\t{\n\t\t\t\t"name": "user-five",\n\t\t\t\t"db": "testAdmin",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-one",\n\t\t\t\t\t"key": "userOnePassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{\n\t\t\t\t\t\t"name": "role-four",\n\t\t\t\t\t\t"db": "testAdmin1"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t"name": "role-five",\n\t\t\t\t\t\t"db": "testAdmin2"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t"name": "user-six",\n\t\t\t\t"db": "testAdmin",\n\t\t\t\t"passwordSecretRef": {\n\t\t\t\t\t"name": "user-one",\n\t\t\t\t\t"key": "userOnePassKey"\n\t\t\t\t},\n\t\t\t\t"roles": [\n\t\t\t\t\t{\n\t\t\t\t\t"name": "role-five",\n\t\t\t\t\t"db": "testAdmin2"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t}}' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.vc44rbS9T7 perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.Gn4Ks61a43 + rm /tmp/tmp.vc44rbS9T7 /tmp/tmp.Gn4Ks61a43 + return 0 + wait_for_running some-name-rs0 3 + local name=some-name-rs0 + let last_pod=2 + local check_cluster_readiness=true + set_debug + [[ 1 == 1 ]] + set -o xtrace + local rs_name=rs0 + local cluster_name=some-name ++ seq 0 2 + for i in $(seq 0 $last_pod) + [[ 0 -eq 2 ]] + wait_pod some-name-rs0-0 + local pod=some-name-rs0-0 + set +o xtrace waiting for pod/some-name-rs0-0 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 1 -eq 2 ]] + wait_pod some-name-rs0-1 + local pod=some-name-rs0-1 + set +o xtrace waiting for pod/some-name-rs0-1 to be ready.OK + for i in $(seq 0 $last_pod) + [[ 2 -eq 2 ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.8IfGiMCNem +++ mktemp ++ local LAST_ERR=/tmp/tmp.QQgvc5eBil ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].arbiter.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.8IfGiMCNem ++ cat /tmp/tmp.QQgvc5eBil ++ rm /tmp/tmp.8IfGiMCNem /tmp/tmp.QQgvc5eBil ++ return 0 + [[ '' == true ]] + wait_pod some-name-rs0-2 + local pod=some-name-rs0-2 + set +o xtrace waiting for pod/some-name-rs0-2 to be ready.OK ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.TvEtNp2lEP +++ mktemp ++ local LAST_ERR=/tmp/tmp.YR3VnKReYc ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].nonvoting.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.TvEtNp2lEP ++ cat /tmp/tmp.YR3VnKReYc ++ rm /tmp/tmp.TvEtNp2lEP /tmp/tmp.YR3VnKReYc ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.Y2pGf5ukZS +++ mktemp ++ local LAST_ERR=/tmp/tmp.LLygwZRTXR ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'psmdb' 'some-name' '-o' 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb == \- ]] ++ [[ psmdb =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ some-name == \- ]] ++ [[ some-name =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} == \- ]] ++ [[ jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.Y2pGf5ukZS ++ cat /tmp/tmp.LLygwZRTXR ++ rm /tmp/tmp.Y2pGf5ukZS /tmp/tmp.LLygwZRTXR ++ return 0 + [[ '' == true ]] + sleep 10 + [[ true == true ]] + set +x Waiting for cluster some-name to be ready ++ get_role_cmd '"role-four"' ++ local 'role="role-four"' ++ cmd=$'(function() {\n\tvar role = db.getRole("role-four", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' ++ echo $'(function() {\n\tvar role = db.getRole("role-four", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + compare testAdmin1 $'(function() {\n\tvar role = db.getRole("role-four", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 role-four + local database=testAdmin1 + local $'command=(function() {\n\tvar role = db.getRole("role-four", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=role-four + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-four-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use testAdmin1\\n (function() {\n\tvar role = db.getRole("role-four", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + grep -E -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:' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + local $'command=use testAdmin1\\n (function() {\n\tvar role = db.getRole("role-four", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.BpKqzvL9fi +++ mktemp ++ local LAST_ERR=/tmp/tmp.hGCnkue6GB ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.BpKqzvL9fi ++ cat /tmp/tmp.hGCnkue6GB ++ rm /tmp/tmp.BpKqzvL9fi /tmp/tmp.hGCnkue6GB ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use testAdmin1\\n (function() {\n\tvar role = db.getRole("role-four", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.MwxziCkXhM ++ mktemp + local LAST_ERR=/tmp/tmp.106gs1dqe1 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use testAdmin1\n (function() { var role = db.getRole("role-four", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use testAdmin1\n (function() { var role = db.getRole("role-four", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use testAdmin1\n (function() { var role = db.getRole("role-four", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use testAdmin1\\n (function() {\n\tvar role = db.getRole("role-four", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.MwxziCkXhM + cat /tmp/tmp.106gs1dqe1 + rm /tmp/tmp.MwxziCkXhM /tmp/tmp.106gs1dqe1 + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-four.json /tmp/tmp.EvydOaBbs1/role-four ++ get_role_cmd '"role-five"' ++ local 'role="role-five"' ++ cmd=$'(function() {\n\tvar role = db.getRole("role-five", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' ++ echo $'(function() {\n\tvar role = db.getRole("role-five", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + compare testAdmin2 $'(function() {\n\tvar role = db.getRole("role-five", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 role-five + local database=testAdmin2 + local $'command=(function() {\n\tvar role = db.getRole("role-five", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=role-five + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-five-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use testAdmin2\\n (function() {\n\tvar role = db.getRole("role-five", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use testAdmin2\\n (function() {\n\tvar role = db.getRole("role-five", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + grep -E -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:' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.jOxjMPjstw +++ mktemp ++ local LAST_ERR=/tmp/tmp.dfGOtqCgio ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.jOxjMPjstw ++ cat /tmp/tmp.dfGOtqCgio ++ rm /tmp/tmp.jOxjMPjstw /tmp/tmp.dfGOtqCgio ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use testAdmin2\\n (function() {\n\tvar role = db.getRole("role-five", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.U8IG7JBXCK ++ mktemp + local LAST_ERR=/tmp/tmp.rtp33vpcUs + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use testAdmin2\n (function() { var role = db.getRole("role-five", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use testAdmin2\n (function() { var role = db.getRole("role-five", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use testAdmin2\n (function() { var role = db.getRole("role-five", {showPrivileges: true, showAuthenticationRestrictions: true}); var roles = role.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); role.roles = roles; printjson(role); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use testAdmin2\\n (function() {\n\tvar role = db.getRole("role-five", {showPrivileges: true, showAuthenticationRestrictions: true});\n\tvar roles = role.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\trole.roles = roles;\n\tprintjson(role);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.U8IG7JBXCK + cat /tmp/tmp.rtp33vpcUs + rm /tmp/tmp.U8IG7JBXCK /tmp/tmp.rtp33vpcUs + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/role-five.json /tmp/tmp.EvydOaBbs1/role-five ++ get_user_cmd '"user-five"' ++ local 'user="user-five"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-five");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-five");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare testAdmin $'(function() {\n\tvar user = db.getUser("user-five");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-five + local database=testAdmin + local $'command=(function() {\n\tvar user = db.getUser("user-five");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-five + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-five-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use testAdmin\\n (function() {\n\tvar user = db.getUser("user-five");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use testAdmin\\n (function() {\n\tvar user = db.getUser("user-five");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + grep -E -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:' + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + sed '/"userId"/d' ++ echo .svc.cluster.local ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.aI5ZK2G4rz +++ mktemp ++ local LAST_ERR=/tmp/tmp.IiP24nH4Og ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.aI5ZK2G4rz ++ cat /tmp/tmp.IiP24nH4Og ++ rm /tmp/tmp.aI5ZK2G4rz /tmp/tmp.IiP24nH4Og ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use testAdmin\\n (function() {\n\tvar user = db.getUser("user-five");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.AAwm5wdSDM ++ mktemp + local LAST_ERR=/tmp/tmp.1Uj8yCgacf + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use testAdmin\n (function() { var user = db.getUser("user-five"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use testAdmin\n (function() { var user = db.getUser("user-five"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use testAdmin\n (function() { var user = db.getUser("user-five"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use testAdmin\\n (function() {\n\tvar user = db.getUser("user-five");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.AAwm5wdSDM + cat /tmp/tmp.1Uj8yCgacf + rm /tmp/tmp.AAwm5wdSDM /tmp/tmp.1Uj8yCgacf + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-five.json /tmp/tmp.EvydOaBbs1/user-five ++ get_user_cmd '"user-six"' ++ local 'user="user-six"' ++ cmd=$'(function() {\n\tvar user = db.getUser("user-six");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' ++ echo $'(function() {\n\tvar user = db.getUser("user-six");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + compare testAdmin $'(function() {\n\tvar user = db.getUser("user-six");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 user-six + local database=testAdmin + local $'command=(function() {\n\tvar user = db.getUser("user-six");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local target=user-six + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-six-83.json ']' + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 5\.0 ]] + run_mongos $'use testAdmin\\n (function() {\n\tvar user = db.getUser("user-six");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 mongodb + local $'command=use testAdmin\\n (function() {\n\tvar user = db.getUser("user-six");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' ++ echo .svc.cluster.local + grep -E -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 '/"userId"/d' ++ awk -F: '{print $2}' + suffix_port= + [[ -z '' ]] + suffix=.svc.cluster.local:27017 ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.1ZtCITCSg5 +++ mktemp ++ local LAST_ERR=/tmp/tmp.FVQfrCQ4M8 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.1ZtCITCSg5 ++ cat /tmp/tmp.FVQfrCQ4M8 ++ rm /tmp/tmp.1ZtCITCSg5 /tmp/tmp.FVQfrCQ4M8 ++ return 0 + local client_container=psmdb-client-748949c7cd-8sjv5 + kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use testAdmin\\n (function() {\n\tvar user = db.getUser("user-six");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.A56k1037j5 ++ mktemp + local LAST_ERR=/tmp/tmp.7ffTuqKkZ0 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''use testAdmin\n (function() { var user = db.getUser("user-six"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n'\'' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ') + local args + transformed_files=() + local transformed_files + local stdin_manifest + for i in "${!args[@]}" + [[ exec == \- ]] + [[ exec =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ psmdb-client-748949c7cd-8sjv5 == \- ]] + [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -- == \- ]] + [[ -- =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ bash == \- ]] + [[ bash =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ -c == \- ]] + [[ -c =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ export HOME=/tmp; printf 'use testAdmin\n (function() { var user = db.getUser("user-six"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin == \- ]] + [[ export HOME=/tmp; printf 'use testAdmin\n (function() { var user = db.getUser("user-six"); var roles = user.roles; roles.sort((a, b) => { if (a.role < b.role) return -1; if (a.role > b.role) return 1; return 0; }); user.roles = roles; printjson(user); })();\n' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl exec psmdb-client-748949c7cd-8sjv5 -- bash -c $'export HOME=/tmp; printf \'use testAdmin\\n (function() {\n\tvar user = db.getUser("user-six");\n\tvar roles = user.roles;\n\troles.sort((a, b) => {\n\t\tif (a.role < b.role) return -1;\n\t\tif (a.role > b.role) return 1;\n\t\treturn 0;\n\t});\n\tuser.roles = roles;\n\tprintjson(user);\n\t})();\\n\' | mongo mongodb://userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.A56k1037j5 + cat /tmp/tmp.7ffTuqKkZ0 + rm /tmp/tmp.A56k1037j5 /tmp/tmp.7ffTuqKkZ0 + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/custom-users-roles-sharded/compare/user-six.json /tmp/tmp.EvydOaBbs1/user-six + retry 60 2 check_connection_strings user-one-conn-str + local max=60 + local delay=2 + shift 2 + local n=1 + check_connection_strings user-one-conn-str + local secret_name=user-one-conn-str + shift + local key_prefix + local data_keys + local data_key ++ kubectl_bin get secret user-one-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.uUa1LfCFAB +++ mktemp ++ local LAST_ERR=/tmp/tmp.gnAh5vDcxJ ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-one-conn-str' '-o' 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-one-conn-str == \- ]] ++ [[ user-one-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} == \- ]] ++ [[ go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-one-conn-str -o 'go-template={{range $key, $_ := .data}}{{$key}}{{"\n"}}{{end}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.uUa1LfCFAB ++ cat /tmp/tmp.gnAh5vDcxJ ++ rm /tmp/tmp.uUa1LfCFAB /tmp/tmp.gnAh5vDcxJ ++ return 0 + data_keys=$'user-five_mongos_connectionString\nuser-six_mongos_connectionString' + '[' -z $'user-five_mongos_connectionString\nuser-six_mongos_connectionString' ']' + IFS= + read -r data_key + '[' -z user-five_mongos_connectionString ']' + check_connection_string user-one-conn-str user-five_mongos_connectionString + local secret_name=user-one-conn-str + local data_key=user-five_mongos_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret user-one-conn-str -o 'go-template={{index .data "user-five_mongos_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.r80oAtR0hJ +++ mktemp ++ local LAST_ERR=/tmp/tmp.e4ozuX0ixt ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-one-conn-str' '-o' 'go-template={{index .data "user-five_mongos_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-one-conn-str == \- ]] ++ [[ user-one-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "user-five_mongos_connectionString"}} == \- ]] ++ [[ go-template={{index .data "user-five_mongos_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-one-conn-str -o 'go-template={{index .data "user-five_mongos_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.r80oAtR0hJ ++ cat /tmp/tmp.e4ozuX0ixt ++ rm /tmp/tmp.r80oAtR0hJ /tmp/tmp.e4ozuX0ixt ++ return 0 + connection_string='mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true' + '[' -z 'mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true' ']' + [[ mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.Ulj0tQdiHX +++ mktemp ++ local LAST_ERR=/tmp/tmp.BW1X2VIqQk ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.Ulj0tQdiHX ++ cat /tmp/tmp.BW1X2VIqQk ++ rm /tmp/tmp.Ulj0tQdiHX /tmp/tmp.BW1X2VIqQk ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.Dd3tYqE4uP +++ mktemp ++ local LAST_ERR=/tmp/tmp.nbjJRsMVc9 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true == \- ]] ++ [[ mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.Dd3tYqE4uP ++ cat /tmp/tmp.nbjJRsMVc9 ++ rm /tmp/tmp.Dd3tYqE4uP /tmp/tmp.nbjJRsMVc9 ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + '[' -z user-six_mongos_connectionString ']' + check_connection_string user-one-conn-str user-six_mongos_connectionString + local secret_name=user-one-conn-str + local data_key=user-six_mongos_connectionString + local connection_string + local client_container + local ping + tls_args=() + local tls_args ++ kubectl_bin get secret user-one-conn-str -o 'go-template={{index .data "user-six_mongos_connectionString"}}' ++ base64 -d +++ mktemp ++ local LAST_OUT=/tmp/tmp.LnpgMDIrae +++ mktemp ++ local LAST_ERR=/tmp/tmp.7weXdMm83K ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'secret' 'user-one-conn-str' '-o' 'go-template={{index .data "user-six_mongos_connectionString"}}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ secret == \- ]] ++ [[ secret =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ user-one-conn-str == \- ]] ++ [[ user-one-conn-str =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ go-template={{index .data "user-six_mongos_connectionString"}} == \- ]] ++ [[ go-template={{index .data "user-six_mongos_connectionString"}} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get secret user-one-conn-str -o 'go-template={{index .data "user-six_mongos_connectionString"}}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.LnpgMDIrae ++ cat /tmp/tmp.7weXdMm83K ++ rm /tmp/tmp.LnpgMDIrae /tmp/tmp.7weXdMm83K ++ return 0 + connection_string='mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true' + '[' -z 'mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true' ']' + [[ mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true == *tls\=true* ]] + tls_args+=(--tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames) ++ kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.hv9FoFteOD +++ mktemp ++ local LAST_ERR=/tmp/tmp.GX0N1ilovm ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('get' 'pods' '--selector=name=psmdb-client' '-o' 'jsonpath={.items[].metadata.name}') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ get == \- ]] ++ [[ get =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ pods == \- ]] ++ [[ pods =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --selector=name=psmdb-client == \- ]] ++ [[ --selector=name=psmdb-client =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -o == \- ]] ++ [[ -o =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ jsonpath={.items[].metadata.name} == \- ]] ++ [[ jsonpath={.items[].metadata.name} =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.hv9FoFteOD ++ cat /tmp/tmp.GX0N1ilovm ++ rm /tmp/tmp.hv9FoFteOD /tmp/tmp.GX0N1ilovm ++ return 0 + client_container=psmdb-client-748949c7cd-8sjv5 ++ kubectl_bin exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ grep -E -v 'I NETWORK|W 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:' +++ mktemp ++ local LAST_OUT=/tmp/tmp.8xi9mkpk5q +++ mktemp ++ local LAST_ERR=/tmp/tmp.uPy6BLYvYq ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-8sjv5' '--' 'mongo' 'mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true' '--quiet' '--tls' '--tlsCAFile' '/etc/mongodb-ssl/ca.crt' '--tlsCertificateKeyFile' '/tmp/tls.pem' '--tlsAllowInvalidHostnames' '--eval' 'db.runCommand({ ping: 1 }).ok') ++ local args ++ transformed_files=() ++ local transformed_files ++ local stdin_manifest ++ for i in "${!args[@]}" ++ [[ exec == \- ]] ++ [[ exec =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ psmdb-client-748949c7cd-8sjv5 == \- ]] ++ [[ psmdb-client-748949c7cd-8sjv5 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true == \- ]] ++ [[ mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --quiet == \- ]] ++ [[ --quiet =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tls == \- ]] ++ [[ --tls =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCAFile == \- ]] ++ [[ --tlsCAFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /etc/mongodb-ssl/ca.crt == \- ]] ++ [[ /etc/mongodb-ssl/ca.crt =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsCertificateKeyFile == \- ]] ++ [[ --tlsCertificateKeyFile =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ /tmp/tls.pem == \- ]] ++ [[ /tmp/tls.pem =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --tlsAllowInvalidHostnames == \- ]] ++ [[ --tlsAllowInvalidHostnames =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ --eval == \- ]] ++ [[ --eval =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ db.runCommand({ ping: 1 }).ok == \- ]] ++ [[ db.runCommand({ ping: 1 }).ok =~ ^(-f|--filename)=-$ ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ arch_scheduling_enabled ++ [[ -n '' ]] ++ local attempt ++ local delay +++ seq 0 9 ++ for attempt in $(seq 0 9) ++ set +e ++ kubectl exec psmdb-client-748949c7cd-8sjv5 -- mongo 'mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-25005.svc.cluster.local:27017/?authSource=testAdmin&tls=true' --quiet --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames --eval 'db.runCommand({ ping: 1 }).ok' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.8xi9mkpk5q ++ cat /tmp/tmp.uPy6BLYvYq ++ rm /tmp/tmp.8xi9mkpk5q /tmp/tmp.uPy6BLYvYq ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + destroy custom-users-roles-sharded-25005 + local namespace=custom-users-roles-sharded-25005 + local ignore_logs=true + [[ 1 == 1 ]] + echo 'SKIP_DELETE=1, not destroying custom-users-roles-sharded-25005' SKIP_DELETE=1, not destroying custom-users-roles-sharded-25005 + return + desc 'test passed' + set +o xtrace ----------------------------------------------------------------------------------- test passed ----------------------------------------------------------------------------------- ==================================================================================================== [PASSED] e2e-tests/test_pytest_wrapper.py::test_bash_wrapper ==================================================================================================== [09:18:00.373360] INFO Deleting cert-manager [09:18:17.635375] INFO Cleaning up test environment --------------------------------------- generated xml file: /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/reports/custom-users-roles-sharded.xml --------------------------------------- --------------------------------- Generated html report: file:///mnt/jenkins/workspace/cloud-psmdb-operator_PR-2742/e2e-tests/reports/custom-users-roles-sharded.html ---------------------------------- ==================================================================================== 1 passed in 678.18s (0:11:18) =====================================================================================