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-2715/.venv/bin/python cachedir: .pytest_cache metadata: {'Python': '3.14.10', 'Platform': 'Linux-7.1.10-200.fc44.x86_64-x86_64-with-glibc2.43', 'Packages': {'pytest': '9.1.1', 'pluggy': '1.7.0'}, 'Plugins': {'html': '4.2.0', 'json-report': '1.5.0', 'dependency': '0.6.1', 'metadata': '3.1.1'}, 'CI': 'true', 'BUILD_NUMBER': '9', 'BUILD_ID': '9', 'BUILD_URL': 'https://cloud.cd.percona.com/job/cloud-psmdb-operator/job/PR-2715/9/', 'NODE_NAME': 'hcloud-nialm8wqguv220jl', 'JOB_NAME': 'cloud-psmdb-operator/PR-2715', 'BUILD_TAG': 'jenkins-cloud-psmdb-operator-PR-2715-9', 'EXECUTOR_NUMBER': '0', 'JENKINS_URL': 'https://cloud.cd.percona.com/', 'WORKSPACE': '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715', 'GIT_COMMIT': '27e0b796072fe59ec1fa78fca82dc7491ddb9891', 'GIT_URL': 'https://github.com/percona/percona-server-mongodb-operator.git', 'GIT_BRANCH': 'PR-2715'} rootdir: /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715 configfile: pyproject.toml plugins: html-4.2.0, json-report-1.5.0, dependency-0.6.1, metadata-3.1.1 collecting ... collected 1 item e2e-tests/test_pytest_wrapper.py::test_bash_wrapper[custom-users-roles-sharded] [05:51:28.661265] WARNING kubectl error: Warning: version difference between client (1.37) and server (1.34) exceeds the supported minor version skew of +/-1 [05:51:29.924065] 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=27e0b796072fe59ec1fa78fca82dc7491ddb9891 GIT_BRANCH=PR-2715 OPERATOR_VERSION=1.24.0 IMAGE=docker.io/perconalab/percona-server-mongodb-operator:PR-2715-27e0b7960 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-23515 + local ns=custom-users-roles-sharded-23515 + echo custom-users-roles-sharded-23515 + destroy_cert_manager + [[ -n '' ]] + kubectl_bin delete mutatingwebhookconfiguration cert-manager-webhook --ignore-not-found ++ mktemp + local LAST_OUT=/tmp/tmp.uqXARtlrD1 ++ mktemp + local LAST_ERR=/tmp/tmp.vi3SvOp6Ag + 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.uqXARtlrD1 + cat /tmp/tmp.vi3SvOp6Ag + rm /tmp/tmp.uqXARtlrD1 /tmp/tmp.vi3SvOp6Ag + return 0 + kubectl_bin delete validatingwebhookconfiguration cert-manager-webhook --ignore-not-found ++ mktemp + local LAST_OUT=/tmp/tmp.IprFKH66oO ++ mktemp + local LAST_ERR=/tmp/tmp.NjoBVsIWDC + 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.IprFKH66oO + cat /tmp/tmp.NjoBVsIWDC + rm /tmp/tmp.IprFKH66oO /tmp/tmp.NjoBVsIWDC + 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.8DMmNu9UtK ++ mktemp + local LAST_ERR=/tmp/tmp.ebz9eo2EF4 + 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.8DMmNu9UtK + cat /tmp/tmp.ebz9eo2EF4 + rm /tmp/tmp.8DMmNu9UtK /tmp/tmp.ebz9eo2EF4 + return 0 + kubectl_bin delete namespace cert-manager --ignore-not-found --wait=false ++ mktemp + local LAST_OUT=/tmp/tmp.Hvx4DeaE3Y ++ mktemp + local LAST_ERR=/tmp/tmp.vHgdHl8xNG + 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.Hvx4DeaE3Y + cat /tmp/tmp.vHgdHl8xNG + rm /tmp/tmp.Hvx4DeaE3Y /tmp/tmp.vHgdHl8xNG + 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.7QJx687eKV +++ mktemp ++ local LAST_ERR=/tmp/tmp.m3mh6E0C4j ++ 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.7QJx687eKV ++ cat /tmp/tmp.m3mh6E0C4j ++ rm /tmp/tmp.7QJx687eKV /tmp/tmp.m3mh6E0C4j ++ return 0 + remaining= ++ kubectl_bin get validatingwebhookconfiguration cert-manager-webhook --ignore-not-found -o name +++ mktemp ++ local LAST_OUT=/tmp/tmp.vIf9mW0OAy +++ mktemp ++ local LAST_ERR=/tmp/tmp.bMfoBNgdOk ++ 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.vIf9mW0OAy ++ cat /tmp/tmp.bMfoBNgdOk ++ rm /tmp/tmp.vIf9mW0OAy /tmp/tmp.bMfoBNgdOk ++ 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.qjWJ5B0QwL +++ mktemp ++ local LAST_ERR=/tmp/tmp.t5vZD6DdNK ++ 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.qjWJ5B0QwL ++ cat /tmp/tmp.t5vZD6DdNK ++ rm /tmp/tmp.qjWJ5B0QwL /tmp/tmp.t5vZD6DdNK ++ return 0 + remaining+= ++ kubectl_bin get namespace cert-manager --ignore-not-found -o name +++ mktemp ++ local LAST_OUT=/tmp/tmp.NclU2wuxGT +++ mktemp ++ local LAST_ERR=/tmp/tmp.yMvxAG5djp ++ 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.NclU2wuxGT ++ cat /tmp/tmp.yMvxAG5djp ++ rm /tmp/tmp.NclU2wuxGT /tmp/tmp.yMvxAG5djp ++ 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-2715/deploy/crd.yaml --ignore-not-found --wait=false ++ mktemp + local LAST_OUT=/tmp/tmp.xs7wzzwwPY ++ mktemp + local LAST_ERR=/tmp/tmp.UEv8GzbH6c + local exit_status=0 + local timeout=4 + local i + args=('delete' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/deploy/crd.yaml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/deploy/crd.yaml --ignore-not-found --wait=false + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.xs7wzzwwPY + cat /tmp/tmp.UEv8GzbH6c + rm /tmp/tmp.xs7wzzwwPY /tmp/tmp.UEv8GzbH6c + return 0 ++ yq eval .metadata.name /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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 '\-\-\-') + grep -v NAMESPACE + kubectl get perconaservermongodbbackups.psmdb.percona.com --all-namespaces -o wide + 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 + grep -v NAMESPACE + xargs -L 1 sh -xc 'kubectl patch perconaservermongodbclustersyncs.psmdb.percona.com -n $0 $1 --type=merge -p "{\"metadata\":{\"finalizers\":[]}}"' 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-2715/deploy/cw-rbac.yaml --ignore-not-found --wait=false ++ mktemp + local LAST_OUT=/tmp/tmp.Vwqd2l6XoM ++ mktemp + local LAST_ERR=/tmp/tmp.fTOwDaZvBC + local exit_status=0 + local timeout=4 + local i + args=('delete' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/deploy/cw-rbac.yaml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/deploy/cw-rbac.yaml --ignore-not-found --wait=false + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.Vwqd2l6XoM + cat /tmp/tmp.fTOwDaZvBC + rm /tmp/tmp.Vwqd2l6XoM /tmp/tmp.fTOwDaZvBC + return 0 + check_crd_for_deletion PR-2715 + local git_tag=PR-2715 ++ curl -s https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/PR-2715/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.ON1ghzXmup +++ mktemp ++ local LAST_ERR=/tmp/tmp.SrqCbrKjI3 ++ 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.SrqCbrKjI3 ++ break ++ cat /tmp/tmp.ON1ghzXmup ++ cat /tmp/tmp.SrqCbrKjI3 Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "null" not found ++ rm /tmp/tmp.ON1ghzXmup /tmp/tmp.SrqCbrKjI3 ++ 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 ++ 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}' ++ grep chaos-mesh.org ++ kubectl get crd ++ awk '{print $1}' + 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 + grep -E -v '^kube-|^default|Terminating|psmdb-operator|openshift|^gke-|^gmp-|^NAME' + awk '{print$1}' + [[ -n '' ]] + desc 'cleaned up old namespaces psmdb-operator' + set +o xtrace + xargs kubectl delete ns ----------------------------------------------------------------------------------- cleaned up old namespaces psmdb-operator ----------------------------------------------------------------------------------- + kubectl_bin delete namespace psmdb-operator --ignore-not-found ++ mktemp ++ mktemp + local LAST_OUT=/tmp/tmp.g0tbVWadmi ++ mktemp + local LAST_OUT=/tmp/tmp.WpegYOVCPy ++ mktemp + local LAST_ERR=/tmp/tmp.jQ93UzLpX7 + 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[@]}" + [[ 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 delete namespace psmdb-operator --ignore-not-found + local LAST_ERR=/tmp/tmp.lIaGPZQg9C + 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 ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl get ns + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.WpegYOVCPy + cat /tmp/tmp.lIaGPZQg9C + rm /tmp/tmp.WpegYOVCPy /tmp/tmp.lIaGPZQg9C + return 0 error: resource(s) were provided, but no name was specified + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.g0tbVWadmi + cat /tmp/tmp.jQ93UzLpX7 + rm /tmp/tmp.g0tbVWadmi /tmp/tmp.jQ93UzLpX7 + return 0 + kubectl_bin wait --for=delete namespace psmdb-operator ++ mktemp + local LAST_OUT=/tmp/tmp.ZPF6a0NWoK ++ mktemp + local LAST_ERR=/tmp/tmp.WMEcUiP7Gv + 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.ZPF6a0NWoK + cat /tmp/tmp.WMEcUiP7Gv + rm /tmp/tmp.ZPF6a0NWoK /tmp/tmp.WMEcUiP7Gv + 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.4jKyl4D3HD ++ mktemp + local LAST_ERR=/tmp/tmp.wFEgy4SYhq + 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.4jKyl4D3HD namespace/psmdb-operator created + cat /tmp/tmp.wFEgy4SYhq + rm /tmp/tmp.4jKyl4D3HD /tmp/tmp.wFEgy4SYhq + return 0 + set_kube_ctx psmdb-operator + local namespace=psmdb-operator ++ kubectl_bin config current-context +++ mktemp ++ local LAST_OUT=/tmp/tmp.jtFnad88R9 +++ mktemp ++ local LAST_ERR=/tmp/tmp.2HywT5F5DU ++ 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.jtFnad88R9 ++ cat /tmp/tmp.2HywT5F5DU ++ rm /tmp/tmp.jtFnad88R9 /tmp/tmp.2HywT5F5DU ++ return 0 + kubectl_bin config set-context gke_cloud-dev-112233_us-central1-a_jen-psmdb-2715-27e0b7960-9-cluster9 --namespace=psmdb-operator ++ mktemp + local LAST_OUT=/tmp/tmp.usGrmvEfWt ++ mktemp + local LAST_ERR=/tmp/tmp.dPDl4T9dyP + local exit_status=0 + local timeout=4 + local i + args=('config' 'set-context' 'gke_cloud-dev-112233_us-central1-a_jen-psmdb-2715-27e0b7960-9-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-2715-27e0b7960-9-cluster9 == \- ]] + [[ gke_cloud-dev-112233_us-central1-a_jen-psmdb-2715-27e0b7960-9-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-2715-27e0b7960-9-cluster9 --namespace=psmdb-operator + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.usGrmvEfWt Context "gke_cloud-dev-112233_us-central1-a_jen-psmdb-2715-27e0b7960-9-cluster9" modified. + cat /tmp/tmp.dPDl4T9dyP + rm /tmp/tmp.usGrmvEfWt /tmp/tmp.dPDl4T9dyP + return 0 + deploy_operator + desc 'start PSMDB operator: docker.io/perconalab/percona-server-mongodb-operator:PR-2715-27e0b7960' + set +o xtrace ----------------------------------------------------------------------------------- start PSMDB operator: docker.io/perconalab/percona-server-mongodb-operator:PR-2715-27e0b7960 ----------------------------------------------------------------------------------- + local cr_file + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/conf/crd.yaml ']' + cr_file=/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/deploy/crd.yaml + kubectl_bin apply --server-side --force-conflicts -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/deploy/crd.yaml ++ mktemp + local LAST_OUT=/tmp/tmp.D2INcTuPnJ ++ mktemp + local LAST_ERR=/tmp/tmp.JFYFHsjwTz + local exit_status=0 + local timeout=4 + local i + args=('apply' '--server-side' '--force-conflicts' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/deploy/crd.yaml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/deploy/crd.yaml + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.D2INcTuPnJ 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.JFYFHsjwTz + rm /tmp/tmp.D2INcTuPnJ /tmp/tmp.JFYFHsjwTz + 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-2715/deploy/cw-rbac.yaml + sed -e 's^namespace: .*^namespace: psmdb-operator^' + kubectl_bin apply -n psmdb-operator -f - ++ mktemp + local LAST_OUT=/tmp/tmp.Z01KTiTL9v ++ mktemp + local LAST_ERR=/tmp/tmp.032UYgZEuk + 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.iFKYR0bRAf + cat + transformed_files+=("${stdin_manifest}") + args[$i]=/tmp/tmp.iFKYR0bRAf + 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.iFKYR0bRAf + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.Z01KTiTL9v 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.032UYgZEuk + rm /tmp/tmp.Z01KTiTL9v /tmp/tmp.032UYgZEuk /tmp/tmp.iFKYR0bRAf + return 0 + yq eval $'\n\t\t\t(.spec.template.spec.containers[].image = "docker.io/perconalab/percona-server-mongodb-operator:PR-2715-27e0b7960") |\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-2715/deploy/cw-operator.yaml + add_arch_to_podspecs - + arch_scheduling_enabled + [[ -n '' ]] + cat - + kubectl_bin apply -n psmdb-operator -f - ++ mktemp + local LAST_OUT=/tmp/tmp.EqOCblNaIw ++ mktemp + local LAST_ERR=/tmp/tmp.F1FUIuuTaz + 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.7ZTHvpqcy3 + cat + return + transformed_files+=("${stdin_manifest}") + args[$i]=/tmp/tmp.7ZTHvpqcy3 + 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.7ZTHvpqcy3 + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.EqOCblNaIw deployment.apps/percona-server-mongodb-operator created + cat /tmp/tmp.F1FUIuuTaz + rm /tmp/tmp.EqOCblNaIw /tmp/tmp.F1FUIuuTaz /tmp/tmp.7ZTHvpqcy3 + 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.D1qwxJkjxJ +++ mktemp ++ local LAST_ERR=/tmp/tmp.Peo09xovLc ++ 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.D1qwxJkjxJ ++ cat /tmp/tmp.Peo09xovLc ++ rm /tmp/tmp.D1qwxJkjxJ /tmp/tmp.Peo09xovLc ++ return 0 + wait_operator_pod percona-server-mongodb-operator-b57dc4869-nwnmc + local pod=percona-server-mongodb-operator-b57dc4869-nwnmc + set +o xtrace waiting for pod/percona-server-mongodb-operator-b57dc4869-nwnmc 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.sXAhYpbMFK +++ mktemp ++ local LAST_ERR=/tmp/tmp.KUZO2acZ8o ++ 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.sXAhYpbMFK ++ cat /tmp/tmp.KUZO2acZ8o ++ rm /tmp/tmp.sXAhYpbMFK /tmp/tmp.KUZO2acZ8o ++ return 0 + kubectl_bin logs -n psmdb-operator percona-server-mongodb-operator-b57dc4869-nwnmc ++ mktemp + local LAST_OUT=/tmp/tmp.oMaKtFpifj ++ mktemp + local LAST_ERR=/tmp/tmp.OTZMm3LmZq + local exit_status=0 + local timeout=4 + local i + args=('logs' '-n' 'psmdb-operator' 'percona-server-mongodb-operator-b57dc4869-nwnmc') + 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-b57dc4869-nwnmc == \- ]] + [[ percona-server-mongodb-operator-b57dc4869-nwnmc =~ ^(-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-b57dc4869-nwnmc + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.oMaKtFpifj + cat /tmp/tmp.OTZMm3LmZq + rm /tmp/tmp.oMaKtFpifj /tmp/tmp.OTZMm3LmZq + return 0 2026-11-23T05:52:29.806Z INFO setup Manager starting up {"gitCommit": "27e0b796072fe59ec1fa78fca82dc7491ddb9891", "gitBranch": "PR-2715-27e0b7960", "buildTime": "", "goVersion": "go1.27.4", "os": "linux", "arch": "amd64"} + create_namespace custom-users-roles-sharded-23515 + local namespace=custom-users-roles-sharded-23515 + 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 + : ++ kubectl get ValidatingWebhookConfiguration ++ awk '{print $1}' ++ grep chaos-mesh + 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 ++ grep chaos-mesh.org ++ awk '{print $1}' + 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 '' ]] + [[ -n '' ]] + desc 'cleaned up old namespaces custom-users-roles-sharded-23515' + set +o xtrace ----------------------------------------------------------------------------------- cleaned up old namespaces custom-users-roles-sharded-23515 ----------------------------------------------------------------------------------- + kubectl_bin delete namespace custom-users-roles-sharded-23515 --ignore-not-found + xargs kubectl delete ns + kubectl_bin get ns + awk '{print$1}' + grep -E -v '^kube-|^default|Terminating|psmdb-operator|openshift|^gke-|^gmp-|^NAME' ++ mktemp ++ mktemp + local LAST_OUT=/tmp/tmp.rDPBKAUSAC ++ mktemp + local LAST_ERR=/tmp/tmp.jKhm8BrkHh + local exit_status=0 + local timeout=4 + local i + args=('delete' 'namespace' 'custom-users-roles-sharded-23515' '--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-23515 == \- ]] + [[ custom-users-roles-sharded-23515 =~ ^(-f|--filename)=-$ ]] + local LAST_OUT=/tmp/tmp.7rgwyasD4i + for i in "${!args[@]}" + [[ --ignore-not-found == \- ]] + [[ --ignore-not-found =~ ^(-f|--filename)=-$ ]] + arch_scheduling_enabled + [[ -n '' ]] + arch_scheduling_enabled + [[ -n '' ]] + local attempt + local delay ++ mktemp ++ seq 0 9 + local LAST_ERR=/tmp/tmp.V2Szkl9yga + 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 + for attempt in $(seq 0 9) + set +e + kubectl delete namespace custom-users-roles-sharded-23515 --ignore-not-found ++ seq 0 9 + for attempt in $(seq 0 9) + set +e + kubectl get ns + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.7rgwyasD4i + cat /tmp/tmp.V2Szkl9yga + rm /tmp/tmp.7rgwyasD4i /tmp/tmp.V2Szkl9yga + return 0 error: resource(s) were provided, but no name was specified + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.rDPBKAUSAC + cat /tmp/tmp.jKhm8BrkHh + rm /tmp/tmp.rDPBKAUSAC /tmp/tmp.jKhm8BrkHh + return 0 + kubectl_bin wait --for=delete namespace custom-users-roles-sharded-23515 ++ mktemp + local LAST_OUT=/tmp/tmp.K5mIQEnd9V ++ mktemp + local LAST_ERR=/tmp/tmp.I04cN0DqrX + local exit_status=0 + local timeout=4 + local i + args=('wait' '--for=delete' 'namespace' 'custom-users-roles-sharded-23515') + 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-23515 == \- ]] + [[ custom-users-roles-sharded-23515 =~ ^(-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-23515 + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.K5mIQEnd9V + cat /tmp/tmp.I04cN0DqrX + rm /tmp/tmp.K5mIQEnd9V /tmp/tmp.I04cN0DqrX + return 0 + desc 'create namespace custom-users-roles-sharded-23515' + set +o xtrace ----------------------------------------------------------------------------------- create namespace custom-users-roles-sharded-23515 ----------------------------------------------------------------------------------- + kubectl_bin create namespace custom-users-roles-sharded-23515 ++ mktemp + local LAST_OUT=/tmp/tmp.06BetAl1rp ++ mktemp + local LAST_ERR=/tmp/tmp.AXJz8AUXF3 + local exit_status=0 + local timeout=4 + local i + args=('create' 'namespace' 'custom-users-roles-sharded-23515') + 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-23515 == \- ]] + [[ custom-users-roles-sharded-23515 =~ ^(-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-23515 + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.06BetAl1rp namespace/custom-users-roles-sharded-23515 created + cat /tmp/tmp.AXJz8AUXF3 + rm /tmp/tmp.06BetAl1rp /tmp/tmp.AXJz8AUXF3 + return 0 + set_kube_ctx custom-users-roles-sharded-23515 + local namespace=custom-users-roles-sharded-23515 ++ kubectl_bin config current-context +++ mktemp ++ local LAST_OUT=/tmp/tmp.KRVsSdi7Mp +++ mktemp ++ local LAST_ERR=/tmp/tmp.8RPDy8W6Hh ++ 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.KRVsSdi7Mp ++ cat /tmp/tmp.8RPDy8W6Hh ++ rm /tmp/tmp.KRVsSdi7Mp /tmp/tmp.8RPDy8W6Hh ++ return 0 + kubectl_bin config set-context gke_cloud-dev-112233_us-central1-a_jen-psmdb-2715-27e0b7960-9-cluster9 --namespace=custom-users-roles-sharded-23515 ++ mktemp + local LAST_OUT=/tmp/tmp.SHo5mXEajS ++ mktemp + local LAST_ERR=/tmp/tmp.cVudqbbNNU + local exit_status=0 + local timeout=4 + local i + args=('config' 'set-context' 'gke_cloud-dev-112233_us-central1-a_jen-psmdb-2715-27e0b7960-9-cluster9' '--namespace=custom-users-roles-sharded-23515') + 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-2715-27e0b7960-9-cluster9 == \- ]] + [[ gke_cloud-dev-112233_us-central1-a_jen-psmdb-2715-27e0b7960-9-cluster9 =~ ^(-f|--filename)=-$ ]] + for i in "${!args[@]}" + [[ --namespace=custom-users-roles-sharded-23515 == \- ]] + [[ --namespace=custom-users-roles-sharded-23515 =~ ^(-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-2715-27e0b7960-9-cluster9 --namespace=custom-users-roles-sharded-23515 + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.SHo5mXEajS Context "gke_cloud-dev-112233_us-central1-a_jen-psmdb-2715-27e0b7960-9-cluster9" modified. + cat /tmp/tmp.cVudqbbNNU + rm /tmp/tmp.SHo5mXEajS /tmp/tmp.cVudqbbNNU + return 0 + mongosUri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-23515 + desc 'create secrets' + set +o xtrace ----------------------------------------------------------------------------------- create secrets ----------------------------------------------------------------------------------- + kubectl_bin apply -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/conf/secrets.yml -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/conf/app-user-secrets.yml ++ mktemp + local LAST_OUT=/tmp/tmp.a7cEWbAkfL ++ mktemp + local LAST_ERR=/tmp/tmp.ud0WFORkJE + local exit_status=0 + local timeout=4 + local i + args=('apply' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/conf/secrets.yml' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/e2e-tests/conf/secrets.yml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/e2e-tests/custom-users-roles-sharded/conf/app-user-secrets.yml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/e2e-tests/conf/secrets.yml -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/conf/app-user-secrets.yml + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.a7cEWbAkfL secret/some-users created secret/user-one created secret/user-two created + cat /tmp/tmp.ud0WFORkJE + rm /tmp/tmp.a7cEWbAkfL /tmp/tmp.ud0WFORkJE + 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-2715/e2e-tests/conf/s3-secret.yml -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/conf/cloud-secret.yml ++ mktemp + local LAST_OUT=/tmp/tmp.pfOEHPPWs1 ++ mktemp + local LAST_ERR=/tmp/tmp.AK5HpboUF4 + local exit_status=0 + local timeout=4 + local i + args=('apply' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/conf/s3-secret.yml' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/e2e-tests/conf/s3-secret.yml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/e2e-tests/conf/cloud-secret.yml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/e2e-tests/conf/s3-secret.yml -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/conf/cloud-secret.yml + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.pfOEHPPWs1 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.AK5HpboUF4 + rm /tmp/tmp.pfOEHPPWs1 /tmp/tmp.AK5HpboUF4 + return 0 + create_runtime_class + kubectl_bin delete runtimeclass container-rc --ignore-not-found ++ mktemp + local LAST_OUT=/tmp/tmp.GloBhx0rQw ++ mktemp + local LAST_ERR=/tmp/tmp.SjeU0YPYj1 + 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.GloBhx0rQw + cat /tmp/tmp.SjeU0YPYj1 + rm /tmp/tmp.GloBhx0rQw /tmp/tmp.SjeU0YPYj1 + return 0 + local handler=runc + desc 'Create RuntimeClass with handler runc' + set +o xtrace ----------------------------------------------------------------------------------- Create RuntimeClass with handler runc ----------------------------------------------------------------------------------- + yq eval '.handler = "runc"' /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/conf/container-rc.yaml + kubectl_bin apply -f - ++ mktemp + local LAST_OUT=/tmp/tmp.7Pt2brSxsE ++ mktemp + local LAST_ERR=/tmp/tmp.4OvE16f26v + 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.YwVShKkKYG + cat + transformed_files+=("${stdin_manifest}") + args[$i]=/tmp/tmp.YwVShKkKYG + 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.YwVShKkKYG + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.7Pt2brSxsE runtimeclass.node.k8s.io/container-rc created + cat /tmp/tmp.4OvE16f26v + rm /tmp/tmp.7Pt2brSxsE /tmp/tmp.4OvE16f26v /tmp/tmp.YwVShKkKYG + return 0 + desc 'create first PSMDB cluster' + set +o xtrace ----------------------------------------------------------------------------------- create first PSMDB cluster ----------------------------------------------------------------------------------- + apply_cluster /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/conf/some-name-rs0.yml + '[' -z '' ']' + kubectl_bin apply -f - + cat_config /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/conf/some-name-rs0.yml ++ mktemp + 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"' + yq eval '(.spec | select(has("initImage"))).initImage = "docker.io/perconalab/percona-server-mongodb-operator:PR-2715-27e0b7960"' + cat /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/conf/some-name-rs0.yml + yq eval '(.spec | select(has("backup"))).backup.image = "docker.io/perconalab/percona-server-mongodb-operator:main-backup"' + local LAST_OUT=/tmp/tmp.Fvnzycdw37 + [[ -n docker.io/perconalab/fluentbit:main-logcollector ]] + 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-23515/g + add_arch_to_psmdb - + yq eval '(.spec | select(has("search"))).search.image = "docker.io/perconalab/percona-server-mongodb-operator:main-mongot"' + arch_scheduling_enabled ++ mktemp + [[ -n '' ]] + cat - + yq eval '.spec.upgradeOptions.apply="Never"' + local LAST_ERR=/tmp/tmp.K9D4eQzn1d + 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.WR7IO1wuet + cat + return + transformed_files+=("${stdin_manifest}") + args[$i]=/tmp/tmp.WR7IO1wuet + 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.WR7IO1wuet + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.Fvnzycdw37 perconaservermongodb.psmdb.percona.com/some-name created + cat /tmp/tmp.K9D4eQzn1d + rm /tmp/tmp.Fvnzycdw37 /tmp/tmp.K9D4eQzn1d /tmp/tmp.WR7IO1wuet + 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.IWSUTUs3GX +++ mktemp ++ local LAST_ERR=/tmp/tmp.fyoEkVe2T9 ++ 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.IWSUTUs3GX ++ cat /tmp/tmp.fyoEkVe2T9 ++ rm /tmp/tmp.IWSUTUs3GX /tmp/tmp.fyoEkVe2T9 ++ 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.sxHN1uDeGT +++ mktemp ++ local LAST_ERR=/tmp/tmp.oJEG1Ye18a ++ 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.sxHN1uDeGT ++ cat /tmp/tmp.oJEG1Ye18a ++ rm /tmp/tmp.sxHN1uDeGT /tmp/tmp.oJEG1Ye18a ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.VuMGVqj1FN +++ mktemp ++ local LAST_ERR=/tmp/tmp.OqbiG76XYB ++ 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.VuMGVqj1FN ++ cat /tmp/tmp.OqbiG76XYB ++ rm /tmp/tmp.VuMGVqj1FN /tmp/tmp.OqbiG76XYB ++ 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.pUatDCKPwS +++ mktemp ++ local LAST_ERR=/tmp/tmp.zudhKe7kTq ++ 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.pUatDCKPwS ++ cat /tmp/tmp.zudhKe7kTq ++ rm /tmp/tmp.pUatDCKPwS /tmp/tmp.zudhKe7kTq ++ 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.FKJQQ0hmfJ +++ mktemp ++ local LAST_ERR=/tmp/tmp.Gx59fpOmCP ++ 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.FKJQQ0hmfJ ++ cat /tmp/tmp.Gx59fpOmCP ++ rm /tmp/tmp.FKJQQ0hmfJ /tmp/tmp.Gx59fpOmCP ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="cfg")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.I1XJUEYLGc +++ mktemp ++ local LAST_ERR=/tmp/tmp.nsrOx7qqAr ++ 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.I1XJUEYLGc ++ cat /tmp/tmp.nsrOx7qqAr ++ rm /tmp/tmp.I1XJUEYLGc /tmp/tmp.nsrOx7qqAr ++ 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.pUyGIlVrop +++ mktemp ++ local LAST_ERR=/tmp/tmp.k4iYml07Rv ++ 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.pUyGIlVrop ++ cat /tmp/tmp.k4iYml07Rv ++ rm /tmp/tmp.pUyGIlVrop /tmp/tmp.k4iYml07Rv ++ 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.byoq5V0ntX +++ mktemp ++ local LAST_ERR=/tmp/tmp.kGD1V2JTtI ++ 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.byoq5V0ntX ++ cat /tmp/tmp.kGD1V2JTtI ++ rm /tmp/tmp.byoq5V0ntX /tmp/tmp.kGD1V2JTtI ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="mongos")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.XDz48oGZ68 +++ mktemp ++ local LAST_ERR=/tmp/tmp.nYtXALkD0L ++ 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.XDz48oGZ68 ++ cat /tmp/tmp.nYtXALkD0L ++ rm /tmp/tmp.XDz48oGZ68 /tmp/tmp.nYtXALkD0L ++ 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.aBSEtxwJPq +++ mktemp ++ local LAST_ERR=/tmp/tmp.cS7wL3Gk2h ++ 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.aBSEtxwJPq ++ cat /tmp/tmp.cS7wL3Gk2h ++ rm /tmp/tmp.aBSEtxwJPq /tmp/tmp.cS7wL3Gk2h ++ 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-2715/e2e-tests/conf/client_with_tls.yml ++ mktemp + local LAST_OUT=/tmp/tmp.MRfnEUzAfI ++ mktemp + local LAST_ERR=/tmp/tmp.4sUckukUht + local exit_status=0 + local timeout=4 + local i + args=('apply' '-f' '/mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/e2e-tests/conf/client_with_tls.yml == \- ]] + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/e2e-tests/conf/client_with_tls.yml + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.MRfnEUzAfI deployment.apps/psmdb-client created + cat /tmp/tmp.4sUckukUht + rm /tmp/tmp.MRfnEUzAfI /tmp/tmp.4sUckukUht + return 0 + kubectl_bin rollout status deployment/psmdb-client --timeout=360s ++ mktemp + local LAST_OUT=/tmp/tmp.qnCUNrpYRB ++ mktemp + local LAST_ERR=/tmp/tmp.J0YQIupNl5 + 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.qnCUNrpYRB Waiting for deployment "psmdb-client" rollout to finish: 0 of 1 updated replicas are available... deployment "psmdb-client" successfully rolled out + cat /tmp/tmp.J0YQIupNl5 + rm /tmp/tmp.qnCUNrpYRB /tmp/tmp.J0YQIupNl5 + 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.QzQImjFTQn +++ mktemp ++ local LAST_ERR=/tmp/tmp.YqQoGjUI8W ++ 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.QzQImjFTQn ++ cat /tmp/tmp.YqQoGjUI8W ++ rm /tmp/tmp.QzQImjFTQn /tmp/tmp.YqQoGjUI8W ++ 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.cAP96vqWAc +++ mktemp ++ local LAST_ERR=/tmp/tmp.AoaRL7dzLC ++ 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.cAP96vqWAc ++ cat /tmp/tmp.AoaRL7dzLC ++ rm /tmp/tmp.cAP96vqWAc /tmp/tmp.AoaRL7dzLC ++ return 0 + connection_string='mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-23515.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-23515.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&replicaSet=cfg&tls=true' ']' + [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-23515.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.Wr5OOjYs6m +++ mktemp ++ local LAST_ERR=/tmp/tmp.OG3pNfU2X5 ++ 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.Wr5OOjYs6m ++ cat /tmp/tmp.OG3pNfU2X5 ++ rm /tmp/tmp.Wr5OOjYs6m /tmp/tmp.OG3pNfU2X5 ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-23515.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.yYHhDXmwQ8 +++ mktemp ++ local LAST_ERR=/tmp/tmp.YDMPMjp3bB ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&replicaSet=cfg&tls=true == \- ]] ++ [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-cfg-0.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-1.some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-cfg-2.some-name-cfg.custom-users-roles-sharded-23515.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.yYHhDXmwQ8 ++ cat /tmp/tmp.YDMPMjp3bB ++ rm /tmp/tmp.yYHhDXmwQ8 /tmp/tmp.YDMPMjp3bB ++ 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.Nxdo1Qr8RP +++ mktemp ++ local LAST_ERR=/tmp/tmp.c2DlHbu4BK ++ 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.Nxdo1Qr8RP ++ cat /tmp/tmp.c2DlHbu4BK ++ rm /tmp/tmp.Nxdo1Qr8RP /tmp/tmp.c2DlHbu4BK ++ return 0 + connection_string='mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local/?authSource=admin&replicaSet=cfg' + '[' -z 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local/?authSource=admin&replicaSet=cfg' ']' + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local/?authSource=admin&replicaSet=cfg == *tls\=true* ]] + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-23515.svc.cluster.local/?authSource=admin&replicaSet=cfg == *ssl\=true* ]] + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-23515.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.EGls3GHfJT +++ mktemp ++ local LAST_ERR=/tmp/tmp.pFc8t2pDCR ++ 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.EGls3GHfJT ++ cat /tmp/tmp.pFc8t2pDCR ++ rm /tmp/tmp.EGls3GHfJT /tmp/tmp.pFc8t2pDCR ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-23515.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.qPAV2Nwpno +++ mktemp ++ local LAST_ERR=/tmp/tmp.X14RZ4wtYE ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local/?authSource=admin&replicaSet=cfg == \- ]] ++ [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-cfg.custom-users-roles-sharded-23515.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.qPAV2Nwpno ++ cat /tmp/tmp.X14RZ4wtYE ++ rm /tmp/tmp.qPAV2Nwpno /tmp/tmp.X14RZ4wtYE ++ 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.eUQXbH4PeQ +++ mktemp ++ local LAST_ERR=/tmp/tmp.1hfvjWf3hm ++ 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.eUQXbH4PeQ ++ cat /tmp/tmp.1hfvjWf3hm ++ rm /tmp/tmp.eUQXbH4PeQ /tmp/tmp.1hfvjWf3hm ++ return 0 + connection_string='mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-23515.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.Tc8fPYx1vy +++ mktemp ++ local LAST_ERR=/tmp/tmp.NBbdfp7VMi ++ 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.Tc8fPYx1vy ++ cat /tmp/tmp.NBbdfp7VMi ++ rm /tmp/tmp.Tc8fPYx1vy /tmp/tmp.NBbdfp7VMi ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-23515.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.AmQ9JeAVqU +++ mktemp ++ local LAST_ERR=/tmp/tmp.9qNhGCYo67 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-mongos.custom-users-roles-sharded-23515.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.AmQ9JeAVqU ++ cat /tmp/tmp.9qNhGCYo67 ++ rm /tmp/tmp.AmQ9JeAVqU /tmp/tmp.9qNhGCYo67 ++ 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.eQ53GQkhTv +++ mktemp ++ local LAST_ERR=/tmp/tmp.PKQdc2uDay ++ 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.eQ53GQkhTv ++ cat /tmp/tmp.PKQdc2uDay ++ rm /tmp/tmp.eQ53GQkhTv /tmp/tmp.PKQdc2uDay ++ return 0 + connection_string='mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-23515.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-23515.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&replicaSet=rs0&tls=true' ']' + [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-23515.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.TXWd1QSC8l +++ mktemp ++ local LAST_ERR=/tmp/tmp.4C4soEjVjn ++ 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.TXWd1QSC8l ++ cat /tmp/tmp.4C4soEjVjn ++ rm /tmp/tmp.TXWd1QSC8l /tmp/tmp.4C4soEjVjn ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-23515.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.pbLkbw2ayN +++ mktemp ++ local LAST_ERR=/tmp/tmp.rvHAzcGaST ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&replicaSet=rs0&tls=true == \- ]] ++ [[ mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://databaseAdmin:databaseAdmin123456@some-name-rs0-0.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-1.some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local:27017,some-name-rs0-2.some-name-rs0.custom-users-roles-sharded-23515.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.pbLkbw2ayN ++ cat /tmp/tmp.rvHAzcGaST ++ rm /tmp/tmp.pbLkbw2ayN /tmp/tmp.rvHAzcGaST ++ 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.gxYZulCxN5 +++ mktemp ++ local LAST_ERR=/tmp/tmp.AsYlm2Q2Mt ++ 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.gxYZulCxN5 ++ cat /tmp/tmp.AsYlm2Q2Mt ++ rm /tmp/tmp.gxYZulCxN5 /tmp/tmp.AsYlm2Q2Mt ++ return 0 + connection_string='mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local/?authSource=admin&replicaSet=rs0' + '[' -z 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local/?authSource=admin&replicaSet=rs0' ']' + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local/?authSource=admin&replicaSet=rs0 == *tls\=true* ]] + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-23515.svc.cluster.local/?authSource=admin&replicaSet=rs0 == *ssl\=true* ]] + [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-23515.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.0CUNHi6nzb +++ mktemp ++ local LAST_ERR=/tmp/tmp.rTyKe8KRse ++ 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.0CUNHi6nzb ++ cat /tmp/tmp.rTyKe8KRse ++ rm /tmp/tmp.0CUNHi6nzb /tmp/tmp.rTyKe8KRse ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ 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-kz4k4 -- mongo 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-23515.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.sWxwlNBPr1 +++ mktemp ++ local LAST_ERR=/tmp/tmp.ON4ykVJuEe ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local/?authSource=admin&replicaSet=rs0 == \- ]] ++ [[ mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb+srv://databaseAdmin:databaseAdmin123456@some-name-rs0.custom-users-roles-sharded-23515.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.sWxwlNBPr1 ++ cat /tmp/tmp.ON4ykVJuEe ++ rm /tmp/tmp.sWxwlNBPr1 /tmp/tmp.ON4ykVJuEe ++ 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-2715/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-rs0.yml + local new_result=/tmp/tmp.ijN8aKvp5t/statefulset_some-name-rs0.yml + [[ -n '' ]] + kubectl_bin get -o yaml statefulset/some-name-rs0 + 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-23515", "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.hfALFyt0dH ++ mktemp + local LAST_ERR=/tmp/tmp.eSXq33UqVc + 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.hfALFyt0dH + cat /tmp/tmp.eSXq33UqVc + rm /tmp/tmp.hfALFyt0dH /tmp/tmp.eSXq33UqVc + return 0 + yq -i eval 'del(.spec.persistentVolumeClaimRetentionPolicy)' /tmp/tmp.ijN8aKvp5t/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.ijN8aKvp5t/statefulset_some-name-rs0.yml + yq -i eval 'del(.spec.allocateLoadBalancerNodePorts)' /tmp/tmp.ijN8aKvp5t/statefulset_some-name-rs0.yml + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-rs0.yml /tmp/tmp.ijN8aKvp5t/statefulset_some-name-rs0.yml + log 'compare_kubectl: statefulset/some-name-rs0 OK' + set +o xtrace [2026-11-23T05:57:05+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-2715/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-cfg.yml + local new_result=/tmp/tmp.ijN8aKvp5t/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-23515", "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.kQxlUp5Hbd ++ mktemp + local LAST_ERR=/tmp/tmp.GZ1otHxiMa + 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.kQxlUp5Hbd + cat /tmp/tmp.GZ1otHxiMa + rm /tmp/tmp.kQxlUp5Hbd /tmp/tmp.GZ1otHxiMa + return 0 + yq -i eval 'del(.spec.persistentVolumeClaimRetentionPolicy)' /tmp/tmp.ijN8aKvp5t/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.ijN8aKvp5t/statefulset_some-name-cfg.yml + yq -i eval 'del(.spec.allocateLoadBalancerNodePorts)' /tmp/tmp.ijN8aKvp5t/statefulset_some-name-cfg.yml + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-cfg.yml /tmp/tmp.ijN8aKvp5t/statefulset_some-name-cfg.yml + log 'compare_kubectl: statefulset/some-name-cfg OK' + set +o xtrace [2026-11-23T05:57:06+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-2715/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-mongos.yml + local new_result=/tmp/tmp.ijN8aKvp5t/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-23515", "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.Zx7SFoUFc8 ++ mktemp + local LAST_ERR=/tmp/tmp.YvuhvsIpEk + 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.Zx7SFoUFc8 + cat /tmp/tmp.YvuhvsIpEk + rm /tmp/tmp.Zx7SFoUFc8 /tmp/tmp.YvuhvsIpEk + return 0 + yq -i eval 'del(.spec.persistentVolumeClaimRetentionPolicy)' /tmp/tmp.ijN8aKvp5t/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.ijN8aKvp5t/statefulset_some-name-mongos.yml + yq -i eval 'del(.spec.allocateLoadBalancerNodePorts)' /tmp/tmp.ijN8aKvp5t/statefulset_some-name-mongos.yml + [[ /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-2715/e2e-tests/custom-users-roles-sharded/compare/statefulset_some-name-mongos.yml /tmp/tmp.ijN8aKvp5t/statefulset_some-name-mongos.yml + log 'compare_kubectl: statefulset/some-name-mongos OK' + set +o xtrace [2026-11-23T05:57:08+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 +++ base64 -d +++ kubectl get secrets/user-one '--template={{.data.userOnePassKey}}' ++ 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-23515 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-23515 + local target=user-one + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 mongodb + 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})();' + 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 uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-23515 + 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.Sxnmn9WPwU +++ mktemp ++ local LAST_ERR=/tmp/tmp.ZFYc7ILGAg ++ 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.Sxnmn9WPwU ++ cat /tmp/tmp.ZFYc7ILGAg ++ rm /tmp/tmp.Sxnmn9WPwU /tmp/tmp.ZFYc7ILGAg ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.d5K7hSrJaD ++ mktemp + local LAST_ERR=/tmp/tmp.MpMtcq6WJ4 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.d5K7hSrJaD + cat /tmp/tmp.MpMtcq6WJ4 + rm /tmp/tmp.d5K7hSrJaD /tmp/tmp.MpMtcq6WJ4 + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-one.json /tmp/tmp.ijN8aKvp5t/user-one + check_auth user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515 + local uri=user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515 ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515 '' '' --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-23515 ++ 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.iKUKksLxyz ++++ mktemp +++ local LAST_ERR=/tmp/tmp.R4xmEfmjZE +++ 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.iKUKksLxyz +++ cat /tmp/tmp.R4xmEfmjZE +++ rm /tmp/tmp.iKUKksLxyz /tmp/tmp.R4xmEfmjZE +++ return 0 ++ local client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.tz6MrsafWO +++ mktemp ++ local LAST_ERR=/tmp/tmp.0x0MpNoOFo ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.tz6MrsafWO ++ cat /tmp/tmp.0x0MpNoOFo ++ rm /tmp/tmp.tz6MrsafWO /tmp/tmp.0x0MpNoOFo ++ 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.LtjKyDTgw3 +++ mktemp ++ local LAST_ERR=/tmp/tmp.h5GsKbcLy7 ++ 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.LtjKyDTgw3 ++ cat /tmp/tmp.h5GsKbcLy7 ++ rm /tmp/tmp.LtjKyDTgw3 /tmp/tmp.h5GsKbcLy7 ++ 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.sRLGQNYPDW +++ mktemp ++ local LAST_ERR=/tmp/tmp.MaCsqZBsOH ++ 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.sRLGQNYPDW ++ cat /tmp/tmp.MaCsqZBsOH ++ rm /tmp/tmp.sRLGQNYPDW /tmp/tmp.MaCsqZBsOH ++ return 0 + connection_string='mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.Jklq9QgQiC +++ mktemp ++ local LAST_ERR=/tmp/tmp.yFMiAjmuln ++ 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.Jklq9QgQiC ++ cat /tmp/tmp.yFMiAjmuln ++ rm /tmp/tmp.Jklq9QgQiC /tmp/tmp.yFMiAjmuln ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.iE7uTKI8L3 +++ mktemp ++ local LAST_ERR=/tmp/tmp.SjSOZFPKQY ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.iE7uTKI8L3 ++ cat /tmp/tmp.SjSOZFPKQY ++ rm /tmp/tmp.iE7uTKI8L3 /tmp/tmp.SjSOZFPKQY ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + generatedUserSecret=some-name-custom-user-secret ++ base64 -d ++ kubectl_bin get secret some-name-custom-user-secret -o 'jsonpath={.data.user-gen}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.JjRdW7C4JE +++ mktemp ++ local LAST_ERR=/tmp/tmp.tjQeQ5XWrH ++ 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.JjRdW7C4JE ++ cat /tmp/tmp.tjQeQ5XWrH ++ rm /tmp/tmp.JjRdW7C4JE /tmp/tmp.tjQeQ5XWrH ++ return 0 + generatedPass=D1KyeTDHuLUG0n5m ++ 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-23515 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-23515 + local target=user-gen + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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-23515 + 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 + /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.MbxRb2HryK +++ mktemp ++ local LAST_ERR=/tmp/tmp.WV9Uyuoy0K ++ 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.MbxRb2HryK ++ cat /tmp/tmp.WV9Uyuoy0K ++ rm /tmp/tmp.MbxRb2HryK /tmp/tmp.WV9Uyuoy0K ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.oiUr6boFEc ++ mktemp + local LAST_ERR=/tmp/tmp.X4QwrwfGqD + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.oiUr6boFEc + cat /tmp/tmp.X4QwrwfGqD + rm /tmp/tmp.oiUr6boFEc /tmp/tmp.X4QwrwfGqD + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-gen.json /tmp/tmp.ijN8aKvp5t/user-gen + check_auth user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515 + local uri=user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515 ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515 '' '' --quiet ++ local 'command=db.runCommand({ ping: 1 }).ok' ++ local uri=user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515 ++ 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.6beNSol2c7 ++++ mktemp +++ local LAST_ERR=/tmp/tmp.hoRHQE4uxZ +++ 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.6beNSol2c7 +++ cat /tmp/tmp.hoRHQE4uxZ +++ rm /tmp/tmp.6beNSol2c7 /tmp/tmp.hoRHQE4uxZ +++ return 0 ++ local client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.sLDS7fbs6S +++ mktemp ++ local LAST_ERR=/tmp/tmp.IhDL4CdvKV ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin --quiet == \- ]] ++ [[ export HOME=/tmp; printf 'db.runCommand({ ping: 1 }).ok\n' | mongo mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.sLDS7fbs6S ++ cat /tmp/tmp.IhDL4CdvKV ++ rm /tmp/tmp.sLDS7fbs6S /tmp/tmp.IhDL4CdvKV ++ 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.COS4dM7ljf +++ mktemp ++ local LAST_ERR=/tmp/tmp.12BYQyk5v8 ++ 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.COS4dM7ljf ++ cat /tmp/tmp.12BYQyk5v8 ++ rm /tmp/tmp.COS4dM7ljf /tmp/tmp.12BYQyk5v8 ++ 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.r8iAqiKSax +++ mktemp ++ local LAST_ERR=/tmp/tmp.16mJMK8oVy ++ 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.r8iAqiKSax ++ cat /tmp/tmp.16mJMK8oVy ++ rm /tmp/tmp.r8iAqiKSax /tmp/tmp.16mJMK8oVy ++ return 0 + connection_string='mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.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.Eswykm8DbF +++ mktemp ++ local LAST_ERR=/tmp/tmp.TfRPeJ3rSl ++ 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.Eswykm8DbF ++ cat /tmp/tmp.TfRPeJ3rSl ++ rm /tmp/tmp.Eswykm8DbF /tmp/tmp.TfRPeJ3rSl ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.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.eQQZrtr6HK +++ mktemp ++ local LAST_ERR=/tmp/tmp.SKLEugApH2 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ -- == \- ]] ++ [[ -- =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongo == \- ]] ++ [[ mongo =~ ^(-f|--filename)=-$ ]] ++ for i in "${!args[@]}" ++ [[ mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://user-gen:D1KyeTDHuLUG0n5m@some-name-mongos.custom-users-roles-sharded-23515.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.eQQZrtr6HK ++ cat /tmp/tmp.SKLEugApH2 ++ rm /tmp/tmp.eQQZrtr6HK /tmp/tmp.SKLEugApH2 ++ 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-23515 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-23515 + local target=user-external + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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 $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})();' + sed '/"userId"/d' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-23515 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ awk -F: '{print $2}' ++ echo .svc.cluster.local + 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.rlnmdEwmbD +++ mktemp ++ local LAST_ERR=/tmp/tmp.ntNEvydTCp ++ 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.rlnmdEwmbD ++ cat /tmp/tmp.ntNEvydTCp ++ rm /tmp/tmp.rlnmdEwmbD /tmp/tmp.ntNEvydTCp ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.CmHlsgb4tH ++ mktemp + local LAST_ERR=/tmp/tmp.Mbt46xAp95 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.CmHlsgb4tH + cat /tmp/tmp.Mbt46xAp95 + rm /tmp/tmp.CmHlsgb4tH /tmp/tmp.Mbt46xAp95 + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-external.json /tmp/tmp.ijN8aKvp5t/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.ZqPWUnTK0N ++ mktemp + local LAST_ERR=/tmp/tmp.DG8IP4ynt1 + 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.ZqPWUnTK0N perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.DG8IP4ynt1 + rm /tmp/tmp.ZqPWUnTK0N /tmp/tmp.DG8IP4ynt1 + 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.wBnG2FgwAN +++ mktemp ++ local LAST_ERR=/tmp/tmp.ZjcjjrLUDq ++ 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.wBnG2FgwAN ++ cat /tmp/tmp.ZjcjjrLUDq ++ rm /tmp/tmp.wBnG2FgwAN /tmp/tmp.ZjcjjrLUDq ++ 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.2TRjnWjlmM +++ mktemp ++ local LAST_ERR=/tmp/tmp.YNuUtY5mO5 ++ 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.2TRjnWjlmM ++ cat /tmp/tmp.YNuUtY5mO5 ++ rm /tmp/tmp.2TRjnWjlmM /tmp/tmp.YNuUtY5mO5 ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.tt5YyfsDEa +++ mktemp ++ local LAST_ERR=/tmp/tmp.v9JRLmUuIo ++ 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.tt5YyfsDEa ++ cat /tmp/tmp.v9JRLmUuIo ++ rm /tmp/tmp.tt5YyfsDEa /tmp/tmp.v9JRLmUuIo ++ 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-23515 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-23515 + local target=user-two + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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-23515 + 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.eO68n0bU7M +++ mktemp ++ local LAST_ERR=/tmp/tmp.m7GZcMhw6e ++ 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.eO68n0bU7M ++ cat /tmp/tmp.m7GZcMhw6e ++ rm /tmp/tmp.eO68n0bU7M /tmp/tmp.m7GZcMhw6e ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.JdQBvErRD9 ++ mktemp + local LAST_ERR=/tmp/tmp.Nm0twaXX7Z + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.JdQBvErRD9 + cat /tmp/tmp.Nm0twaXX7Z + rm /tmp/tmp.JdQBvErRD9 /tmp/tmp.Nm0twaXX7Z + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-two.json /tmp/tmp.ijN8aKvp5t/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-23515 + local uri=user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515 ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515 '' '' --quiet ++ local 'command=db.runCommand({ ping: 1 }).ok' ++ local uri=user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515 ++ 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.PzFaYkqaZ4 ++++ mktemp +++ local LAST_ERR=/tmp/tmp.x2O0A60ntR +++ 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.PzFaYkqaZ4 +++ cat /tmp/tmp.x2O0A60ntR +++ rm /tmp/tmp.PzFaYkqaZ4 /tmp/tmp.x2O0A60ntR +++ return 0 ++ local client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.ZmcUL5TYVR +++ mktemp ++ local LAST_ERR=/tmp/tmp.sVEobJvs2r ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.ZmcUL5TYVR ++ cat /tmp/tmp.sVEobJvs2r ++ rm /tmp/tmp.ZmcUL5TYVR /tmp/tmp.sVEobJvs2r ++ 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-23515 + local uri=user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515 ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515 '' '' --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-23515 ++ 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.U1iQlI4iVQ ++++ mktemp +++ local LAST_ERR=/tmp/tmp.DhihxfLYmb +++ 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.U1iQlI4iVQ +++ cat /tmp/tmp.DhihxfLYmb +++ rm /tmp/tmp.U1iQlI4iVQ /tmp/tmp.DhihxfLYmb +++ return 0 ++ local client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.oMdvdX2496 +++ mktemp ++ local LAST_ERR=/tmp/tmp.0IYL7Rp9oj ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'bash' '-c' 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- bash -c 'export HOME=/tmp; printf '\''db.runCommand({ ping: 1 }).ok\n'\'' | mongo mongodb://user-one:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.oMdvdX2496 ++ cat /tmp/tmp.0IYL7Rp9oj ++ rm /tmp/tmp.oMdvdX2496 /tmp/tmp.0IYL7Rp9oj ++ 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.pkPCIU4QBz +++ mktemp ++ local LAST_ERR=/tmp/tmp.KVk047aZX5 ++ 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.pkPCIU4QBz ++ cat /tmp/tmp.KVk047aZX5 ++ rm /tmp/tmp.pkPCIU4QBz /tmp/tmp.KVk047aZX5 ++ 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.mcp5N6n5Gm +++ mktemp ++ local LAST_ERR=/tmp/tmp.hLDqPI2GFv ++ 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.mcp5N6n5Gm ++ cat /tmp/tmp.hLDqPI2GFv ++ rm /tmp/tmp.mcp5N6n5Gm /tmp/tmp.hLDqPI2GFv ++ return 0 + connection_string='mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.QMU66CUaP3 +++ mktemp ++ local LAST_ERR=/tmp/tmp.uPTOgOpcml ++ 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.QMU66CUaP3 ++ cat /tmp/tmp.uPTOgOpcml ++ rm /tmp/tmp.QMU66CUaP3 /tmp/tmp.uPTOgOpcml ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.EqeRNUxDZh +++ mktemp ++ local LAST_ERR=/tmp/tmp.4ljbSBC6gp ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://user-two:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.EqeRNUxDZh ++ cat /tmp/tmp.4ljbSBC6gp ++ rm /tmp/tmp.EqeRNUxDZh /tmp/tmp.4ljbSBC6gp ++ 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 ++ base64 ++ echo -n new-user-two-password + 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-23515 + 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-23515 + local uri=user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515 ++ 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:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515 '' '' --quiet ++ local 'command=db.runCommand({ ping: 1 }).ok' ++ local uri=user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515 ++ 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.iAtjQCNVqH ++++ mktemp +++ local LAST_ERR=/tmp/tmp.cKFHkd8i6S +++ 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.iAtjQCNVqH +++ cat /tmp/tmp.cKFHkd8i6S +++ rm /tmp/tmp.iAtjQCNVqH /tmp/tmp.cKFHkd8i6S +++ return 0 ++ local client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.uSuNxC1HFQ +++ mktemp ++ local LAST_ERR=/tmp/tmp.1THW47nAni ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin --quiet' ++ exit_status=1 ++ set -e ++ [[ 1 == 0 ]] ++ [[ 0 == 9 ]] ++ grep -q 'Error from server (NotFound)' /tmp/tmp.1THW47nAni ++ 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.1THW47nAni ++ [[ -n 1 ]] ++ [[ 0 -lt 2 ]] ++ delay=0 ++ cat /tmp/tmp.uSuNxC1HFQ /tmp/tmp.1THW47nAni 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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.uSuNxC1HFQ ++ cat /tmp/tmp.1THW47nAni ++ rm /tmp/tmp.uSuNxC1HFQ /tmp/tmp.1THW47nAni ++ 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.5z5OopoKw3 +++ mktemp ++ local LAST_ERR=/tmp/tmp.VCmEgxJxT4 ++ 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.5z5OopoKw3 ++ cat /tmp/tmp.VCmEgxJxT4 ++ rm /tmp/tmp.5z5OopoKw3 /tmp/tmp.VCmEgxJxT4 ++ 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.n9wxa2GY6o +++ mktemp ++ local LAST_ERR=/tmp/tmp.txWvfcNMet ++ 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.n9wxa2GY6o ++ cat /tmp/tmp.txWvfcNMet ++ rm /tmp/tmp.n9wxa2GY6o /tmp/tmp.txWvfcNMet ++ return 0 + connection_string='mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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.QDCYF7dV0N +++ mktemp ++ local LAST_ERR=/tmp/tmp.3EDcjP0MVV ++ 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.QDCYF7dV0N ++ cat /tmp/tmp.3EDcjP0MVV ++ rm /tmp/tmp.QDCYF7dV0N /tmp/tmp.3EDcjP0MVV ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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.TBGxUNZKUf +++ mktemp ++ local LAST_ERR=/tmp/tmp.Z1GpP3IphY ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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.TBGxUNZKUf ++ cat /tmp/tmp.Z1GpP3IphY ++ rm /tmp/tmp.TBGxUNZKUf /tmp/tmp.Z1GpP3IphY ++ 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.7H2REu92re ++ mktemp + local LAST_ERR=/tmp/tmp.ON5JWGzUX8 + 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.7H2REu92re perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.ON5JWGzUX8 + rm /tmp/tmp.7H2REu92re /tmp/tmp.ON5JWGzUX8 + 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.KfftZlmZvL +++ mktemp ++ local LAST_ERR=/tmp/tmp.AnehgaS6fm ++ 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.KfftZlmZvL ++ cat /tmp/tmp.AnehgaS6fm ++ rm /tmp/tmp.KfftZlmZvL /tmp/tmp.AnehgaS6fm ++ 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.AFsTYiHnRo +++ mktemp ++ local LAST_ERR=/tmp/tmp.3fb16MARqp ++ 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.AFsTYiHnRo ++ cat /tmp/tmp.3fb16MARqp ++ rm /tmp/tmp.AFsTYiHnRo /tmp/tmp.3fb16MARqp ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.aH2l7FGz40 +++ mktemp ++ local LAST_ERR=/tmp/tmp.XVOgwV7U1X ++ 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.aH2l7FGz40 ++ cat /tmp/tmp.XVOgwV7U1X ++ rm /tmp/tmp.aH2l7FGz40 /tmp/tmp.XVOgwV7U1X ++ 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-23515 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-23515 + 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-2715/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-23515 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-23515 + 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.Le071upm6R +++ mktemp ++ local LAST_ERR=/tmp/tmp.TtFbnlGDqQ ++ 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.Le071upm6R ++ cat /tmp/tmp.TtFbnlGDqQ ++ rm /tmp/tmp.Le071upm6R /tmp/tmp.TtFbnlGDqQ ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.j4wJrJ4PhS ++ mktemp + local LAST_ERR=/tmp/tmp.A9rV3HPhxm + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.j4wJrJ4PhS + cat /tmp/tmp.A9rV3HPhxm + rm /tmp/tmp.j4wJrJ4PhS /tmp/tmp.A9rV3HPhxm + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles.json /tmp/tmp.ijN8aKvp5t/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-23515 + 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-23515 + 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.f2UZsQTeb6 +++ mktemp ++ local LAST_ERR=/tmp/tmp.xHZbVR5aFU ++ 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.f2UZsQTeb6 ++ cat /tmp/tmp.xHZbVR5aFU ++ rm /tmp/tmp.f2UZsQTeb6 /tmp/tmp.xHZbVR5aFU ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.wfGsYlrGoO ++ mktemp + local LAST_ERR=/tmp/tmp.sD7bWOhqXs + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.wfGsYlrGoO Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("4b24b78a-ec27-48be-822a-38331e3ef6b0") } 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.sD7bWOhqXs + rm /tmp/tmp.wfGsYlrGoO /tmp/tmp.sD7bWOhqXs + 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-23515 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-23515 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-23515 + 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-2715/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-23515 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-23515 + 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.OsTXziKLko +++ mktemp ++ local LAST_ERR=/tmp/tmp.MaK9xM8VS6 ++ 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.OsTXziKLko ++ cat /tmp/tmp.MaK9xM8VS6 ++ rm /tmp/tmp.OsTXziKLko /tmp/tmp.MaK9xM8VS6 ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.RWNe5u2JVy ++ mktemp + local LAST_ERR=/tmp/tmp.lnvHRZK9r9 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.RWNe5u2JVy + cat /tmp/tmp.lnvHRZK9r9 + rm /tmp/tmp.RWNe5u2JVy /tmp/tmp.lnvHRZK9r9 + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles.json /tmp/tmp.ijN8aKvp5t/user-two-update-roles 8c8 < "role" : "clusterAdmin", --- > "role" : "userAdminAnyDatabase", + [[ 1 -ge 30 ]] + (( n++ )) + sleep 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-23515 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-23515 + 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-2715/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-23515 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-23515 + 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.vcmfoEOM2g +++ mktemp ++ local LAST_ERR=/tmp/tmp.kNTPFRvso4 ++ 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.vcmfoEOM2g ++ cat /tmp/tmp.kNTPFRvso4 ++ rm /tmp/tmp.vcmfoEOM2g /tmp/tmp.kNTPFRvso4 ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.STpyerBoQ7 ++ mktemp + local LAST_ERR=/tmp/tmp.zZniXJqqDu + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.STpyerBoQ7 + cat /tmp/tmp.zZniXJqqDu + rm /tmp/tmp.STpyerBoQ7 /tmp/tmp.zZniXJqqDu + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles.json /tmp/tmp.ijN8aKvp5t/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-23515 + local 'command=use admin\n db.dropUser("user-two")' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-23515 + 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.AKKkqye4qS +++ mktemp ++ local LAST_ERR=/tmp/tmp.9OI4EWhLNo ++ 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.AKKkqye4qS ++ cat /tmp/tmp.9OI4EWhLNo ++ rm /tmp/tmp.AKKkqye4qS /tmp/tmp.9OI4EWhLNo ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.dkoC7eGzSd ++ mktemp + local LAST_ERR=/tmp/tmp.OekEY3lc2u + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.dkoC7eGzSd Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("88c7d56d-aed6-45c1-8c12-d8b186472fc9") } 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.OekEY3lc2u + rm /tmp/tmp.dkoC7eGzSd /tmp/tmp.OekEY3lc2u + 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-23515 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-23515 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-23515 + 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-2715/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-23515 mongodb + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + 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-23515 + 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.vVMbHA4rvk +++ mktemp ++ local LAST_ERR=/tmp/tmp.yct0vrE5zw ++ 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.vVMbHA4rvk ++ cat /tmp/tmp.yct0vrE5zw ++ rm /tmp/tmp.vVMbHA4rvk /tmp/tmp.yct0vrE5zw ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.SxKHEsnqul ++ mktemp + local LAST_ERR=/tmp/tmp.dNNXOdf3O7 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=1 + set -e + [[ 1 == 0 ]] + [[ 0 == 9 ]] + grep -q 'Error from server (NotFound)' /tmp/tmp.dNNXOdf3O7 + 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.dNNXOdf3O7 + [[ -n 1 ]] + [[ 0 -lt 2 ]] + delay=0 + cat /tmp/tmp.SxKHEsnqul /tmp/tmp.dNNXOdf3O7 Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("02a7da01-5974-4338-be19-f7b6e948aacf") } 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: user 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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.SxKHEsnqul + cat /tmp/tmp.dNNXOdf3O7 + rm /tmp/tmp.SxKHEsnqul /tmp/tmp.dNNXOdf3O7 + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles.json /tmp/tmp.ijN8aKvp5t/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.bbDcd7eR8j ++ mktemp + local LAST_ERR=/tmp/tmp.SHwpN2Yn31 + 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.bbDcd7eR8j perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.SHwpN2Yn31 + rm /tmp/tmp.bbDcd7eR8j /tmp/tmp.SHwpN2Yn31 + 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.sJzkdNZUP4 +++ mktemp ++ local LAST_ERR=/tmp/tmp.LsP205fc7s ++ 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.sJzkdNZUP4 ++ cat /tmp/tmp.LsP205fc7s ++ rm /tmp/tmp.sJzkdNZUP4 /tmp/tmp.LsP205fc7s ++ 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.EW7FnheuJG +++ mktemp ++ local LAST_ERR=/tmp/tmp.a7PiH7AhjM ++ 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.EW7FnheuJG ++ cat /tmp/tmp.a7PiH7AhjM ++ rm /tmp/tmp.EW7FnheuJG /tmp/tmp.a7PiH7AhjM ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.qolI1KOaes +++ mktemp ++ local LAST_ERR=/tmp/tmp.BDpOLWktpM ++ 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.qolI1KOaes ++ cat /tmp/tmp.BDpOLWktpM ++ rm /tmp/tmp.qolI1KOaes /tmp/tmp.BDpOLWktpM ++ 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-23515 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-23515 + 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-2715/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 ]] + 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-23515 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})();' + 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-23515 + 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.mEEhnEHFmu +++ mktemp ++ local LAST_ERR=/tmp/tmp.E8GBHD6dQF ++ 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.mEEhnEHFmu ++ cat /tmp/tmp.E8GBHD6dQF ++ rm /tmp/tmp.mEEhnEHFmu /tmp/tmp.E8GBHD6dQF ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.MbXb1TUWEz ++ mktemp + local LAST_ERR=/tmp/tmp.IfbgQ9zyYH + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.MbXb1TUWEz + cat /tmp/tmp.IfbgQ9zyYH + rm /tmp/tmp.MbXb1TUWEz /tmp/tmp.IfbgQ9zyYH + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-three-admin-db.json /tmp/tmp.ijN8aKvp5t/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-23515 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-23515 + 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-2715/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-23515 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-23515 + 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}' + sed '/"userId"/d' + 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.6LS1sDyaiA +++ mktemp ++ local LAST_ERR=/tmp/tmp.XYhygMbQ3o ++ 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.6LS1sDyaiA ++ cat /tmp/tmp.XYhygMbQ3o ++ rm /tmp/tmp.6LS1sDyaiA /tmp/tmp.XYhygMbQ3o ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.4Yzae9wkcR ++ mktemp + local LAST_ERR=/tmp/tmp.7a5L1K2pFQ + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.4Yzae9wkcR + cat /tmp/tmp.7a5L1K2pFQ + rm /tmp/tmp.4Yzae9wkcR /tmp/tmp.7a5L1K2pFQ + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-two-update-roles.json /tmp/tmp.ijN8aKvp5t/user-two-update-roles + check_auth user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515 + local uri=user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515 ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515 '' '' --quiet ++ local 'command=db.runCommand({ ping: 1 }).ok' ++ local uri=user-two:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515 ++ 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.YFhGeBkUNN ++++ mktemp +++ local LAST_ERR=/tmp/tmp.06mEBScRln +++ 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.YFhGeBkUNN +++ cat /tmp/tmp.06mEBScRln +++ rm /tmp/tmp.YFhGeBkUNN /tmp/tmp.06mEBScRln +++ return 0 ++ local client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.92QbtqWYsR +++ mktemp ++ local LAST_ERR=/tmp/tmp.CY4uEB4u31 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.92QbtqWYsR ++ cat /tmp/tmp.CY4uEB4u31 ++ rm /tmp/tmp.92QbtqWYsR /tmp/tmp.CY4uEB4u31 ++ 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-23515 + local uri=user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515 ++ run_mongos 'db.runCommand({ ping: 1 }).ok' user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515 '' '' --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-23515 ++ 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.Ef2JFOQ3XV ++++ mktemp +++ local LAST_ERR=/tmp/tmp.eFtKmg4wud +++ 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.Ef2JFOQ3XV +++ cat /tmp/tmp.eFtKmg4wud +++ rm /tmp/tmp.Ef2JFOQ3XV /tmp/tmp.eFtKmg4wud +++ return 0 ++ local client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin --quiet' +++ mktemp ++ local LAST_OUT=/tmp/tmp.S0XDQqXmPF +++ mktemp ++ local LAST_ERR=/tmp/tmp.N5C9p4oW9j ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin --quiet' ++ exit_status=0 ++ set -e ++ [[ 0 == 0 ]] ++ break ++ cat /tmp/tmp.S0XDQqXmPF ++ cat /tmp/tmp.N5C9p4oW9j ++ rm /tmp/tmp.S0XDQqXmPF /tmp/tmp.N5C9p4oW9j ++ 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.3b0wWCGa3m +++ mktemp ++ local LAST_ERR=/tmp/tmp.aiznPbUgCy ++ 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.3b0wWCGa3m ++ cat /tmp/tmp.aiznPbUgCy ++ rm /tmp/tmp.3b0wWCGa3m /tmp/tmp.aiznPbUgCy ++ 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.kqxpZ5HWbP +++ mktemp ++ local LAST_ERR=/tmp/tmp.8CLu0bk2qk ++ 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.kqxpZ5HWbP ++ cat /tmp/tmp.8CLu0bk2qk ++ rm /tmp/tmp.kqxpZ5HWbP /tmp/tmp.8CLu0bk2qk ++ return 0 + connection_string='mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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.GQjW70DbSE +++ mktemp ++ local LAST_ERR=/tmp/tmp.qJ8MC1uMtZ ++ 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.GQjW70DbSE ++ cat /tmp/tmp.qJ8MC1uMtZ ++ rm /tmp/tmp.GQjW70DbSE /tmp/tmp.qJ8MC1uMtZ ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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.m6i8KNgw9x +++ mktemp ++ local LAST_ERR=/tmp/tmp.wyGn4ZcgJH ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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.m6i8KNgw9x ++ cat /tmp/tmp.wyGn4ZcgJH ++ rm /tmp/tmp.m6i8KNgw9x /tmp/tmp.wyGn4ZcgJH ++ 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.wfcGbmZtms ++ mktemp + local LAST_ERR=/tmp/tmp.UKA3Jv52C3 + 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.wfcGbmZtms perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.UKA3Jv52C3 + rm /tmp/tmp.wfcGbmZtms /tmp/tmp.UKA3Jv52C3 + 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.ZofQWk4ffO +++ mktemp ++ local LAST_ERR=/tmp/tmp.0pk6WC7Svp ++ 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.ZofQWk4ffO ++ cat /tmp/tmp.0pk6WC7Svp ++ rm /tmp/tmp.ZofQWk4ffO /tmp/tmp.0pk6WC7Svp ++ 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.mFbK700Jj6 +++ mktemp ++ local LAST_ERR=/tmp/tmp.nFDAKuGxPa ++ 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.mFbK700Jj6 ++ cat /tmp/tmp.nFDAKuGxPa ++ rm /tmp/tmp.mFbK700Jj6 /tmp/tmp.nFDAKuGxPa ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.g06ZIiC9Nb +++ mktemp ++ local LAST_ERR=/tmp/tmp.4pWRkfI4BV ++ 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.g06ZIiC9Nb ++ cat /tmp/tmp.4pWRkfI4BV ++ rm /tmp/tmp.g06ZIiC9Nb /tmp/tmp.4pWRkfI4BV ++ 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-23515 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-23515 + 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-2715/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 ]] + 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-23515 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-23515 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + 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_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.WBdlJJEjbD +++ mktemp ++ local LAST_ERR=/tmp/tmp.94ST3rJK2W ++ 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.WBdlJJEjbD ++ cat /tmp/tmp.94ST3rJK2W ++ rm /tmp/tmp.WBdlJJEjbD /tmp/tmp.94ST3rJK2W ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.1enqErANAC ++ mktemp + local LAST_ERR=/tmp/tmp.I5hkQwfzLN + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.1enqErANAC + cat /tmp/tmp.I5hkQwfzLN + rm /tmp/tmp.1enqErANAC /tmp/tmp.I5hkQwfzLN + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-three-newDb-db.json /tmp/tmp.ijN8aKvp5t/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-23515 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-23515 + 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-2715/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 ]] + 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-23515 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})();' + /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-23515 + 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}' + 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.bp3gbPJUek +++ mktemp ++ local LAST_ERR=/tmp/tmp.zRWJ8FBmCG ++ 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.bp3gbPJUek ++ cat /tmp/tmp.zRWJ8FBmCG ++ rm /tmp/tmp.bp3gbPJUek /tmp/tmp.zRWJ8FBmCG ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.0TJtPgXZc9 ++ mktemp + local LAST_ERR=/tmp/tmp.zjQb4u5XFT + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.0TJtPgXZc9 + cat /tmp/tmp.zjQb4u5XFT + rm /tmp/tmp.0TJtPgXZc9 /tmp/tmp.zjQb4u5XFT + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-three-admin-db.json /tmp/tmp.ijN8aKvp5t/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.zqWQD2SMyA +++ mktemp ++ local LAST_ERR=/tmp/tmp.3QHAC32MIU ++ 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.zqWQD2SMyA ++ cat /tmp/tmp.3QHAC32MIU ++ rm /tmp/tmp.zqWQD2SMyA /tmp/tmp.3QHAC32MIU ++ 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.RRINikky3l +++ mktemp ++ local LAST_ERR=/tmp/tmp.Nnh9grC8c7 ++ 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.RRINikky3l ++ cat /tmp/tmp.Nnh9grC8c7 ++ rm /tmp/tmp.RRINikky3l /tmp/tmp.Nnh9grC8c7 ++ return 0 + connection_string='mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=newDb&tls=true' + '[' -z 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=newDb&tls=true' ']' + [[ mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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.3VTootoCo8 +++ mktemp ++ local LAST_ERR=/tmp/tmp.9TARgB09tc ++ 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.3VTootoCo8 ++ cat /tmp/tmp.9TARgB09tc ++ rm /tmp/tmp.3VTootoCo8 /tmp/tmp.9TARgB09tc ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ 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-kz4k4 -- mongo 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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' +++ mktemp ++ local LAST_OUT=/tmp/tmp.ENdeKDvDXP +++ mktemp ++ local LAST_ERR=/tmp/tmp.hVbTwnWma5 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local:27017/?authSource=newDb&tls=true == \- ]] ++ [[ mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://user-three:new-user-two-password@some-name-mongos.custom-users-roles-sharded-23515.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.ENdeKDvDXP ++ cat /tmp/tmp.hVbTwnWma5 ++ rm /tmp/tmp.ENdeKDvDXP /tmp/tmp.hVbTwnWma5 ++ 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.lejeJlIrX2 ++ mktemp + local LAST_ERR=/tmp/tmp.vS0lN23Zh2 + 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.lejeJlIrX2 perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.vS0lN23Zh2 + rm /tmp/tmp.lejeJlIrX2 /tmp/tmp.vS0lN23Zh2 + 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.M2QPFXyh2Z +++ mktemp ++ local LAST_ERR=/tmp/tmp.jeDRNA3tVP ++ 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.M2QPFXyh2Z ++ cat /tmp/tmp.jeDRNA3tVP ++ rm /tmp/tmp.M2QPFXyh2Z /tmp/tmp.jeDRNA3tVP ++ 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.OvfPpAvC87 +++ mktemp ++ local LAST_ERR=/tmp/tmp.WGpxnSRY0v ++ 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.OvfPpAvC87 ++ cat /tmp/tmp.WGpxnSRY0v ++ rm /tmp/tmp.OvfPpAvC87 /tmp/tmp.WGpxnSRY0v ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.0L1uYIzYBb +++ mktemp ++ local LAST_ERR=/tmp/tmp.6zRQy7zZJl ++ 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.0L1uYIzYBb ++ cat /tmp/tmp.6zRQy7zZJl ++ rm /tmp/tmp.0L1uYIzYBb /tmp/tmp.6zRQy7zZJl ++ 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-23515 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-23515 + local target=user-four + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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})();' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-23515 + 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.qAvSnW4daA +++ mktemp ++ local LAST_ERR=/tmp/tmp.NxfhgUsA5I ++ 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.qAvSnW4daA ++ cat /tmp/tmp.NxfhgUsA5I ++ rm /tmp/tmp.qAvSnW4daA /tmp/tmp.NxfhgUsA5I ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.4QhBQa3nDv ++ mktemp + local LAST_ERR=/tmp/tmp.tdJzTKL8ij + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.4QhBQa3nDv + cat /tmp/tmp.tdJzTKL8ij + rm /tmp/tmp.4QhBQa3nDv /tmp/tmp.tdJzTKL8ij + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-four.json /tmp/tmp.ijN8aKvp5t/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.pC8iHT7lm8 +++ mktemp ++ local LAST_ERR=/tmp/tmp.4sxeZGlZzM ++ 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.pC8iHT7lm8 ++ cat /tmp/tmp.4sxeZGlZzM ++ rm /tmp/tmp.pC8iHT7lm8 /tmp/tmp.4sxeZGlZzM ++ 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 ++ base64 -d ++ kubectl_bin get secret user-two-conn-str -o 'go-template={{index .data "user_four_mongos_connectionString"}}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.tAHTaSbZqY +++ mktemp ++ local LAST_ERR=/tmp/tmp.MDhQnSqey2 ++ 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.tAHTaSbZqY ++ cat /tmp/tmp.MDhQnSqey2 ++ rm /tmp/tmp.tAHTaSbZqY /tmp/tmp.MDhQnSqey2 ++ return 0 + connection_string='mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' + '[' -z 'mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=admin&tls=true' ']' + [[ mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.zNEjwx0YDn +++ mktemp ++ local LAST_ERR=/tmp/tmp.FhF9FOa9Du ++ 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.zNEjwx0YDn ++ cat /tmp/tmp.FhF9FOa9Du ++ rm /tmp/tmp.zNEjwx0YDn /tmp/tmp.FhF9FOa9Du ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.gv9dgIcKxy +++ mktemp ++ local LAST_ERR=/tmp/tmp.u0XyeyGYH8 ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local:27017/?authSource=admin&tls=true == \- ]] ++ [[ mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://user%2Ffour:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.gv9dgIcKxy ++ cat /tmp/tmp.u0XyeyGYH8 ++ rm /tmp/tmp.gv9dgIcKxy /tmp/tmp.u0XyeyGYH8 ++ 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-23515 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-23515 + local target=role-one + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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-23515 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo + sed '/"userId"/d' ++ awk -F: '{print $2}' ++ echo .svc.cluster.local + 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.7dttePaNMr +++ mktemp ++ local LAST_ERR=/tmp/tmp.jGU3Utoog3 ++ 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.7dttePaNMr ++ cat /tmp/tmp.jGU3Utoog3 ++ rm /tmp/tmp.7dttePaNMr /tmp/tmp.jGU3Utoog3 ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.LMa8gbwFCU ++ mktemp + local LAST_ERR=/tmp/tmp.4BjfNOsE0I + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.LMa8gbwFCU + cat /tmp/tmp.4BjfNOsE0I + rm /tmp/tmp.LMa8gbwFCU /tmp/tmp.4BjfNOsE0I + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/role-one-83.json /tmp/tmp.ijN8aKvp5t/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-23515 + local 'command=use admin\n db.dropRole("role-one")' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-23515 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ awk -F: '{print $2}' ++ echo .svc.cluster.local + 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.UCuujdJJyn +++ mktemp ++ local LAST_ERR=/tmp/tmp.wc7tTFbM6C ++ 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.UCuujdJJyn ++ cat /tmp/tmp.wc7tTFbM6C ++ rm /tmp/tmp.UCuujdJJyn /tmp/tmp.wc7tTFbM6C ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.gMcEYWhv5W ++ mktemp + local LAST_ERR=/tmp/tmp.syUXOZ907v + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.gMcEYWhv5W Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("b98a9b58-329e-44cb-8851-f9947a82a713") } 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.syUXOZ907v + rm /tmp/tmp.gMcEYWhv5W /tmp/tmp.syUXOZ907v + 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-23515 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-23515 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-23515 + local target=role-one + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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-23515 + 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.cAbZaToUDE +++ mktemp ++ local LAST_ERR=/tmp/tmp.FjqyPrmBko ++ 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.cAbZaToUDE ++ cat /tmp/tmp.FjqyPrmBko ++ rm /tmp/tmp.cAbZaToUDE /tmp/tmp.FjqyPrmBko ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.VNemtxTkPY ++ mktemp + local LAST_ERR=/tmp/tmp.hxc3NhW4VX + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=1 + set -e + [[ 1 == 0 ]] + [[ 0 == 9 ]] + grep -q 'Error from server (NotFound)' /tmp/tmp.hxc3NhW4VX + 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.hxc3NhW4VX + [[ -n 1 ]] + [[ 0 -lt 2 ]] + delay=0 + cat /tmp/tmp.VNemtxTkPY /tmp/tmp.hxc3NhW4VX Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("3d8d08cd-32c5-48fa-bc77-9d06768d58c5") } 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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=1 + set -e + [[ 1 == 0 ]] + [[ 1 == 9 ]] + grep -q 'Error from server (NotFound)' /tmp/tmp.hxc3NhW4VX + 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.hxc3NhW4VX + [[ -n 1 ]] + [[ 1 -lt 2 ]] + delay=4 + cat /tmp/tmp.VNemtxTkPY /tmp/tmp.hxc3NhW4VX Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("55f6c283-5b2b-4f36-b463-a1ca57a616aa") } 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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.VNemtxTkPY + cat /tmp/tmp.hxc3NhW4VX + rm /tmp/tmp.VNemtxTkPY /tmp/tmp.hxc3NhW4VX + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/role-one-83.json /tmp/tmp.ijN8aKvp5t/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.bE0vuRalds ++ mktemp + local LAST_ERR=/tmp/tmp.JIKOvCFKl9 + 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.bE0vuRalds perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.JIKOvCFKl9 + rm /tmp/tmp.bE0vuRalds /tmp/tmp.JIKOvCFKl9 + 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.3oXjM6OSAs +++ mktemp ++ local LAST_ERR=/tmp/tmp.9tlbTsQUWT ++ 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.3oXjM6OSAs ++ cat /tmp/tmp.9tlbTsQUWT ++ rm /tmp/tmp.3oXjM6OSAs /tmp/tmp.9tlbTsQUWT ++ 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.DUkUdMaCMx +++ mktemp ++ local LAST_ERR=/tmp/tmp.INOyEcDzFj ++ 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.DUkUdMaCMx ++ cat /tmp/tmp.INOyEcDzFj ++ rm /tmp/tmp.DUkUdMaCMx /tmp/tmp.INOyEcDzFj ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.lUUA2CHdEl +++ mktemp ++ local LAST_ERR=/tmp/tmp.7YDXYxvTXY ++ 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.lUUA2CHdEl ++ cat /tmp/tmp.7YDXYxvTXY ++ rm /tmp/tmp.lUUA2CHdEl /tmp/tmp.7YDXYxvTXY ++ 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-23515 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-23515 + local target=role-one + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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-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-23515 + 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.WZmpmPPIAm +++ mktemp ++ local LAST_ERR=/tmp/tmp.UYcKkJQdGf ++ 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.WZmpmPPIAm ++ cat /tmp/tmp.UYcKkJQdGf ++ rm /tmp/tmp.WZmpmPPIAm /tmp/tmp.UYcKkJQdGf ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.GmAKXYDus1 ++ mktemp + local LAST_ERR=/tmp/tmp.DIZV0xvLgd + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.GmAKXYDus1 + cat /tmp/tmp.DIZV0xvLgd + rm /tmp/tmp.GmAKXYDus1 /tmp/tmp.DIZV0xvLgd + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/role-one-83.json /tmp/tmp.ijN8aKvp5t/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-23515 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-23515 + local target=role-two + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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-23515 + local driver=mongodb + local suffix=.svc.cluster.local + sed '/"userId"/d' + 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/' ++ 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.gusdupfGNn +++ mktemp ++ local LAST_ERR=/tmp/tmp.Imc48r71XF ++ 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.gusdupfGNn ++ cat /tmp/tmp.Imc48r71XF ++ rm /tmp/tmp.gusdupfGNn /tmp/tmp.Imc48r71XF ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.VvzGi3K4BQ ++ mktemp + local LAST_ERR=/tmp/tmp.f7FHH6KmYb + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.VvzGi3K4BQ + cat /tmp/tmp.f7FHH6KmYb + rm /tmp/tmp.VvzGi3K4BQ /tmp/tmp.f7FHH6KmYb + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/role-two-83.json /tmp/tmp.ijN8aKvp5t/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.SKmk5m6VfP ++ mktemp + local LAST_ERR=/tmp/tmp.F6MTRKVH42 + 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.SKmk5m6VfP perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.F6MTRKVH42 + rm /tmp/tmp.SKmk5m6VfP /tmp/tmp.F6MTRKVH42 + 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.Hmt3of5OB1 +++ mktemp ++ local LAST_ERR=/tmp/tmp.4cSRmIrbri ++ 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.Hmt3of5OB1 ++ cat /tmp/tmp.4cSRmIrbri ++ rm /tmp/tmp.Hmt3of5OB1 /tmp/tmp.4cSRmIrbri ++ 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.jn1E30nhqk +++ mktemp ++ local LAST_ERR=/tmp/tmp.vunYeoKSmu ++ 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.jn1E30nhqk ++ cat /tmp/tmp.vunYeoKSmu ++ rm /tmp/tmp.jn1E30nhqk /tmp/tmp.vunYeoKSmu ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.IPmJYkGj5H +++ mktemp ++ local LAST_ERR=/tmp/tmp.wjLBhc7PMg ++ 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.IPmJYkGj5H ++ cat /tmp/tmp.wjLBhc7PMg ++ rm /tmp/tmp.IPmJYkGj5H /tmp/tmp.wjLBhc7PMg ++ 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-23515 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-23515 + 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-2715/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-23515 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-23515 + 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/' + 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}' + 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.nNitmjKqBD +++ mktemp ++ local LAST_ERR=/tmp/tmp.edGx7DthyA ++ 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.nNitmjKqBD ++ cat /tmp/tmp.edGx7DthyA ++ rm /tmp/tmp.nNitmjKqBD /tmp/tmp.edGx7DthyA ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.xcZEXjJTyP ++ mktemp + local LAST_ERR=/tmp/tmp.9ZiO6SM1u2 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.xcZEXjJTyP + cat /tmp/tmp.9ZiO6SM1u2 + rm /tmp/tmp.xcZEXjJTyP /tmp/tmp.9ZiO6SM1u2 + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/role-two-updated.json /tmp/tmp.ijN8aKvp5t/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-23515 + 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-23515 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ awk -F: '{print $2}' ++ echo .svc.cluster.local + 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.pi5NnyLkHA +++ mktemp ++ local LAST_ERR=/tmp/tmp.nK2RFqfj5n ++ 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.pi5NnyLkHA ++ cat /tmp/tmp.nK2RFqfj5n ++ rm /tmp/tmp.pi5NnyLkHA /tmp/tmp.nK2RFqfj5n ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.hG9pAaaTHP ++ mktemp + local LAST_ERR=/tmp/tmp.Yqk67t9Up1 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.hG9pAaaTHP Percona Server for MongoDB shell version v4.4.29-28 connecting to: mongodb://some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/admin?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("7194a58f-4b8c-4473-9898-e635f6b3e9a9") } 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.Yqk67t9Up1 + rm /tmp/tmp.hG9pAaaTHP /tmp/tmp.Yqk67t9Up1 + 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-23515 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-23515 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-23515 + 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-2715/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-23515 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-23515 + 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.1R5Nd6Z0xs +++ mktemp ++ local LAST_ERR=/tmp/tmp.6jv4ZDU7cI ++ 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.1R5Nd6Z0xs ++ cat /tmp/tmp.6jv4ZDU7cI ++ rm /tmp/tmp.1R5Nd6Z0xs /tmp/tmp.6jv4ZDU7cI ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.RhKcSBSTiA ++ mktemp + local LAST_ERR=/tmp/tmp.eMdaAM0HAl + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.RhKcSBSTiA + cat /tmp/tmp.eMdaAM0HAl + rm /tmp/tmp.RhKcSBSTiA /tmp/tmp.eMdaAM0HAl + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/role-two-updated.json /tmp/tmp.ijN8aKvp5t/role-two-updated 13c13,14 < "find" --- > "find", > "update" 27c28,29 < "find" --- > "find", > "update" + [[ 1 -ge 30 ]] + (( n++ )) + sleep 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-23515 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-23515 + 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-2715/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-23515 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})();' + 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-23515 + /usr/sbin/sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' + 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.ZuXMJl6tTf +++ mktemp ++ local LAST_ERR=/tmp/tmp.OY9A8kVfUN ++ 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.ZuXMJl6tTf ++ cat /tmp/tmp.OY9A8kVfUN ++ rm /tmp/tmp.ZuXMJl6tTf /tmp/tmp.OY9A8kVfUN ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.92ql3EJAe1 ++ mktemp + local LAST_ERR=/tmp/tmp.YSrR8ODabX + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.92ql3EJAe1 + cat /tmp/tmp.YSrR8ODabX + rm /tmp/tmp.92ql3EJAe1 /tmp/tmp.YSrR8ODabX + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/role-two-updated.json /tmp/tmp.ijN8aKvp5t/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.UvL9Ptj4lP ++ mktemp + local LAST_ERR=/tmp/tmp.OYFMudJnQG + 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.UvL9Ptj4lP perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.OYFMudJnQG + rm /tmp/tmp.UvL9Ptj4lP /tmp/tmp.OYFMudJnQG + 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.ZPeof69BKB +++ mktemp ++ local LAST_ERR=/tmp/tmp.WbDRQoEKxE ++ 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.ZPeof69BKB ++ cat /tmp/tmp.WbDRQoEKxE ++ rm /tmp/tmp.ZPeof69BKB /tmp/tmp.WbDRQoEKxE ++ 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.NZooJyhavs +++ mktemp ++ local LAST_ERR=/tmp/tmp.dnfFbNNojP ++ 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.NZooJyhavs ++ cat /tmp/tmp.dnfFbNNojP ++ rm /tmp/tmp.NZooJyhavs /tmp/tmp.dnfFbNNojP ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.1JSiRrmC70 +++ mktemp ++ local LAST_ERR=/tmp/tmp.PXyeGqQNRE ++ 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.1JSiRrmC70 ++ cat /tmp/tmp.PXyeGqQNRE ++ rm /tmp/tmp.1JSiRrmC70 /tmp/tmp.PXyeGqQNRE ++ 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-23515 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-23515 + local target=role-three + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 mongodb + 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-23515 + local driver=mongodb + local suffix=.svc.cluster.local + local mongo_flag= + local port=27017 + local mongo_bin=mongo ++ echo .svc.cluster.local + sed '/"userId"/d' ++ awk -F: '{print $2}' + 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/' + 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.2rw6IsnN52 +++ mktemp ++ local LAST_ERR=/tmp/tmp.uwE2Ht9Bpm ++ 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.2rw6IsnN52 ++ cat /tmp/tmp.uwE2Ht9Bpm ++ rm /tmp/tmp.2rw6IsnN52 /tmp/tmp.uwE2Ht9Bpm ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.8BM6ZT1wde ++ mktemp + local LAST_ERR=/tmp/tmp.Q2K2E7QLgK + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.8BM6ZT1wde + cat /tmp/tmp.Q2K2E7QLgK + rm /tmp/tmp.8BM6ZT1wde /tmp/tmp.Q2K2E7QLgK + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/role-three.json /tmp/tmp.ijN8aKvp5t/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.9UmbFsJxUU ++ mktemp + local LAST_ERR=/tmp/tmp.3AwJpagiY6 + 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.9UmbFsJxUU perconaservermongodb.psmdb.percona.com/some-name patched + cat /tmp/tmp.3AwJpagiY6 + rm /tmp/tmp.9UmbFsJxUU /tmp/tmp.3AwJpagiY6 + 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.YJHRBEnKJj +++ mktemp ++ local LAST_ERR=/tmp/tmp.YNFcpTY5YG ++ 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.YJHRBEnKJj ++ cat /tmp/tmp.YNFcpTY5YG ++ rm /tmp/tmp.YJHRBEnKJj /tmp/tmp.YNFcpTY5YG ++ 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.X4wyVBcy4s +++ mktemp ++ local LAST_ERR=/tmp/tmp.4FST3reWIk ++ 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.X4wyVBcy4s ++ cat /tmp/tmp.4FST3reWIk ++ rm /tmp/tmp.X4wyVBcy4s /tmp/tmp.4FST3reWIk ++ return 0 + [[ '' == true ]] ++ kubectl_bin get psmdb some-name -o 'jsonpath={.spec.replsets[?(@.name=="rs0")].hidden.enabled}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.SFDKKVGaXx +++ mktemp ++ local LAST_ERR=/tmp/tmp.tFJg9w9lzA ++ 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.SFDKKVGaXx ++ cat /tmp/tmp.tFJg9w9lzA ++ rm /tmp/tmp.SFDKKVGaXx /tmp/tmp.tFJg9w9lzA ++ 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-23515 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-23515 + local target=role-four + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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 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})();' + /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-23515 + 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.038Agv3Z4r +++ mktemp ++ local LAST_ERR=/tmp/tmp.CpR9z8L2RS ++ 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.038Agv3Z4r ++ cat /tmp/tmp.CpR9z8L2RS ++ rm /tmp/tmp.038Agv3Z4r /tmp/tmp.CpR9z8L2RS ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.luPtAw55nu ++ mktemp + local LAST_ERR=/tmp/tmp.YNqXycAGPV + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.luPtAw55nu + cat /tmp/tmp.YNqXycAGPV + rm /tmp/tmp.luPtAw55nu /tmp/tmp.YNqXycAGPV + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/role-four.json /tmp/tmp.ijN8aKvp5t/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-23515 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-23515 + local target=role-five + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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 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-23515 + 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.fhRtgUqgnD +++ mktemp ++ local LAST_ERR=/tmp/tmp.XvcKUWW7xj ++ 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.fhRtgUqgnD ++ cat /tmp/tmp.XvcKUWW7xj ++ rm /tmp/tmp.fhRtgUqgnD /tmp/tmp.XvcKUWW7xj ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.EkGIPqwuS8 ++ mktemp + local LAST_ERR=/tmp/tmp.gMK2i5Qzxg + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.EkGIPqwuS8 + cat /tmp/tmp.gMK2i5Qzxg + rm /tmp/tmp.EkGIPqwuS8 /tmp/tmp.gMK2i5Qzxg + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/role-five.json /tmp/tmp.ijN8aKvp5t/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-23515 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-23515 + local target=user-five + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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 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})();' + sed '/"userId"/d' + local uri=userAdmin:userAdmin123456@some-name-mongos.custom-users-roles-sharded-23515 + 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.YNTNRREdo7 +++ mktemp ++ local LAST_ERR=/tmp/tmp.jqYnPxf9lf ++ 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.YNTNRREdo7 ++ cat /tmp/tmp.jqYnPxf9lf ++ rm /tmp/tmp.YNTNRREdo7 /tmp/tmp.jqYnPxf9lf ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.IWyPowGQYi ++ mktemp + local LAST_ERR=/tmp/tmp.2ed8lux7k6 + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.IWyPowGQYi + cat /tmp/tmp.2ed8lux7k6 + rm /tmp/tmp.IWyPowGQYi /tmp/tmp.2ed8lux7k6 + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-five.json /tmp/tmp.ijN8aKvp5t/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-23515 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-23515 + local target=user-six + [[ docker.io/perconalab/percona-server-mongodb-operator:main-mongod8.3 =~ 8\.3 ]] + '[' -f /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/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-23515 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-23515 + 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.YlCBGTMRTA +++ mktemp ++ local LAST_ERR=/tmp/tmp.NGhFV9lpKu ++ 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.YlCBGTMRTA ++ cat /tmp/tmp.NGhFV9lpKu ++ rm /tmp/tmp.YlCBGTMRTA /tmp/tmp.NGhFV9lpKu ++ return 0 + local client_container=psmdb-client-748949c7cd-kz4k4 + kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' ++ mktemp + local LAST_OUT=/tmp/tmp.UxigseHidb ++ mktemp + local LAST_ERR=/tmp/tmp.RQiCCuV0JO + local exit_status=0 + local timeout=4 + local i + args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' '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-23515.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-kz4k4 == \- ]] + [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.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-23515.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-kz4k4 -- 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-23515.svc.cluster.local:27017/admin ' + exit_status=0 + set -e + [[ 0 == 0 ]] + break + cat /tmp/tmp.UxigseHidb + cat /tmp/tmp.RQiCCuV0JO + rm /tmp/tmp.UxigseHidb /tmp/tmp.RQiCCuV0JO + return 0 + diff /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/custom-users-roles-sharded/compare/user-six.json /tmp/tmp.ijN8aKvp5t/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.XdxbhsGWXP +++ mktemp ++ local LAST_ERR=/tmp/tmp.TJyN0WPAlJ ++ 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.XdxbhsGWXP ++ cat /tmp/tmp.TJyN0WPAlJ ++ rm /tmp/tmp.XdxbhsGWXP /tmp/tmp.TJyN0WPAlJ ++ 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.pD2ORg7mEj +++ mktemp ++ local LAST_ERR=/tmp/tmp.BT4uZoc9yF ++ 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.pD2ORg7mEj ++ cat /tmp/tmp.BT4uZoc9yF ++ rm /tmp/tmp.pD2ORg7mEj /tmp/tmp.BT4uZoc9yF ++ return 0 + connection_string='mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=testAdmin&tls=true' + '[' -z 'mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=testAdmin&tls=true' ']' + [[ mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.JUv4H1Fpjy +++ mktemp ++ local LAST_ERR=/tmp/tmp.Fs6TWrbRpW ++ 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.JUv4H1Fpjy ++ cat /tmp/tmp.Fs6TWrbRpW ++ rm /tmp/tmp.JUv4H1Fpjy /tmp/tmp.Fs6TWrbRpW ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.98An3IqKyT +++ mktemp ++ local LAST_ERR=/tmp/tmp.FfDybrGyDb ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local:27017/?authSource=testAdmin&tls=true == \- ]] ++ [[ mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://user-five:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.98An3IqKyT ++ cat /tmp/tmp.FfDybrGyDb ++ rm /tmp/tmp.98An3IqKyT /tmp/tmp.FfDybrGyDb ++ 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 ++ base64 -d ++ kubectl_bin get secret user-one-conn-str -o 'go-template={{index .data "user-six_mongos_connectionString"}}' +++ mktemp ++ local LAST_OUT=/tmp/tmp.hvniSkql7h +++ mktemp ++ local LAST_ERR=/tmp/tmp.opNVCqd2Sl ++ 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.hvniSkql7h ++ cat /tmp/tmp.opNVCqd2Sl ++ rm /tmp/tmp.hvniSkql7h /tmp/tmp.opNVCqd2Sl ++ return 0 + connection_string='mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=testAdmin&tls=true' + '[' -z 'mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.svc.cluster.local:27017/?authSource=testAdmin&tls=true' ']' + [[ mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.a1iWYdgeMa +++ mktemp ++ local LAST_ERR=/tmp/tmp.yz6SCpd5YY ++ 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.a1iWYdgeMa ++ cat /tmp/tmp.yz6SCpd5YY ++ rm /tmp/tmp.a1iWYdgeMa /tmp/tmp.yz6SCpd5YY ++ return 0 + client_container=psmdb-client-748949c7cd-kz4k4 ++ kubectl_bin exec psmdb-client-748949c7cd-kz4k4 -- mongo 'mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.tdtRYqJ65q +++ mktemp ++ local LAST_ERR=/tmp/tmp.EAWEgR0aJy ++ local exit_status=0 ++ local timeout=4 ++ local i ++ args=('exec' 'psmdb-client-748949c7cd-kz4k4' '--' 'mongo' 'mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 == \- ]] ++ [[ psmdb-client-748949c7cd-kz4k4 =~ ^(-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-23515.svc.cluster.local:27017/?authSource=testAdmin&tls=true == \- ]] ++ [[ mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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-kz4k4 -- mongo 'mongodb://user-six:clusterMonitor@some-name-mongos.custom-users-roles-sharded-23515.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.tdtRYqJ65q ++ cat /tmp/tmp.EAWEgR0aJy ++ rm /tmp/tmp.tdtRYqJ65q /tmp/tmp.EAWEgR0aJy ++ return 0 + ping=1 + '[' 1 '!=' 1 ']' + IFS= + read -r data_key + destroy custom-users-roles-sharded-23515 + local namespace=custom-users-roles-sharded-23515 + local ignore_logs=true + [[ 1 == 1 ]] + echo 'SKIP_DELETE=1, not destroying custom-users-roles-sharded-23515' SKIP_DELETE=1, not destroying custom-users-roles-sharded-23515 + return + desc 'test passed' + set +o xtrace ----------------------------------------------------------------------------------- test passed ----------------------------------------------------------------------------------- ==================================================================================================== [PASSED] e2e-tests/test_pytest_wrapper.py::test_bash_wrapper ==================================================================================================== [06:02:31.191782] INFO Deleting cert-manager [06:02:48.109358] INFO Cleaning up test environment --------------------------------------- generated xml file: /mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/reports/custom-users-roles-sharded.xml --------------------------------------- --------------------------------- Generated html report: file:///mnt/jenkins/workspace/cloud-psmdb-operator_PR-2715/e2e-tests/reports/custom-users-roles-sharded.html ---------------------------------- ==================================================================================== 1 passed in 697.07s (0:11:37) =====================================================================================