From e437f0f283d888f0cda5fd95abfa53bf7ebbd5d1 Mon Sep 17 00:00:00 2001 From: Tomislav Plavcic Date: Wed, 3 Aug 2022 15:53:08 +0200 Subject: [PATCH 1/7] K8SPXC-1071 - Replace proxysql-admin with percona-scheduler-admin for proxysql K8SPXC-1071 - Make percona-scheduler-admin usage optional Fix bundle and crd Add validation Error fixes fix build errors K8SPXC-1071 - Add SCHEDULER environment var for proxysql container K8SPXC-1071 - Set default value for proxysql scheduler K8SPXC-1071 - Fix validation for proxysql scheduler field Fix tests Remove different writer hostgroup for percona scheduler Remove scheduler as parameter for PrimaryHost function Revert proxysql hostgroup to the old one in e2e-tests/functions Leverage k8s API validation for Scheduler field Check mysql_galera_hostgroups only if proxysql-admin scheduler used Update tests Return writeID to original position and type Remove empty line Switch default scheduler in code to proxysql-admin Update tests Rename proxysql scheduler to pxchandler Fix validation for pxchandler for new variabe names Update manifest Fix review comment --- ...pxc.percona.com_perconaxtradbclusters.yaml | 5 +++ deploy/bundle.yaml | 5 +++ deploy/cr.yaml | 1 + deploy/crd.yaml | 5 +++ deploy/cw-bundle.yaml | 5 +++ .../statefulset_custom-proxysql-oc.yml | 6 ++++ .../compare/statefulset_custom-proxysql.yml | 6 ++++ .../statefulset_hostname-proxysql-oc.yml | 6 ++++ .../compare/statefulset_hostname-proxysql.yml | 6 ++++ .../statefulset_region-proxysql-oc.yml | 6 ++++ .../compare/statefulset_region-proxysql.yml | 6 ++++ .../compare/statefulset_zone-proxysql-oc.yml | 6 ++++ .../compare/statefulset_zone-proxysql.yml | 6 ++++ e2e-tests/functions | 8 +++-- .../statefulset_haproxy-proxysql-oc.yml | 6 ++++ ...statefulset_haproxy-proxysql-secret-oc.yml | 6 ++++ .../statefulset_haproxy-proxysql-secret.yml | 6 ++++ .../compare/statefulset_haproxy-proxysql.yml | 6 ++++ .../statefulset_some-name-proxysql-oc.yml | 6 ++++ .../statefulset_some-name-proxysql.yml | 6 ++++ e2e-tests/init-deploy/run | 4 +-- ...fulset_no-limits-proxysql-increased-oc.yml | 6 ++++ ...atefulset_no-limits-proxysql-increased.yml | 6 ++++ .../statefulset_no-limits-proxysql-oc.yml | 6 ++++ .../statefulset_no-limits-proxysql.yml | 6 ++++ ...quests-no-limits-proxysql-increased-oc.yml | 6 ++++ ...-requests-no-limits-proxysql-increased.yml | 6 ++++ ...lset_no-requests-no-limits-proxysql-oc.yml | 6 ++++ ...efulset_no-requests-no-limits-proxysql.yml | 6 ++++ ...lset_no-requests-proxysql-increased-oc.yml | 6 ++++ ...efulset_no-requests-proxysql-increased.yml | 6 ++++ .../statefulset_no-requests-proxysql-oc.yml | 6 ++++ .../statefulset_no-requests-proxysql.yml | 6 ++++ .../statefulset_side-car-proxysql-oc.yml | 6 ++++ .../compare/statefulset_side-car-proxysql.yml | 6 ++++ ...lset_sec-context-proxysql-changes-4-oc.yml | 6 ++++ ...fulset_sec-context-proxysql-changes-oc.yml | 6 ++++ ...atefulset_sec-context-proxysql-changes.yml | 6 ++++ .../statefulset_sec-context-proxysql.yml | 6 ++++ e2e-tests/smart-update1/run | 2 +- .../statefulset_emptydir-proxysql-oc.yml | 6 ++++ .../compare/statefulset_emptydir-proxysql.yml | 6 ++++ .../statefulset_hostpath-proxysql-oc.yml | 6 ++++ .../compare/statefulset_hostpath-proxysql.yml | 6 ++++ ...statefulset_some-name-proxysql-1120-oc.yml | 6 ++++ .../statefulset_some-name-proxysql-1120.yml | 8 ++++- ...atefulset_upgrade-proxysql-proxysql-oc.yml | 6 ++++ .../statefulset_upgrade-proxysql-proxysql.yml | 6 ++++ pkg/apis/pxc/v1/pxc_types.go | 12 ++++++- pkg/apis/pxc/v1/zz_generated.deepcopy.go | 18 ++++++++++- pkg/controller/pxc/controller.go | 4 +-- pkg/controller/pxc/status.go | 2 +- pkg/controller/pxc/status_test.go | 6 ++-- pkg/controller/pxc/upgrade.go | 6 ++-- pkg/controller/pxc/users.go | 6 +++- pkg/pxc/app/statefulset/proxysql.go | 31 +++++++++++++++++++ 56 files changed, 345 insertions(+), 17 deletions(-) diff --git a/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml b/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml index 34bfd6a089..be8e09a3a5 100644 --- a/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml +++ b/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml @@ -4078,6 +4078,11 @@ spec: type: object priorityClassName: type: string + pxchandler: + enum: + - internal + - scheduler + type: string readinessDelaySec: format: int32 type: integer diff --git a/deploy/bundle.yaml b/deploy/bundle.yaml index c356ae81e8..a3a074f1a4 100644 --- a/deploy/bundle.yaml +++ b/deploy/bundle.yaml @@ -4784,6 +4784,11 @@ spec: type: object priorityClassName: type: string + pxchandler: + enum: + - internal + - scheduler + type: string readinessDelaySec: format: int32 type: integer diff --git a/deploy/cr.yaml b/deploy/cr.yaml index 44b66f9920..ad3c332abc 100644 --- a/deploy/cr.yaml +++ b/deploy/cr.yaml @@ -318,6 +318,7 @@ spec: gracePeriod: 30 proxysql: enabled: false + pxchandler: internal size: 3 image: perconalab/percona-xtradb-cluster-operator:main-proxysql # imagePullPolicy: Always diff --git a/deploy/crd.yaml b/deploy/crd.yaml index 4d73e14c78..1164627146 100644 --- a/deploy/crd.yaml +++ b/deploy/crd.yaml @@ -4784,6 +4784,11 @@ spec: type: object priorityClassName: type: string + pxchandler: + enum: + - internal + - scheduler + type: string readinessDelaySec: format: int32 type: integer diff --git a/deploy/cw-bundle.yaml b/deploy/cw-bundle.yaml index 58fb62e200..94624d84d5 100644 --- a/deploy/cw-bundle.yaml +++ b/deploy/cw-bundle.yaml @@ -4784,6 +4784,11 @@ spec: type: object priorityClassName: type: string + pxchandler: + enum: + - internal + - scheduler + type: string readinessDelaySec: format: int32 type: integer diff --git a/e2e-tests/affinity/compare/statefulset_custom-proxysql-oc.yml b/e2e-tests/affinity/compare/statefulset_custom-proxysql-oc.yml index 38be117d8d..2989acc467 100644 --- a/e2e-tests/affinity/compare/statefulset_custom-proxysql-oc.yml +++ b/e2e-tests/affinity/compare/statefulset_custom-proxysql-oc.yml @@ -89,6 +89,8 @@ spec: secretKeyRef: key: monitor name: internal-custom + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: custom-env-vars-proxysql @@ -142,6 +144,8 @@ spec: secretKeyRef: key: monitor name: internal-custom + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: custom-env-vars-proxysql @@ -175,6 +179,8 @@ spec: secretKeyRef: key: monitor name: internal-custom + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: custom-env-vars-proxysql diff --git a/e2e-tests/affinity/compare/statefulset_custom-proxysql.yml b/e2e-tests/affinity/compare/statefulset_custom-proxysql.yml index 2ca65d47cd..ff2eb1d094 100644 --- a/e2e-tests/affinity/compare/statefulset_custom-proxysql.yml +++ b/e2e-tests/affinity/compare/statefulset_custom-proxysql.yml @@ -89,6 +89,8 @@ spec: secretKeyRef: key: monitor name: internal-custom + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: custom-env-vars-proxysql @@ -142,6 +144,8 @@ spec: secretKeyRef: key: monitor name: internal-custom + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: custom-env-vars-proxysql @@ -175,6 +179,8 @@ spec: secretKeyRef: key: monitor name: internal-custom + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: custom-env-vars-proxysql diff --git a/e2e-tests/affinity/compare/statefulset_hostname-proxysql-oc.yml b/e2e-tests/affinity/compare/statefulset_hostname-proxysql-oc.yml index e439c17850..a817783dcb 100644 --- a/e2e-tests/affinity/compare/statefulset_hostname-proxysql-oc.yml +++ b/e2e-tests/affinity/compare/statefulset_hostname-proxysql-oc.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-hostname + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostname-env-vars-proxysql @@ -115,6 +117,8 @@ spec: secretKeyRef: key: monitor name: internal-hostname + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostname-env-vars-proxysql @@ -148,6 +152,8 @@ spec: secretKeyRef: key: monitor name: internal-hostname + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostname-env-vars-proxysql diff --git a/e2e-tests/affinity/compare/statefulset_hostname-proxysql.yml b/e2e-tests/affinity/compare/statefulset_hostname-proxysql.yml index 1f8ecb256c..260e666e3a 100644 --- a/e2e-tests/affinity/compare/statefulset_hostname-proxysql.yml +++ b/e2e-tests/affinity/compare/statefulset_hostname-proxysql.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-hostname + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostname-env-vars-proxysql @@ -115,6 +117,8 @@ spec: secretKeyRef: key: monitor name: internal-hostname + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostname-env-vars-proxysql @@ -148,6 +152,8 @@ spec: secretKeyRef: key: monitor name: internal-hostname + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostname-env-vars-proxysql diff --git a/e2e-tests/affinity/compare/statefulset_region-proxysql-oc.yml b/e2e-tests/affinity/compare/statefulset_region-proxysql-oc.yml index dc0cf0409a..8a58f0f183 100644 --- a/e2e-tests/affinity/compare/statefulset_region-proxysql-oc.yml +++ b/e2e-tests/affinity/compare/statefulset_region-proxysql-oc.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-region + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: region-env-vars-proxysql @@ -115,6 +117,8 @@ spec: secretKeyRef: key: monitor name: internal-region + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: region-env-vars-proxysql @@ -148,6 +152,8 @@ spec: secretKeyRef: key: monitor name: internal-region + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: region-env-vars-proxysql diff --git a/e2e-tests/affinity/compare/statefulset_region-proxysql.yml b/e2e-tests/affinity/compare/statefulset_region-proxysql.yml index 974b4644a7..1d92b9037e 100644 --- a/e2e-tests/affinity/compare/statefulset_region-proxysql.yml +++ b/e2e-tests/affinity/compare/statefulset_region-proxysql.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-region + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: region-env-vars-proxysql @@ -115,6 +117,8 @@ spec: secretKeyRef: key: monitor name: internal-region + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: region-env-vars-proxysql @@ -148,6 +152,8 @@ spec: secretKeyRef: key: monitor name: internal-region + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: region-env-vars-proxysql diff --git a/e2e-tests/affinity/compare/statefulset_zone-proxysql-oc.yml b/e2e-tests/affinity/compare/statefulset_zone-proxysql-oc.yml index a9f930457e..8d2858b929 100644 --- a/e2e-tests/affinity/compare/statefulset_zone-proxysql-oc.yml +++ b/e2e-tests/affinity/compare/statefulset_zone-proxysql-oc.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-zone + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: zone-env-vars-proxysql @@ -115,6 +117,8 @@ spec: secretKeyRef: key: monitor name: internal-zone + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: zone-env-vars-proxysql @@ -148,6 +152,8 @@ spec: secretKeyRef: key: monitor name: internal-zone + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: zone-env-vars-proxysql diff --git a/e2e-tests/affinity/compare/statefulset_zone-proxysql.yml b/e2e-tests/affinity/compare/statefulset_zone-proxysql.yml index d78ea83cae..1f76b033d5 100644 --- a/e2e-tests/affinity/compare/statefulset_zone-proxysql.yml +++ b/e2e-tests/affinity/compare/statefulset_zone-proxysql.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-zone + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: zone-env-vars-proxysql @@ -115,6 +117,8 @@ spec: secretKeyRef: key: monitor name: internal-zone + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: zone-env-vars-proxysql @@ -148,6 +152,8 @@ spec: secretKeyRef: key: monitor name: internal-zone + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: zone-env-vars-proxysql diff --git a/e2e-tests/functions b/e2e-tests/functions index ecdc86ba68..cfc2ed22b1 100755 --- a/e2e-tests/functions +++ b/e2e-tests/functions @@ -541,12 +541,14 @@ compare_mysql_cmd_local() { get_proxy_primary() { local uri="$1" - local pod="$2" - local ip=$(run_mysql_local 'SELECT hostname FROM runtime_mysql_servers WHERE hostgroup_id=11 AND status="ONLINE";' "$uri" "$pod" 'proxysql') + local cluster_name="$2" + local hostgroup=11 + + local ip=$(run_mysql_local 'SELECT hostname FROM runtime_mysql_servers WHERE hostgroup_id='$hostgroup' AND status="ONLINE";' "$uri" "$cluster_name-proxysql-0" 'proxysql') while [ $(echo "$ip" | wc -l) != 1 ]; do sleep 1 - ip=$(run_mysql_local 'SELECT hostname FROM runtime_mysql_servers WHERE hostgroup_id=11 AND status="ONLINE";' "$uri" "$pod" 'proxysql') + ip=$(run_mysql_local 'SELECT hostname FROM runtime_mysql_servers WHERE hostgroup_id='$hostgroup' AND status="ONLINE";' "$uri" "$cluster_name-proxysql-0" 'proxysql') done echo $ip | cut -d'.' -f1 diff --git a/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-oc.yml b/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-oc.yml index 375322130d..c03f5f0bac 100644 --- a/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-oc.yml +++ b/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-oc.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql @@ -117,6 +119,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql @@ -150,6 +154,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql diff --git a/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-secret-oc.yml b/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-secret-oc.yml index 177841a5a7..7163edc751 100644 --- a/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-secret-oc.yml +++ b/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-secret-oc.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql @@ -117,6 +119,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql @@ -150,6 +154,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql diff --git a/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-secret.yml b/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-secret.yml index f097270d71..f879abf135 100644 --- a/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-secret.yml +++ b/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql-secret.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql @@ -117,6 +119,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql @@ -150,6 +154,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql diff --git a/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql.yml b/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql.yml index 403ab7e05b..89229accbf 100644 --- a/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql.yml +++ b/e2e-tests/haproxy/compare/statefulset_haproxy-proxysql.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql @@ -117,6 +119,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql @@ -150,6 +154,8 @@ spec: secretKeyRef: key: monitor name: internal-haproxy + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: haproxy-env-vars-proxysql diff --git a/e2e-tests/init-deploy/compare/statefulset_some-name-proxysql-oc.yml b/e2e-tests/init-deploy/compare/statefulset_some-name-proxysql-oc.yml index abb246871e..edfeee687e 100644 --- a/e2e-tests/init-deploy/compare/statefulset_some-name-proxysql-oc.yml +++ b/e2e-tests/init-deploy/compare/statefulset_some-name-proxysql-oc.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql @@ -115,6 +117,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql @@ -148,6 +152,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql diff --git a/e2e-tests/init-deploy/compare/statefulset_some-name-proxysql.yml b/e2e-tests/init-deploy/compare/statefulset_some-name-proxysql.yml index 3570d87677..84187fb6c4 100644 --- a/e2e-tests/init-deploy/compare/statefulset_some-name-proxysql.yml +++ b/e2e-tests/init-deploy/compare/statefulset_some-name-proxysql.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql @@ -115,6 +117,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql @@ -148,6 +152,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql diff --git a/e2e-tests/init-deploy/run b/e2e-tests/init-deploy/run index 8e23dd1945..28c18c7a72 100755 --- a/e2e-tests/init-deploy/run +++ b/e2e-tests/init-deploy/run @@ -56,10 +56,10 @@ compare_mysql_cmd "select-2" "SELECT * from myApp.myApp;" "-h $cluster-pxc-1.$cl compare_mysql_cmd "select-2" "SELECT * from myApp.myApp;" "-h $cluster-pxc-2.$cluster-pxc -uroot -proot_password" desc 'kill Primary Pod, check reelection, check data' -initial_primary=$(get_proxy_primary "-h127.0.0.1 -P6032 -uproxyadmin -padmin_password" "$cluster-proxysql-0") +initial_primary=$(get_proxy_primary "-h127.0.0.1 -P6032 -uproxyadmin -padmin_password" "$cluster") kubectl_bin delete pods --grace-period=0 --force $initial_primary sleep 10 -changed_primary=$(get_proxy_primary "-h127.0.0.1 -P6032 -uproxyadmin -padmin_password" "$cluster-proxysql-0") +changed_primary=$(get_proxy_primary "-h127.0.0.1 -P6032 -uproxyadmin -padmin_password" "$cluster") [ -n "$changed_primary" ] && [ "$initial_primary" != "$changed_primary" ] run_mysql \ 'INSERT myApp.myApp (id) VALUES (100502)' \ diff --git a/e2e-tests/limits/compare/statefulset_no-limits-proxysql-increased-oc.yml b/e2e-tests/limits/compare/statefulset_no-limits-proxysql-increased-oc.yml index 79fe1f148b..08da9f0f8f 100644 --- a/e2e-tests/limits/compare/statefulset_no-limits-proxysql-increased-oc.yml +++ b/e2e-tests/limits/compare/statefulset_no-limits-proxysql-increased-oc.yml @@ -183,6 +183,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql @@ -233,6 +235,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql @@ -266,6 +270,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql diff --git a/e2e-tests/limits/compare/statefulset_no-limits-proxysql-increased.yml b/e2e-tests/limits/compare/statefulset_no-limits-proxysql-increased.yml index 14e99c0cbd..da898728cd 100644 --- a/e2e-tests/limits/compare/statefulset_no-limits-proxysql-increased.yml +++ b/e2e-tests/limits/compare/statefulset_no-limits-proxysql-increased.yml @@ -183,6 +183,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql @@ -233,6 +235,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql @@ -266,6 +270,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql diff --git a/e2e-tests/limits/compare/statefulset_no-limits-proxysql-oc.yml b/e2e-tests/limits/compare/statefulset_no-limits-proxysql-oc.yml index 3db90be9f2..ad605d9854 100644 --- a/e2e-tests/limits/compare/statefulset_no-limits-proxysql-oc.yml +++ b/e2e-tests/limits/compare/statefulset_no-limits-proxysql-oc.yml @@ -183,6 +183,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql @@ -233,6 +235,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql @@ -266,6 +270,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql diff --git a/e2e-tests/limits/compare/statefulset_no-limits-proxysql.yml b/e2e-tests/limits/compare/statefulset_no-limits-proxysql.yml index a59107eafc..b3fb7a3ef5 100644 --- a/e2e-tests/limits/compare/statefulset_no-limits-proxysql.yml +++ b/e2e-tests/limits/compare/statefulset_no-limits-proxysql.yml @@ -183,6 +183,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql @@ -233,6 +235,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql @@ -266,6 +270,8 @@ spec: secretKeyRef: key: monitor name: internal-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-limits-env-vars-proxysql diff --git a/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-increased-oc.yml b/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-increased-oc.yml index 9460b0730e..5b067c1682 100644 --- a/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-increased-oc.yml +++ b/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-increased-oc.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql @@ -98,6 +100,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql @@ -131,6 +135,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql diff --git a/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-increased.yml b/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-increased.yml index aba49a6e56..cf654ed294 100644 --- a/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-increased.yml +++ b/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-increased.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql @@ -98,6 +100,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql @@ -131,6 +135,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql diff --git a/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-oc.yml b/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-oc.yml index 9460b0730e..5b067c1682 100644 --- a/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-oc.yml +++ b/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql-oc.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql @@ -98,6 +100,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql @@ -131,6 +135,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql diff --git a/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql.yml b/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql.yml index aba49a6e56..cf654ed294 100644 --- a/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql.yml +++ b/e2e-tests/limits/compare/statefulset_no-requests-no-limits-proxysql.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql @@ -98,6 +100,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql @@ -131,6 +135,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests-no-limits + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-no-limits-env-vars-proxysql diff --git a/e2e-tests/limits/compare/statefulset_no-requests-proxysql-increased-oc.yml b/e2e-tests/limits/compare/statefulset_no-requests-proxysql-increased-oc.yml index 79f8da6cc3..21c47dd3be 100644 --- a/e2e-tests/limits/compare/statefulset_no-requests-proxysql-increased-oc.yml +++ b/e2e-tests/limits/compare/statefulset_no-requests-proxysql-increased-oc.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql @@ -101,6 +103,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql @@ -134,6 +138,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql diff --git a/e2e-tests/limits/compare/statefulset_no-requests-proxysql-increased.yml b/e2e-tests/limits/compare/statefulset_no-requests-proxysql-increased.yml index 8f21f0c992..8b6677ac29 100644 --- a/e2e-tests/limits/compare/statefulset_no-requests-proxysql-increased.yml +++ b/e2e-tests/limits/compare/statefulset_no-requests-proxysql-increased.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql @@ -101,6 +103,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql @@ -134,6 +138,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql diff --git a/e2e-tests/limits/compare/statefulset_no-requests-proxysql-oc.yml b/e2e-tests/limits/compare/statefulset_no-requests-proxysql-oc.yml index 82299423ac..f701e9ff47 100644 --- a/e2e-tests/limits/compare/statefulset_no-requests-proxysql-oc.yml +++ b/e2e-tests/limits/compare/statefulset_no-requests-proxysql-oc.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql @@ -101,6 +103,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql @@ -134,6 +138,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql diff --git a/e2e-tests/limits/compare/statefulset_no-requests-proxysql.yml b/e2e-tests/limits/compare/statefulset_no-requests-proxysql.yml index f9f363fe7b..a10dfd0e20 100644 --- a/e2e-tests/limits/compare/statefulset_no-requests-proxysql.yml +++ b/e2e-tests/limits/compare/statefulset_no-requests-proxysql.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql @@ -101,6 +103,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql @@ -134,6 +138,8 @@ spec: secretKeyRef: key: monitor name: internal-no-requests + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: no-requests-env-vars-proxysql diff --git a/e2e-tests/proxysql-sidecar-res-limits/compare/statefulset_side-car-proxysql-oc.yml b/e2e-tests/proxysql-sidecar-res-limits/compare/statefulset_side-car-proxysql-oc.yml index 7695d49f55..ad8b016ac7 100644 --- a/e2e-tests/proxysql-sidecar-res-limits/compare/statefulset_side-car-proxysql-oc.yml +++ b/e2e-tests/proxysql-sidecar-res-limits/compare/statefulset_side-car-proxysql-oc.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-side-car + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: side-car-env-vars-proxysql @@ -101,6 +103,8 @@ spec: secretKeyRef: key: monitor name: internal-side-car + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: side-car-env-vars-proxysql @@ -140,6 +144,8 @@ spec: secretKeyRef: key: monitor name: internal-side-car + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: side-car-env-vars-proxysql diff --git a/e2e-tests/proxysql-sidecar-res-limits/compare/statefulset_side-car-proxysql.yml b/e2e-tests/proxysql-sidecar-res-limits/compare/statefulset_side-car-proxysql.yml index e6cd7ffc54..52eaeb40d9 100644 --- a/e2e-tests/proxysql-sidecar-res-limits/compare/statefulset_side-car-proxysql.yml +++ b/e2e-tests/proxysql-sidecar-res-limits/compare/statefulset_side-car-proxysql.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-side-car + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: side-car-env-vars-proxysql @@ -101,6 +103,8 @@ spec: secretKeyRef: key: monitor name: internal-side-car + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: side-car-env-vars-proxysql @@ -140,6 +144,8 @@ spec: secretKeyRef: key: monitor name: internal-side-car + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: side-car-env-vars-proxysql diff --git a/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes-4-oc.yml b/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes-4-oc.yml index b624081667..d1435bfbc7 100644 --- a/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes-4-oc.yml +++ b/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes-4-oc.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql @@ -103,6 +105,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql @@ -136,6 +140,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql diff --git a/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes-oc.yml b/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes-oc.yml index fac71f5452..fb6a6a8139 100644 --- a/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes-oc.yml +++ b/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes-oc.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql @@ -103,6 +105,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql @@ -136,6 +140,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql diff --git a/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes.yml b/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes.yml index b624081667..d1435bfbc7 100644 --- a/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes.yml +++ b/e2e-tests/security-context/compare/statefulset_sec-context-proxysql-changes.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql @@ -103,6 +105,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql @@ -136,6 +140,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql diff --git a/e2e-tests/security-context/compare/statefulset_sec-context-proxysql.yml b/e2e-tests/security-context/compare/statefulset_sec-context-proxysql.yml index 33bc9b66d1..48e624c157 100644 --- a/e2e-tests/security-context/compare/statefulset_sec-context-proxysql.yml +++ b/e2e-tests/security-context/compare/statefulset_sec-context-proxysql.yml @@ -51,6 +51,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql @@ -103,6 +105,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql @@ -136,6 +140,8 @@ spec: secretKeyRef: key: monitor name: internal-sec-context + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: sec-context-env-vars-proxysql diff --git a/e2e-tests/smart-update1/run b/e2e-tests/smart-update1/run index e81c8b8cae..f4a27661c0 100755 --- a/e2e-tests/smart-update1/run +++ b/e2e-tests/smart-update1/run @@ -91,7 +91,7 @@ function main() { yq -i eval ".spec.initImage = \"${IMAGE}\"" "${tmp_dir}/${CLUSTER}.yml" spinup_pxc "${CLUSTER}" "${tmp_dir}/${CLUSTER}.yml" - initial_primary=$(get_proxy_primary "-h127.0.0.1 -P6032 -uproxyadmin -padmin_password" "$(get_proxy ${CLUSTER})-0") + initial_primary=$(get_proxy_primary "-h127.0.0.1 -P6032 -uproxyadmin -padmin_password" "${CLUSTER}") kubectl_bin patch pxc/"${CLUSTER}" --type=merge -p '{"spec":{"pxc":{"image":"'"${TARGET_IMAGE_PXC}"'"}}}' sleep 7 # wait for two reconcile loops ;) 3 sec x 2 times + 1 sec = 7 seconds diff --git a/e2e-tests/storage/compare/statefulset_emptydir-proxysql-oc.yml b/e2e-tests/storage/compare/statefulset_emptydir-proxysql-oc.yml index 0d047f87b3..d0c60a6248 100644 --- a/e2e-tests/storage/compare/statefulset_emptydir-proxysql-oc.yml +++ b/e2e-tests/storage/compare/statefulset_emptydir-proxysql-oc.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-emptydir + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: emptydir-env-vars-proxysql @@ -111,6 +113,8 @@ spec: secretKeyRef: key: monitor name: internal-emptydir + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: emptydir-env-vars-proxysql @@ -144,6 +148,8 @@ spec: secretKeyRef: key: monitor name: internal-emptydir + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: emptydir-env-vars-proxysql diff --git a/e2e-tests/storage/compare/statefulset_emptydir-proxysql.yml b/e2e-tests/storage/compare/statefulset_emptydir-proxysql.yml index 0deeadd1ec..a3d832f3f6 100644 --- a/e2e-tests/storage/compare/statefulset_emptydir-proxysql.yml +++ b/e2e-tests/storage/compare/statefulset_emptydir-proxysql.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-emptydir + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: emptydir-env-vars-proxysql @@ -111,6 +113,8 @@ spec: secretKeyRef: key: monitor name: internal-emptydir + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: emptydir-env-vars-proxysql @@ -144,6 +148,8 @@ spec: secretKeyRef: key: monitor name: internal-emptydir + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: emptydir-env-vars-proxysql diff --git a/e2e-tests/storage/compare/statefulset_hostpath-proxysql-oc.yml b/e2e-tests/storage/compare/statefulset_hostpath-proxysql-oc.yml index 258c4e430e..fbf2cb7afa 100644 --- a/e2e-tests/storage/compare/statefulset_hostpath-proxysql-oc.yml +++ b/e2e-tests/storage/compare/statefulset_hostpath-proxysql-oc.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-hostpath + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostpath-env-vars-proxysql @@ -109,6 +111,8 @@ spec: secretKeyRef: key: monitor name: internal-hostpath + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostpath-env-vars-proxysql @@ -142,6 +146,8 @@ spec: secretKeyRef: key: monitor name: internal-hostpath + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostpath-env-vars-proxysql diff --git a/e2e-tests/storage/compare/statefulset_hostpath-proxysql.yml b/e2e-tests/storage/compare/statefulset_hostpath-proxysql.yml index b15c439df0..ea0b20eeb9 100644 --- a/e2e-tests/storage/compare/statefulset_hostpath-proxysql.yml +++ b/e2e-tests/storage/compare/statefulset_hostpath-proxysql.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-hostpath + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostpath-env-vars-proxysql @@ -109,6 +111,8 @@ spec: secretKeyRef: key: monitor name: internal-hostpath + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostpath-env-vars-proxysql @@ -142,6 +146,8 @@ spec: secretKeyRef: key: monitor name: internal-hostpath + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: hostpath-env-vars-proxysql diff --git a/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120-oc.yml b/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120-oc.yml index abb246871e..edfeee687e 100644 --- a/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120-oc.yml +++ b/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120-oc.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql @@ -115,6 +117,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql @@ -148,6 +152,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql diff --git a/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120.yml b/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120.yml index 3570d87677..a937c33885 100644 --- a/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120.yml +++ b/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: annotations: {} - generation: 1 + generation: 3 name: some-name-proxysql ownerReferences: - controller: true @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql @@ -115,6 +117,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql @@ -148,6 +152,8 @@ spec: secretKeyRef: key: monitor name: internal-some-name + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql diff --git a/e2e-tests/upgrade-proxysql/compare/statefulset_upgrade-proxysql-proxysql-oc.yml b/e2e-tests/upgrade-proxysql/compare/statefulset_upgrade-proxysql-proxysql-oc.yml index 211c8d2f34..ad8a27a345 100644 --- a/e2e-tests/upgrade-proxysql/compare/statefulset_upgrade-proxysql-proxysql-oc.yml +++ b/e2e-tests/upgrade-proxysql/compare/statefulset_upgrade-proxysql-proxysql-oc.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-upgrade-proxysql + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: upgrade-proxysql-env-vars-proxysql @@ -112,6 +114,8 @@ spec: secretKeyRef: key: monitor name: internal-upgrade-proxysql + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: upgrade-proxysql-env-vars-proxysql @@ -145,6 +149,8 @@ spec: secretKeyRef: key: monitor name: internal-upgrade-proxysql + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: upgrade-proxysql-env-vars-proxysql diff --git a/e2e-tests/upgrade-proxysql/compare/statefulset_upgrade-proxysql-proxysql.yml b/e2e-tests/upgrade-proxysql/compare/statefulset_upgrade-proxysql-proxysql.yml index 0c05b2d209..1d76ebc2c2 100644 --- a/e2e-tests/upgrade-proxysql/compare/statefulset_upgrade-proxysql-proxysql.yml +++ b/e2e-tests/upgrade-proxysql/compare/statefulset_upgrade-proxysql-proxysql.yml @@ -62,6 +62,8 @@ spec: secretKeyRef: key: monitor name: internal-upgrade-proxysql + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: upgrade-proxysql-env-vars-proxysql @@ -112,6 +114,8 @@ spec: secretKeyRef: key: monitor name: internal-upgrade-proxysql + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: upgrade-proxysql-env-vars-proxysql @@ -145,6 +149,8 @@ spec: secretKeyRef: key: monitor name: internal-upgrade-proxysql + - name: PXC_HANDLER + value: internal envFrom: - secretRef: name: upgrade-proxysql-env-vars-proxysql diff --git a/pkg/apis/pxc/v1/pxc_types.go b/pkg/apis/pxc/v1/pxc_types.go index 2aeb697856..9eb5d85a03 100644 --- a/pkg/apis/pxc/v1/pxc_types.go +++ b/pkg/apis/pxc/v1/pxc_types.go @@ -33,7 +33,7 @@ type PerconaXtraDBClusterSpec struct { LogCollectorSecretName string `json:"logCollectorSecretName,omitempty"` TLS *TLSSpec `json:"tls,omitempty"` PXC *PXCSpec `json:"pxc,omitempty"` - ProxySQL *PodSpec `json:"proxysql,omitempty"` + ProxySQL *ProxySQLSpec `json:"proxysql,omitempty"` HAProxy *HAProxySpec `json:"haproxy,omitempty"` PMM *PMMSpec `json:"pmm,omitempty"` LogCollector *LogCollectorSpec `json:"logcollector,omitempty"` @@ -433,6 +433,12 @@ type HAProxySpec struct { ReplicasLoadBalancerIP string `json:"replicasLoadBalancerIP,omitempty"` } +type ProxySQLSpec struct { + PodSpec `json:",inline"` + // +kubebuilder:validation:Enum={internal,scheduler} + PXCHandler string `json:"pxchandler,omitempty"` +} + type PodDisruptionBudgetSpec struct { MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"` MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` @@ -804,6 +810,10 @@ func (cr *PerconaXtraDBCluster) CheckNSetDefaults(serverVersion *version.ServerV c.ProxySQL.ImagePullPolicy = corev1.PullAlways } + if cr.CompareVersionWith("1.12.0") >= 0 && len(c.ProxySQL.PXCHandler) == 0 { + c.ProxySQL.PXCHandler = "internal" + } + c.ProxySQL.VolumeSpec.reconcileOpts() if len(c.SSLSecretName) > 0 { diff --git a/pkg/apis/pxc/v1/zz_generated.deepcopy.go b/pkg/apis/pxc/v1/zz_generated.deepcopy.go index 22651545b3..7aba040878 100644 --- a/pkg/apis/pxc/v1/zz_generated.deepcopy.go +++ b/pkg/apis/pxc/v1/zz_generated.deepcopy.go @@ -689,7 +689,7 @@ func (in *PerconaXtraDBClusterSpec) DeepCopyInto(out *PerconaXtraDBClusterSpec) } if in.ProxySQL != nil { in, out := &in.ProxySQL, &out.ProxySQL - *out = new(PodSpec) + *out = new(ProxySQLSpec) (*in).DeepCopyInto(*out) } if in.HAProxy != nil { @@ -979,6 +979,22 @@ func (in *PodSpec) DeepCopy() *PodSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxySQLSpec) DeepCopyInto(out *ProxySQLSpec) { + *out = *in + in.PodSpec.DeepCopyInto(&out.PodSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxySQLSpec. +func (in *ProxySQLSpec) DeepCopy() *ProxySQLSpec { + if in == nil { + return nil + } + out := new(ProxySQLSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ReplicationChannel) DeepCopyInto(out *ReplicationChannel) { *out = *in diff --git a/pkg/controller/pxc/controller.go b/pkg/controller/pxc/controller.go index 6d58066fb3..23ae666e45 100644 --- a/pkg/controller/pxc/controller.go +++ b/pkg/controller/pxc/controller.go @@ -366,7 +366,7 @@ func (r *ReconcilePerconaXtraDBCluster) Reconcile(ctx context.Context, request r pxc.MergeTemplateAnnotations(proxysqlSet.StatefulSet(), userReconcileResult.proxyAnnotations) if o.Spec.ProxySQLEnabled() { - err = r.updatePod(ctx, proxysqlSet, o.Spec.ProxySQL, o, nil) + err = r.updatePod(ctx, proxysqlSet, &o.Spec.ProxySQL.PodSpec, o, nil) if err != nil { return reconcile.Result{}, errors.Wrap(err, "ProxySQL upgrade error") } @@ -680,7 +680,7 @@ func (r *ReconcilePerconaXtraDBCluster) deploy(ctx context.Context, cr *api.Perc if cr.Spec.ProxySQLEnabled() { sfsProxy := statefulset.NewProxy(cr) - proxySet, err := pxc.StatefulSet(sfsProxy, cr.Spec.ProxySQL, cr, secrets, nil, log, r.getConfigVolume) + proxySet, err := pxc.StatefulSet(sfsProxy, &cr.Spec.ProxySQL.PodSpec, cr, secrets, nil, logf.FromContext(ctx), r.getConfigVolume) if err != nil { return errors.Wrap(err, "create ProxySQL Service") } diff --git a/pkg/controller/pxc/status.go b/pkg/controller/pxc/status.go index d49fb311b1..9a96578173 100644 --- a/pkg/controller/pxc/status.go +++ b/pkg/controller/pxc/status.go @@ -83,7 +83,7 @@ func (r *ReconcilePerconaXtraDBCluster) updateStatus(cr *api.PerconaXtraDBCluste apps = append(apps, sfsstatus{ app: statefulset.NewProxy(cr), status: &cr.Status.ProxySQL, - spec: cr.Spec.ProxySQL, + spec: &cr.Spec.ProxySQL.PodSpec, }) } diff --git a/pkg/controller/pxc/status_test.go b/pkg/controller/pxc/status_test.go index 9c525b9b55..c98cac9f42 100644 --- a/pkg/controller/pxc/status_test.go +++ b/pkg/controller/pxc/status_test.go @@ -49,8 +49,10 @@ func newCR(name, namespace string) *api.PerconaXtraDBCluster { Size: 3, }, }, - ProxySQL: &api.PodSpec{ - Enabled: false, + ProxySQL: &api.ProxySQLSpec{ + PodSpec: api.PodSpec{ + Enabled: false, + }, }, }, Status: api.PerconaXtraDBClusterStatus{}, diff --git a/pkg/controller/pxc/upgrade.go b/pkg/controller/pxc/upgrade.go index 37a50014de..4bca020fff 100644 --- a/pkg/controller/pxc/upgrade.go +++ b/pkg/controller/pxc/upgrade.go @@ -355,8 +355,10 @@ func (r *ReconcilePerconaXtraDBCluster) applyNWait(ctx context.Context, cr *api. return errors.Wrap(err, "failed to wait pxc sync") } - if err := r.waitHostgroups(ctx, cr, sfs.Name, pod, waitLimit); err != nil { - return errors.Wrap(err, "failed to wait hostgroups status") + if cr.Spec.ProxySQL.PXCHandler == "internal" { + if err := r.waitHostgroups(ctx, cr, sfs.Name, pod, waitLimit); err != nil { + return errors.Wrap(err, "failed to wait hostgroups status") + } } if err := r.waitUntilOnline(ctx, cr, sfs.Name, pod, waitLimit); err != nil { diff --git a/pkg/controller/pxc/users.go b/pkg/controller/pxc/users.go index db2f997f00..f457dcbb44 100644 --- a/pkg/controller/pxc/users.go +++ b/pkg/controller/pxc/users.go @@ -965,7 +965,11 @@ func (r *ReconcilePerconaXtraDBCluster) syncPXCUsersWithProxySQL(ctx context.Con return errors.Wrap(err, "get proxysql pod") } var errb, outb bytes.Buffer - err = r.clientcmd.Exec(&pod, "proxysql", []string{"proxysql-admin", "--syncusers", "--add-query-rule"}, nil, &outb, &errb, false) + if cr.Spec.ProxySQL.PXCHandler == "percona" { + err = r.clientcmd.Exec(&pod, "proxysql", []string{"percona-scheduler-admin", "--config-file=/etc/config.toml", "--syncusers", "--add-query-rule"}, nil, &outb, &errb, false) + } else { + err = r.clientcmd.Exec(&pod, "proxysql", []string{"proxysql-admin", "--syncusers", "--add-query-rule"}, nil, &outb, &errb, false) + } if err != nil { return errors.Errorf("exec syncusers: %v / %s / %s", err, outb.String(), errb.String()) } diff --git a/pkg/pxc/app/statefulset/proxysql.go b/pkg/pxc/app/statefulset/proxysql.go index d473bb0fad..dc32319bda 100644 --- a/pkg/pxc/app/statefulset/proxysql.go +++ b/pkg/pxc/app/statefulset/proxysql.go @@ -145,6 +145,13 @@ func (c *Proxy) AppContainer(spec *api.PodSpec, secrets string, cr *api.PerconaX } } + if cr.CompareVersionWith("1.12.0") >= 0 { + appc.Env = append(appc.Env, corev1.EnvVar{ + Name: "PXC_HANDLER", + Value: cr.Spec.ProxySQL.PXCHandler, + }) + } + if cr.CompareVersionWith("1.11.0") >= 0 && cr.Spec.ProxySQL != nil && cr.Spec.ProxySQL.HookScript != "" { appc.VolumeMounts = append(appc.VolumeMounts, corev1.VolumeMount{ Name: "hookscript", @@ -234,6 +241,30 @@ func (c *Proxy) SidecarContainers(spec *api.PodSpec, secrets string, cr *api.Per }, }, } + + if cr.CompareVersionWith("1.12.0") >= 0 { + pxcMonit.Env = append(pxcMonit.Env, corev1.EnvVar{ + Name: "PXC_HANDLER", + Value: cr.Spec.ProxySQL.PXCHandler, + }) + proxysqlMonit.Env = append(proxysqlMonit.Env, corev1.EnvVar{ + Name: "PXC_HANDLER", + Value: cr.Spec.ProxySQL.PXCHandler, + }) + if cr.Spec.ProxySQL.PXCHandler == "scheduler" { + volMounts := []corev1.VolumeMount{ + { + Name: "ssl", + MountPath: "/etc/proxysql/ssl", + }, + { + Name: "ssl-internal", + MountPath: "/etc/proxysql/ssl-internal", + }, + } + pxcMonit.VolumeMounts = volMounts + } + } if cr.Spec.AllowUnsafeConfig && (cr.Spec.TLS == nil || cr.Spec.TLS.IssuerConf == nil) { pxcMonit.Env = append(pxcMonit.Env, corev1.EnvVar{ Name: "SSL_DIR", From bddcc852fd130e4813af50112526e33593f6d29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20G=C3=BCne=C5=9F?= Date: Fri, 12 May 2023 13:16:04 +0300 Subject: [PATCH 2/7] fix syncusers --- pkg/controller/pxc/users.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/pxc/users.go b/pkg/controller/pxc/users.go index f457dcbb44..3f2cb346c8 100644 --- a/pkg/controller/pxc/users.go +++ b/pkg/controller/pxc/users.go @@ -965,7 +965,7 @@ func (r *ReconcilePerconaXtraDBCluster) syncPXCUsersWithProxySQL(ctx context.Con return errors.Wrap(err, "get proxysql pod") } var errb, outb bytes.Buffer - if cr.Spec.ProxySQL.PXCHandler == "percona" { + if cr.Spec.ProxySQL.PXCHandler == "scheduler" { err = r.clientcmd.Exec(&pod, "proxysql", []string{"percona-scheduler-admin", "--config-file=/etc/config.toml", "--syncusers", "--add-query-rule"}, nil, &outb, &errb, false) } else { err = r.clientcmd.Exec(&pod, "proxysql", []string{"proxysql-admin", "--syncusers", "--add-query-rule"}, nil, &outb, &errb, false) From 2fe51f1fec7e915e3997e980af5af22c24f20e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20G=C3=BCne=C5=9F?= Date: Wed, 14 Jun 2023 10:46:12 +0300 Subject: [PATCH 3/7] run syncusers only on server has the lock --- pkg/controller/pxc/users.go | 25 +++++++++++++++++++++++++ pkg/pxc/queries/queries.go | 17 +++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/pkg/controller/pxc/users.go b/pkg/controller/pxc/users.go index cd23c45a82..1029fe1310 100644 --- a/pkg/controller/pxc/users.go +++ b/pkg/controller/pxc/users.go @@ -20,6 +20,7 @@ import ( api "github.com/percona/percona-xtradb-cluster-operator/pkg/apis/pxc/v1" "github.com/percona/percona-xtradb-cluster-operator/pkg/pxc/app/statefulset" + "github.com/percona/percona-xtradb-cluster-operator/pkg/pxc/queries" "github.com/percona/percona-xtradb-cluster-operator/pkg/pxc/users" ) @@ -992,8 +993,32 @@ func (r *ReconcilePerconaXtraDBCluster) syncPXCUsersWithProxySQL(ctx context.Con } else if err != nil { return errors.Wrap(err, "get proxysql pod") } + var errb, outb bytes.Buffer if cr.Spec.ProxySQL.PXCHandler == "scheduler" { + var db queries.Database + var hasLock bool + + if !isPodReady(pod) { + continue + } + + host := fmt.Sprintf("%s.%s.%s.svc", pod.Name, cr.Name+"-proxysql-unready", cr.Namespace) + db, err = queries.New(r.client, cr.Namespace, cr.Spec.SecretsName, users.ProxyAdmin, host, int32(6032), cr.Spec.ProxySQL.ReadinessProbes.TimeoutSeconds) + if err != nil { + return errors.Wrapf(err, "connect to %s", pod.Name) + } + + hasLock, err = db.ProxySQLServerHasLock(host) + if err != nil { + return errors.Wrap(err, "check if proxysql server has lock") + } + + if !hasLock { + continue + } + + log.V(1).Info("Syncing users", "pod", pod.Name) err = r.clientcmd.Exec(&pod, "proxysql", []string{"percona-scheduler-admin", "--config-file=/etc/config.toml", "--syncusers", "--add-query-rule"}, nil, &outb, &errb, false) } else { err = r.clientcmd.Exec(&pod, "proxysql", []string{"proxysql-admin", "--syncusers", "--add-query-rule"}, nil, &outb, &errb, false) diff --git a/pkg/pxc/queries/queries.go b/pkg/pxc/queries/queries.go index 59c5aaa817..9782517ceb 100644 --- a/pkg/pxc/queries/queries.go +++ b/pkg/pxc/queries/queries.go @@ -392,3 +392,20 @@ func (p *Database) Version() (string, error) { func (p *Database) Close() error { return p.db.Close() } + +func (p *Database) ProxySQLServerHasLock(host string) (bool, error) { + var comment string + err := p.db.QueryRow("SELECT comment FROM proxysql_servers WHERE hostname LIKE ?", host+"%").Scan(&comment) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return false, nil + } + return false, err + } + + if len(comment) > 0 { + return true, nil + } + + return false, nil +} From f10763c146897ec4d31855672f814cc3f76915fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20G=C3=BCne=C5=9F?= Date: Wed, 14 Jun 2023 11:21:30 +0300 Subject: [PATCH 4/7] add telemetry for scheduler --- pkg/controller/pxc/version.go | 6 + pkg/controller/pxc/vs.go | 2 + version/client/models/googlerpc_status.go | 38 +- version/client/models/protobuf_any.go | 102 ++- .../models/version_operator_response.go | 38 +- .../client/models/version_operator_version.go | 35 +- .../client/models/version_product_response.go | 38 +- version/client/models/version_status.go | 15 - version/client/models/version_version.go | 47 +- .../client/models/version_version_matrix.go | 638 ++---------------- .../client/models/version_version_response.go | 38 +- .../version_service_apply_parameters.go | 397 ++++++++--- .../version_service_apply_responses.go | 8 +- .../version_service/version_service_client.go | 57 +- .../version_service_operator_parameters.go | 394 ++++++++--- .../version_service_operator_responses.go | 8 +- .../version_service_product_parameters.go | 391 ++++++++--- .../version_service_product_responses.go | 8 +- 18 files changed, 1049 insertions(+), 1211 deletions(-) diff --git a/pkg/controller/pxc/version.go b/pkg/controller/pxc/version.go index 434c67274c..9b557fff9c 100644 --- a/pkg/controller/pxc/version.go +++ b/pkg/controller/pxc/version.go @@ -137,6 +137,11 @@ func (r *ReconcilePerconaXtraDBCluster) ensurePXCVersion(ctx context.Context, cr return errors.Wrap(err, "get WATCH_NAMESPACE env variable") } + var scheduler string + if cr.Spec.ProxySQLEnabled() { + scheduler = cr.Spec.ProxySQL.PXCHandler + } + vm := versionMeta{ Apply: cr.Spec.UpgradeOptions.Apply, Platform: string(cr.Spec.Platform), @@ -149,6 +154,7 @@ func (r *ReconcilePerconaXtraDBCluster) ensurePXCVersion(ctx context.Context, cr LogCollectorVersion: cr.Status.LogCollector.Version, CRUID: string(cr.GetUID()), ClusterWideEnabled: watchNs == "", + ProxySQLScheduler: scheduler, } if telemetryEnabled() && (!versionUpgradeEnabled(cr) || cr.Spec.UpgradeOptions.VersionServiceEndpoint != apiv1.GetDefaultVersionServiceEndpoint()) { diff --git a/pkg/controller/pxc/vs.go b/pkg/controller/pxc/vs.go index 8356b917ee..1e1e866bcf 100644 --- a/pkg/controller/pxc/vs.go +++ b/pkg/controller/pxc/vs.go @@ -46,6 +46,7 @@ func (vs VersionServiceClient) GetExactVersion(cr *api.PerconaXtraDBCluster, end ProxysqlVersion: &vm.ProxySQLVersion, Context: nil, ClusterWideEnabled: &vm.ClusterWideEnabled, + ProxysqlScheduler: &vm.ProxySQLScheduler, HTTPClient: &http.Client{Timeout: 10 * time.Second}, } applyParams = applyParams.WithTimeout(10 * time.Second) @@ -162,4 +163,5 @@ type versionMeta struct { LogCollectorVersion string CRUID string ClusterWideEnabled bool + ProxySQLScheduler string } diff --git a/version/client/models/googlerpc_status.go b/version/client/models/googlerpc_status.go index dc0414ab10..a300412cd8 100644 --- a/version/client/models/googlerpc_status.go +++ b/version/client/models/googlerpc_status.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -44,6 +43,7 @@ func (m *GooglerpcStatus) Validate(formats strfmt.Registry) error { } func (m *GooglerpcStatus) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(m.Details) { // not required return nil } @@ -57,42 +57,6 @@ func (m *GooglerpcStatus) validateDetails(formats strfmt.Registry) error { if err := m.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this googlerpc status based on the context it is used -func (m *GooglerpcStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GooglerpcStatus) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Details); i++ { - - if m.Details[i] != nil { - if err := m.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("details" + "." + strconv.Itoa(i)) } return err } diff --git a/version/client/models/protobuf_any.go b/version/client/models/protobuf_any.go index 4454016000..b5291652a3 100644 --- a/version/client/models/protobuf_any.go +++ b/version/client/models/protobuf_any.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -20,42 +18,42 @@ import ( // // Example 1: Pack and unpack a message in C++. // -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } // // Example 2: Pack and unpack a message in Java. // -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := ptypes.MarshalAny(foo) -// ... -// foo := &pb.Foo{} -// if err := ptypes.UnmarshalAny(any, foo); err != nil { -// ... -// } +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := ptypes.MarshalAny(foo) +// ... +// foo := &pb.Foo{} +// if err := ptypes.UnmarshalAny(any, foo); err != nil { +// ... +// } // // The pack methods provided by protobuf library will by default use // 'type.googleapis.com/full.type.name' as the type URL and the unpack @@ -63,33 +61,34 @@ import ( // in the type URL, for example "foo.bar.com/x/y.z" will yield type // name "y.z". // +// // JSON // ==== // The JSON representation of an `Any` value uses the regular // representation of the deserialized, embedded message, with an // additional field `@type` which contains the type URL. Example: // -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } // -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } // // If the embedded message type is well-known and has a custom JSON // representation, that representation will be embedded adding a field // `value` which holds the custom JSON in addition to the `@type` // field. Example (for message [google.protobuf.Duration][]): // -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } // // swagger:model protobufAny type ProtobufAny struct { @@ -133,11 +132,6 @@ func (m *ProtobufAny) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this protobuf any based on context it is used -func (m *ProtobufAny) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *ProtobufAny) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/version/client/models/version_operator_response.go b/version/client/models/version_operator_response.go index 6ff2150269..3767eedf5f 100644 --- a/version/client/models/version_operator_response.go +++ b/version/client/models/version_operator_response.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -38,6 +37,7 @@ func (m *VersionOperatorResponse) Validate(formats strfmt.Registry) error { } func (m *VersionOperatorResponse) validateVersions(formats strfmt.Registry) error { + if swag.IsZero(m.Versions) { // not required return nil } @@ -51,42 +51,6 @@ func (m *VersionOperatorResponse) validateVersions(formats strfmt.Registry) erro if err := m.Versions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("versions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("versions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this version operator response based on the context it is used -func (m *VersionOperatorResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVersions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VersionOperatorResponse) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Versions); i++ { - - if m.Versions[i] != nil { - if err := m.Versions[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("versions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("versions" + "." + strconv.Itoa(i)) } return err } diff --git a/version/client/models/version_operator_version.go b/version/client/models/version_operator_version.go index 7eedb8de94..917be8c57c 100644 --- a/version/client/models/version_operator_version.go +++ b/version/client/models/version_operator_version.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -43,6 +41,7 @@ func (m *VersionOperatorVersion) Validate(formats strfmt.Registry) error { } func (m *VersionOperatorVersion) validateMatrix(formats strfmt.Registry) error { + if swag.IsZero(m.Matrix) { // not required return nil } @@ -51,38 +50,6 @@ func (m *VersionOperatorVersion) validateMatrix(formats strfmt.Registry) error { if err := m.Matrix.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("matrix") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("matrix") - } - return err - } - } - - return nil -} - -// ContextValidate validate this version operator version based on the context it is used -func (m *VersionOperatorVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMatrix(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VersionOperatorVersion) contextValidateMatrix(ctx context.Context, formats strfmt.Registry) error { - - if m.Matrix != nil { - if err := m.Matrix.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("matrix") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("matrix") } return err } diff --git a/version/client/models/version_product_response.go b/version/client/models/version_product_response.go index 77ff32d0f4..3e88dc5e1a 100644 --- a/version/client/models/version_product_response.go +++ b/version/client/models/version_product_response.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -38,6 +37,7 @@ func (m *VersionProductResponse) Validate(formats strfmt.Registry) error { } func (m *VersionProductResponse) validateVersions(formats strfmt.Registry) error { + if swag.IsZero(m.Versions) { // not required return nil } @@ -51,42 +51,6 @@ func (m *VersionProductResponse) validateVersions(formats strfmt.Registry) error if err := m.Versions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("versions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("versions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this version product response based on the context it is used -func (m *VersionProductResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVersions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VersionProductResponse) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Versions); i++ { - - if m.Versions[i] != nil { - if err := m.Versions[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("versions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("versions" + "." + strconv.Itoa(i)) } return err } diff --git a/version/client/models/version_status.go b/version/client/models/version_status.go index 7c00ffc189..1e290c272a 100644 --- a/version/client/models/version_status.go +++ b/version/client/models/version_status.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "encoding/json" "github.com/go-openapi/errors" @@ -19,15 +18,6 @@ import ( // swagger:model versionStatus type VersionStatus string -func NewVersionStatus(value VersionStatus) *VersionStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated VersionStatus. -func (m VersionStatus) Pointer() *VersionStatus { - return &m -} - const ( // VersionStatusStatusInvalid captures enum value "status_invalid" @@ -80,8 +70,3 @@ func (m VersionStatus) Validate(formats strfmt.Registry) error { } return nil } - -// ContextValidate validates this version status based on context it is used -func (m VersionStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/version/client/models/version_version.go b/version/client/models/version_version.go index f102929268..9c44b68af9 100644 --- a/version/client/models/version_version.go +++ b/version/client/models/version_version.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -28,7 +26,7 @@ type VersionVersion struct { ImagePath string `json:"imagePath,omitempty"` // status - Status *VersionStatus `json:"status,omitempty"` + Status VersionStatus `json:"status,omitempty"` } // Validate validates this version version @@ -46,49 +44,16 @@ func (m *VersionVersion) Validate(formats strfmt.Registry) error { } func (m *VersionVersion) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required return nil } - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -// ContextValidate validate this version version based on the context it is used -func (m *VersionVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VersionVersion) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") } + return err } return nil diff --git a/version/client/models/version_version_matrix.go b/version/client/models/version_version_matrix.go index 7f59def8ff..470ede1306 100644 --- a/version/client/models/version_version_matrix.go +++ b/version/client/models/version_version_matrix.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -93,6 +91,9 @@ type VersionVersionMatrix struct { // router Router map[string]VersionVersion `json:"router,omitempty"` + + // toolkit + Toolkit map[string]VersionVersion `json:"toolkit,omitempty"` } // Validate validates this version version matrix @@ -199,6 +200,10 @@ func (m *VersionVersionMatrix) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateToolkit(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -206,6 +211,7 @@ func (m *VersionVersionMatrix) Validate(formats strfmt.Registry) error { } func (m *VersionVersionMatrix) validateBackup(formats strfmt.Registry) error { + if swag.IsZero(m.Backup) { // not required return nil } @@ -217,11 +223,6 @@ func (m *VersionVersionMatrix) validateBackup(formats strfmt.Registry) error { } if val, ok := m.Backup[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup" + "." + k) - } return err } } @@ -232,6 +233,7 @@ func (m *VersionVersionMatrix) validateBackup(formats strfmt.Registry) error { } func (m *VersionVersionMatrix) validateHaproxy(formats strfmt.Registry) error { + if swag.IsZero(m.Haproxy) { // not required return nil } @@ -243,11 +245,6 @@ func (m *VersionVersionMatrix) validateHaproxy(formats strfmt.Registry) error { } if val, ok := m.Haproxy[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("haproxy" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("haproxy" + "." + k) - } return err } } @@ -258,6 +255,7 @@ func (m *VersionVersionMatrix) validateHaproxy(formats strfmt.Registry) error { } func (m *VersionVersionMatrix) validateLogCollector(formats strfmt.Registry) error { + if swag.IsZero(m.LogCollector) { // not required return nil } @@ -269,11 +267,6 @@ func (m *VersionVersionMatrix) validateLogCollector(formats strfmt.Registry) err } if val, ok := m.LogCollector[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logCollector" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("logCollector" + "." + k) - } return err } } @@ -284,6 +277,7 @@ func (m *VersionVersionMatrix) validateLogCollector(formats strfmt.Registry) err } func (m *VersionVersionMatrix) validateMongod(formats strfmt.Registry) error { + if swag.IsZero(m.Mongod) { // not required return nil } @@ -295,11 +289,6 @@ func (m *VersionVersionMatrix) validateMongod(formats strfmt.Registry) error { } if val, ok := m.Mongod[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mongod" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mongod" + "." + k) - } return err } } @@ -310,6 +299,7 @@ func (m *VersionVersionMatrix) validateMongod(formats strfmt.Registry) error { } func (m *VersionVersionMatrix) validateMysql(formats strfmt.Registry) error { + if swag.IsZero(m.Mysql) { // not required return nil } @@ -321,11 +311,6 @@ func (m *VersionVersionMatrix) validateMysql(formats strfmt.Registry) error { } if val, ok := m.Mysql[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mysql" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mysql" + "." + k) - } return err } } @@ -336,6 +321,7 @@ func (m *VersionVersionMatrix) validateMysql(formats strfmt.Registry) error { } func (m *VersionVersionMatrix) validateOperator(formats strfmt.Registry) error { + if swag.IsZero(m.Operator) { // not required return nil } @@ -347,11 +333,6 @@ func (m *VersionVersionMatrix) validateOperator(formats strfmt.Registry) error { } if val, ok := m.Operator[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operator" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operator" + "." + k) - } return err } } @@ -362,6 +343,7 @@ func (m *VersionVersionMatrix) validateOperator(formats strfmt.Registry) error { } func (m *VersionVersionMatrix) validateOrchestrator(formats strfmt.Registry) error { + if swag.IsZero(m.Orchestrator) { // not required return nil } @@ -373,11 +355,6 @@ func (m *VersionVersionMatrix) validateOrchestrator(formats strfmt.Registry) err } if val, ok := m.Orchestrator[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orchestrator" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orchestrator" + "." + k) - } return err } } @@ -388,6 +365,7 @@ func (m *VersionVersionMatrix) validateOrchestrator(formats strfmt.Registry) err } func (m *VersionVersionMatrix) validatePgOperator(formats strfmt.Registry) error { + if swag.IsZero(m.PgOperator) { // not required return nil } @@ -399,11 +377,6 @@ func (m *VersionVersionMatrix) validatePgOperator(formats strfmt.Registry) error } if val, ok := m.PgOperator[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pgOperator" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pgOperator" + "." + k) - } return err } } @@ -414,6 +387,7 @@ func (m *VersionVersionMatrix) validatePgOperator(formats strfmt.Registry) error } func (m *VersionVersionMatrix) validatePgOperatorApiserver(formats strfmt.Registry) error { + if swag.IsZero(m.PgOperatorApiserver) { // not required return nil } @@ -425,11 +399,6 @@ func (m *VersionVersionMatrix) validatePgOperatorApiserver(formats strfmt.Regist } if val, ok := m.PgOperatorApiserver[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pgOperatorApiserver" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pgOperatorApiserver" + "." + k) - } return err } } @@ -440,6 +409,7 @@ func (m *VersionVersionMatrix) validatePgOperatorApiserver(formats strfmt.Regist } func (m *VersionVersionMatrix) validatePgOperatorDeployer(formats strfmt.Registry) error { + if swag.IsZero(m.PgOperatorDeployer) { // not required return nil } @@ -451,11 +421,6 @@ func (m *VersionVersionMatrix) validatePgOperatorDeployer(formats strfmt.Registr } if val, ok := m.PgOperatorDeployer[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pgOperatorDeployer" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pgOperatorDeployer" + "." + k) - } return err } } @@ -466,6 +431,7 @@ func (m *VersionVersionMatrix) validatePgOperatorDeployer(formats strfmt.Registr } func (m *VersionVersionMatrix) validatePgOperatorEvent(formats strfmt.Registry) error { + if swag.IsZero(m.PgOperatorEvent) { // not required return nil } @@ -477,11 +443,6 @@ func (m *VersionVersionMatrix) validatePgOperatorEvent(formats strfmt.Registry) } if val, ok := m.PgOperatorEvent[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pgOperatorEvent" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pgOperatorEvent" + "." + k) - } return err } } @@ -492,6 +453,7 @@ func (m *VersionVersionMatrix) validatePgOperatorEvent(formats strfmt.Registry) } func (m *VersionVersionMatrix) validatePgOperatorRmdata(formats strfmt.Registry) error { + if swag.IsZero(m.PgOperatorRmdata) { // not required return nil } @@ -503,11 +465,6 @@ func (m *VersionVersionMatrix) validatePgOperatorRmdata(formats strfmt.Registry) } if val, ok := m.PgOperatorRmdata[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pgOperatorRmdata" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pgOperatorRmdata" + "." + k) - } return err } } @@ -518,6 +475,7 @@ func (m *VersionVersionMatrix) validatePgOperatorRmdata(formats strfmt.Registry) } func (m *VersionVersionMatrix) validatePgOperatorScheduler(formats strfmt.Registry) error { + if swag.IsZero(m.PgOperatorScheduler) { // not required return nil } @@ -529,11 +487,6 @@ func (m *VersionVersionMatrix) validatePgOperatorScheduler(formats strfmt.Regist } if val, ok := m.PgOperatorScheduler[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pgOperatorScheduler" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pgOperatorScheduler" + "." + k) - } return err } } @@ -544,6 +497,7 @@ func (m *VersionVersionMatrix) validatePgOperatorScheduler(formats strfmt.Regist } func (m *VersionVersionMatrix) validatePgbackrest(formats strfmt.Registry) error { + if swag.IsZero(m.Pgbackrest) { // not required return nil } @@ -555,11 +509,6 @@ func (m *VersionVersionMatrix) validatePgbackrest(formats strfmt.Registry) error } if val, ok := m.Pgbackrest[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pgbackrest" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pgbackrest" + "." + k) - } return err } } @@ -570,6 +519,7 @@ func (m *VersionVersionMatrix) validatePgbackrest(formats strfmt.Registry) error } func (m *VersionVersionMatrix) validatePgbackrestRepo(formats strfmt.Registry) error { + if swag.IsZero(m.PgbackrestRepo) { // not required return nil } @@ -581,11 +531,6 @@ func (m *VersionVersionMatrix) validatePgbackrestRepo(formats strfmt.Registry) e } if val, ok := m.PgbackrestRepo[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pgbackrestRepo" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pgbackrestRepo" + "." + k) - } return err } } @@ -596,6 +541,7 @@ func (m *VersionVersionMatrix) validatePgbackrestRepo(formats strfmt.Registry) e } func (m *VersionVersionMatrix) validatePgbadger(formats strfmt.Registry) error { + if swag.IsZero(m.Pgbadger) { // not required return nil } @@ -607,11 +553,6 @@ func (m *VersionVersionMatrix) validatePgbadger(formats strfmt.Registry) error { } if val, ok := m.Pgbadger[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pgbadger" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pgbadger" + "." + k) - } return err } } @@ -622,6 +563,7 @@ func (m *VersionVersionMatrix) validatePgbadger(formats strfmt.Registry) error { } func (m *VersionVersionMatrix) validatePgbouncer(formats strfmt.Registry) error { + if swag.IsZero(m.Pgbouncer) { // not required return nil } @@ -633,11 +575,6 @@ func (m *VersionVersionMatrix) validatePgbouncer(formats strfmt.Registry) error } if val, ok := m.Pgbouncer[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pgbouncer" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pgbouncer" + "." + k) - } return err } } @@ -648,6 +585,7 @@ func (m *VersionVersionMatrix) validatePgbouncer(formats strfmt.Registry) error } func (m *VersionVersionMatrix) validatePmm(formats strfmt.Registry) error { + if swag.IsZero(m.Pmm) { // not required return nil } @@ -659,11 +597,6 @@ func (m *VersionVersionMatrix) validatePmm(formats strfmt.Registry) error { } if val, ok := m.Pmm[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pmm" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pmm" + "." + k) - } return err } } @@ -674,6 +607,7 @@ func (m *VersionVersionMatrix) validatePmm(formats strfmt.Registry) error { } func (m *VersionVersionMatrix) validatePostgresql(formats strfmt.Registry) error { + if swag.IsZero(m.Postgresql) { // not required return nil } @@ -685,11 +619,6 @@ func (m *VersionVersionMatrix) validatePostgresql(formats strfmt.Registry) error } if val, ok := m.Postgresql[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postgresql" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postgresql" + "." + k) - } return err } } @@ -700,6 +629,7 @@ func (m *VersionVersionMatrix) validatePostgresql(formats strfmt.Registry) error } func (m *VersionVersionMatrix) validateProxysql(formats strfmt.Registry) error { + if swag.IsZero(m.Proxysql) { // not required return nil } @@ -711,11 +641,6 @@ func (m *VersionVersionMatrix) validateProxysql(formats strfmt.Registry) error { } if val, ok := m.Proxysql[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proxysql" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proxysql" + "." + k) - } return err } } @@ -726,6 +651,7 @@ func (m *VersionVersionMatrix) validateProxysql(formats strfmt.Registry) error { } func (m *VersionVersionMatrix) validatePsOperator(formats strfmt.Registry) error { + if swag.IsZero(m.PsOperator) { // not required return nil } @@ -737,11 +663,6 @@ func (m *VersionVersionMatrix) validatePsOperator(formats strfmt.Registry) error } if val, ok := m.PsOperator[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("psOperator" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("psOperator" + "." + k) - } return err } } @@ -752,6 +673,7 @@ func (m *VersionVersionMatrix) validatePsOperator(formats strfmt.Registry) error } func (m *VersionVersionMatrix) validatePsmdbOperator(formats strfmt.Registry) error { + if swag.IsZero(m.PsmdbOperator) { // not required return nil } @@ -763,11 +685,6 @@ func (m *VersionVersionMatrix) validatePsmdbOperator(formats strfmt.Registry) er } if val, ok := m.PsmdbOperator[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("psmdbOperator" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("psmdbOperator" + "." + k) - } return err } } @@ -778,6 +695,7 @@ func (m *VersionVersionMatrix) validatePsmdbOperator(formats strfmt.Registry) er } func (m *VersionVersionMatrix) validatePxc(formats strfmt.Registry) error { + if swag.IsZero(m.Pxc) { // not required return nil } @@ -789,11 +707,6 @@ func (m *VersionVersionMatrix) validatePxc(formats strfmt.Registry) error { } if val, ok := m.Pxc[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pxc" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pxc" + "." + k) - } return err } } @@ -804,6 +717,7 @@ func (m *VersionVersionMatrix) validatePxc(formats strfmt.Registry) error { } func (m *VersionVersionMatrix) validatePxcOperator(formats strfmt.Registry) error { + if swag.IsZero(m.PxcOperator) { // not required return nil } @@ -815,11 +729,6 @@ func (m *VersionVersionMatrix) validatePxcOperator(formats strfmt.Registry) erro } if val, ok := m.PxcOperator[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pxcOperator" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pxcOperator" + "." + k) - } return err } } @@ -830,6 +739,7 @@ func (m *VersionVersionMatrix) validatePxcOperator(formats strfmt.Registry) erro } func (m *VersionVersionMatrix) validateRouter(formats strfmt.Registry) error { + if swag.IsZero(m.Router) { // not required return nil } @@ -841,151 +751,6 @@ func (m *VersionVersionMatrix) validateRouter(formats strfmt.Registry) error { } if val, ok := m.Router[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("router" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("router" + "." + k) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this version version matrix based on the context it is used -func (m *VersionVersionMatrix) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateHaproxy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLogCollector(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMongod(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOperator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrchestrator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePgOperator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePgOperatorApiserver(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePgOperatorDeployer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePgOperatorEvent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePgOperatorRmdata(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePgOperatorScheduler(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePgbackrest(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePgbackrestRepo(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePgbadger(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePgbouncer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePmm(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePostgresql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProxysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePsOperator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePsmdbOperator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePxc(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePxcOperator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRouter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VersionVersionMatrix) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Backup { - - if val, ok := m.Backup[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Haproxy { - - if val, ok := m.Haproxy[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { return err } } @@ -995,342 +760,19 @@ func (m *VersionVersionMatrix) contextValidateHaproxy(ctx context.Context, forma return nil } -func (m *VersionVersionMatrix) contextValidateLogCollector(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.LogCollector { - - if val, ok := m.LogCollector[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidateMongod(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Mongod { - - if val, ok := m.Mongod[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Mysql { - - if val, ok := m.Mysql[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidateOperator(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Operator { - - if val, ok := m.Operator[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidateOrchestrator(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Orchestrator { - - if val, ok := m.Orchestrator[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePgOperator(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.PgOperator { - - if val, ok := m.PgOperator[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePgOperatorApiserver(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.PgOperatorApiserver { - - if val, ok := m.PgOperatorApiserver[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePgOperatorDeployer(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.PgOperatorDeployer { - - if val, ok := m.PgOperatorDeployer[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePgOperatorEvent(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.PgOperatorEvent { - - if val, ok := m.PgOperatorEvent[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePgOperatorRmdata(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.PgOperatorRmdata { - - if val, ok := m.PgOperatorRmdata[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePgOperatorScheduler(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.PgOperatorScheduler { - - if val, ok := m.PgOperatorScheduler[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePgbackrest(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Pgbackrest { - - if val, ok := m.Pgbackrest[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePgbackrestRepo(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.PgbackrestRepo { - - if val, ok := m.PgbackrestRepo[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePgbadger(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Pgbadger { - - if val, ok := m.Pgbadger[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePgbouncer(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Pgbouncer { - - if val, ok := m.Pgbouncer[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePmm(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Pmm { - - if val, ok := m.Pmm[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Postgresql { - - if val, ok := m.Postgresql[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Proxysql { - - if val, ok := m.Proxysql[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePsOperator(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.PsOperator { - - if val, ok := m.PsOperator[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePsmdbOperator(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.PsmdbOperator { - - if val, ok := m.PsmdbOperator[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidatePxc(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Pxc { - - if val, ok := m.Pxc[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } +func (m *VersionVersionMatrix) validateToolkit(formats strfmt.Registry) error { + if swag.IsZero(m.Toolkit) { // not required + return nil } - return nil -} - -func (m *VersionVersionMatrix) contextValidatePxcOperator(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.PxcOperator { + for k := range m.Toolkit { - if val, ok := m.PxcOperator[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } + if err := validate.Required("toolkit"+"."+k, "body", m.Toolkit[k]); err != nil { + return err } - - } - - return nil -} - -func (m *VersionVersionMatrix) contextValidateRouter(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.Router { - - if val, ok := m.Router[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { + if val, ok := m.Toolkit[k]; ok { + if err := val.Validate(formats); err != nil { return err } } diff --git a/version/client/models/version_version_response.go b/version/client/models/version_version_response.go index 34abed8e6a..a9ee0e5197 100644 --- a/version/client/models/version_version_response.go +++ b/version/client/models/version_version_response.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -38,6 +37,7 @@ func (m *VersionVersionResponse) Validate(formats strfmt.Registry) error { } func (m *VersionVersionResponse) validateVersions(formats strfmt.Registry) error { + if swag.IsZero(m.Versions) { // not required return nil } @@ -51,42 +51,6 @@ func (m *VersionVersionResponse) validateVersions(formats strfmt.Registry) error if err := m.Versions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("versions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("versions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this version version response based on the context it is used -func (m *VersionVersionResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVersions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VersionVersionResponse) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Versions); i++ { - - if m.Versions[i] != nil { - if err := m.Versions[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("versions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("versions" + "." + strconv.Itoa(i)) } return err } diff --git a/version/client/version_service/version_service_apply_parameters.go b/version/client/version_service/version_service_apply_parameters.go index 2d19601cb7..d3c9e72636 100644 --- a/version/client/version_service/version_service_apply_parameters.go +++ b/version/client/version_service/version_service_apply_parameters.go @@ -17,125 +17,106 @@ import ( "github.com/go-openapi/swag" ) -// NewVersionServiceApplyParams creates a new VersionServiceApplyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewVersionServiceApplyParams creates a new VersionServiceApplyParams object +// with the default values initialized. func NewVersionServiceApplyParams() *VersionServiceApplyParams { + var () return &VersionServiceApplyParams{ + timeout: cr.DefaultTimeout, } } // NewVersionServiceApplyParamsWithTimeout creates a new VersionServiceApplyParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewVersionServiceApplyParamsWithTimeout(timeout time.Duration) *VersionServiceApplyParams { + var () return &VersionServiceApplyParams{ + timeout: timeout, } } // NewVersionServiceApplyParamsWithContext creates a new VersionServiceApplyParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewVersionServiceApplyParamsWithContext(ctx context.Context) *VersionServiceApplyParams { + var () return &VersionServiceApplyParams{ + Context: ctx, } } // NewVersionServiceApplyParamsWithHTTPClient creates a new VersionServiceApplyParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewVersionServiceApplyParamsWithHTTPClient(client *http.Client) *VersionServiceApplyParams { + var () return &VersionServiceApplyParams{ HTTPClient: client, } } -/* -VersionServiceApplyParams contains all the parameters to send to the API endpoint - - for the version service apply operation. - - Typically these are written to a http.Request. +/*VersionServiceApplyParams contains all the parameters to send to the API endpoint +for the version service apply operation typically these are written to a http.Request */ type VersionServiceApplyParams struct { - // Apply. + /*Apply*/ Apply string - - // BackupVersion. + /*BackupVersion*/ BackupVersion *string - - // ClusterWideEnabled. - // - // Format: boolean + /*BackupsEnabled*/ + BackupsEnabled *bool + /*ClusterSize*/ + ClusterSize *int32 + /*ClusterWideEnabled*/ ClusterWideEnabled *bool - - // CustomResourceUID. + /*CustomResourceUID*/ CustomResourceUID *string - - // DatabaseVersion. + /*DatabaseVersion*/ DatabaseVersion *string - - // HaproxyVersion. + /*HaproxyVersion*/ HaproxyVersion *string - - // HashicorpVaultEnabled. - // - // Format: boolean + /*HashicorpVaultEnabled*/ HashicorpVaultEnabled *bool - - // KubeVersion. + /*HelmDeployCr*/ + HelmDeployCr *bool + /*HelmDeployOperator*/ + HelmDeployOperator *bool + /*KubeVersion*/ KubeVersion *string - - // LogCollectorVersion. + /*LogCollectorVersion*/ LogCollectorVersion *string - - // NamespaceUID. + /*NamespaceUID*/ NamespaceUID *string - - // OperatorVersion. + /*OperatorVersion*/ OperatorVersion string - - // Platform. + /*PhysicalBackupScheduled*/ + PhysicalBackupScheduled *bool + /*PitrEnabled*/ + PitrEnabled *bool + /*Platform*/ Platform *string - - // PmmVersion. + /*PmmEnabled*/ + PmmEnabled *bool + /*PmmVersion*/ PmmVersion *string - - // Product. + /*Product*/ Product string - - // ProxysqlVersion. + /*ProxysqlScheduler*/ + ProxysqlScheduler *string + /*ProxysqlVersion*/ ProxysqlVersion *string - - // ShardingEnabled. - // - // Format: boolean + /*ShardingEnabled*/ ShardingEnabled *bool + /*SidecarsUsed*/ + SidecarsUsed *bool timeout time.Duration Context context.Context HTTPClient *http.Client } -// WithDefaults hydrates default values in the version service apply params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VersionServiceApplyParams) WithDefaults() *VersionServiceApplyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the version service apply params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VersionServiceApplyParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the version service apply params func (o *VersionServiceApplyParams) WithTimeout(timeout time.Duration) *VersionServiceApplyParams { o.SetTimeout(timeout) @@ -191,6 +172,28 @@ func (o *VersionServiceApplyParams) SetBackupVersion(backupVersion *string) { o.BackupVersion = backupVersion } +// WithBackupsEnabled adds the backupsEnabled to the version service apply params +func (o *VersionServiceApplyParams) WithBackupsEnabled(backupsEnabled *bool) *VersionServiceApplyParams { + o.SetBackupsEnabled(backupsEnabled) + return o +} + +// SetBackupsEnabled adds the backupsEnabled to the version service apply params +func (o *VersionServiceApplyParams) SetBackupsEnabled(backupsEnabled *bool) { + o.BackupsEnabled = backupsEnabled +} + +// WithClusterSize adds the clusterSize to the version service apply params +func (o *VersionServiceApplyParams) WithClusterSize(clusterSize *int32) *VersionServiceApplyParams { + o.SetClusterSize(clusterSize) + return o +} + +// SetClusterSize adds the clusterSize to the version service apply params +func (o *VersionServiceApplyParams) SetClusterSize(clusterSize *int32) { + o.ClusterSize = clusterSize +} + // WithClusterWideEnabled adds the clusterWideEnabled to the version service apply params func (o *VersionServiceApplyParams) WithClusterWideEnabled(clusterWideEnabled *bool) *VersionServiceApplyParams { o.SetClusterWideEnabled(clusterWideEnabled) @@ -246,6 +249,28 @@ func (o *VersionServiceApplyParams) SetHashicorpVaultEnabled(hashicorpVaultEnabl o.HashicorpVaultEnabled = hashicorpVaultEnabled } +// WithHelmDeployCr adds the helmDeployCr to the version service apply params +func (o *VersionServiceApplyParams) WithHelmDeployCr(helmDeployCr *bool) *VersionServiceApplyParams { + o.SetHelmDeployCr(helmDeployCr) + return o +} + +// SetHelmDeployCr adds the helmDeployCr to the version service apply params +func (o *VersionServiceApplyParams) SetHelmDeployCr(helmDeployCr *bool) { + o.HelmDeployCr = helmDeployCr +} + +// WithHelmDeployOperator adds the helmDeployOperator to the version service apply params +func (o *VersionServiceApplyParams) WithHelmDeployOperator(helmDeployOperator *bool) *VersionServiceApplyParams { + o.SetHelmDeployOperator(helmDeployOperator) + return o +} + +// SetHelmDeployOperator adds the helmDeployOperator to the version service apply params +func (o *VersionServiceApplyParams) SetHelmDeployOperator(helmDeployOperator *bool) { + o.HelmDeployOperator = helmDeployOperator +} + // WithKubeVersion adds the kubeVersion to the version service apply params func (o *VersionServiceApplyParams) WithKubeVersion(kubeVersion *string) *VersionServiceApplyParams { o.SetKubeVersion(kubeVersion) @@ -290,6 +315,28 @@ func (o *VersionServiceApplyParams) SetOperatorVersion(operatorVersion string) { o.OperatorVersion = operatorVersion } +// WithPhysicalBackupScheduled adds the physicalBackupScheduled to the version service apply params +func (o *VersionServiceApplyParams) WithPhysicalBackupScheduled(physicalBackupScheduled *bool) *VersionServiceApplyParams { + o.SetPhysicalBackupScheduled(physicalBackupScheduled) + return o +} + +// SetPhysicalBackupScheduled adds the physicalBackupScheduled to the version service apply params +func (o *VersionServiceApplyParams) SetPhysicalBackupScheduled(physicalBackupScheduled *bool) { + o.PhysicalBackupScheduled = physicalBackupScheduled +} + +// WithPitrEnabled adds the pitrEnabled to the version service apply params +func (o *VersionServiceApplyParams) WithPitrEnabled(pitrEnabled *bool) *VersionServiceApplyParams { + o.SetPitrEnabled(pitrEnabled) + return o +} + +// SetPitrEnabled adds the pitrEnabled to the version service apply params +func (o *VersionServiceApplyParams) SetPitrEnabled(pitrEnabled *bool) { + o.PitrEnabled = pitrEnabled +} + // WithPlatform adds the platform to the version service apply params func (o *VersionServiceApplyParams) WithPlatform(platform *string) *VersionServiceApplyParams { o.SetPlatform(platform) @@ -301,6 +348,17 @@ func (o *VersionServiceApplyParams) SetPlatform(platform *string) { o.Platform = platform } +// WithPmmEnabled adds the pmmEnabled to the version service apply params +func (o *VersionServiceApplyParams) WithPmmEnabled(pmmEnabled *bool) *VersionServiceApplyParams { + o.SetPmmEnabled(pmmEnabled) + return o +} + +// SetPmmEnabled adds the pmmEnabled to the version service apply params +func (o *VersionServiceApplyParams) SetPmmEnabled(pmmEnabled *bool) { + o.PmmEnabled = pmmEnabled +} + // WithPmmVersion adds the pmmVersion to the version service apply params func (o *VersionServiceApplyParams) WithPmmVersion(pmmVersion *string) *VersionServiceApplyParams { o.SetPmmVersion(pmmVersion) @@ -323,6 +381,17 @@ func (o *VersionServiceApplyParams) SetProduct(product string) { o.Product = product } +// WithProxysqlScheduler adds the proxysqlScheduler to the version service apply params +func (o *VersionServiceApplyParams) WithProxysqlScheduler(proxysqlScheduler *string) *VersionServiceApplyParams { + o.SetProxysqlScheduler(proxysqlScheduler) + return o +} + +// SetProxysqlScheduler adds the proxysqlScheduler to the version service apply params +func (o *VersionServiceApplyParams) SetProxysqlScheduler(proxysqlScheduler *string) { + o.ProxysqlScheduler = proxysqlScheduler +} + // WithProxysqlVersion adds the proxysqlVersion to the version service apply params func (o *VersionServiceApplyParams) WithProxysqlVersion(proxysqlVersion *string) *VersionServiceApplyParams { o.SetProxysqlVersion(proxysqlVersion) @@ -345,6 +414,17 @@ func (o *VersionServiceApplyParams) SetShardingEnabled(shardingEnabled *bool) { o.ShardingEnabled = shardingEnabled } +// WithSidecarsUsed adds the sidecarsUsed to the version service apply params +func (o *VersionServiceApplyParams) WithSidecarsUsed(sidecarsUsed *bool) *VersionServiceApplyParams { + o.SetSidecarsUsed(sidecarsUsed) + return o +} + +// SetSidecarsUsed adds the sidecarsUsed to the version service apply params +func (o *VersionServiceApplyParams) SetSidecarsUsed(sidecarsUsed *bool) { + o.SidecarsUsed = sidecarsUsed +} + // WriteToRequest writes these params to a swagger request func (o *VersionServiceApplyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -362,153 +442,208 @@ func (o *VersionServiceApplyParams) WriteToRequest(r runtime.ClientRequest, reg // query param backupVersion var qrBackupVersion string - if o.BackupVersion != nil { qrBackupVersion = *o.BackupVersion } qBackupVersion := qrBackupVersion if qBackupVersion != "" { - if err := r.SetQueryParam("backupVersion", qBackupVersion); err != nil { return err } } + + } + + if o.BackupsEnabled != nil { + + // query param backupsEnabled + var qrBackupsEnabled bool + if o.BackupsEnabled != nil { + qrBackupsEnabled = *o.BackupsEnabled + } + qBackupsEnabled := swag.FormatBool(qrBackupsEnabled) + if qBackupsEnabled != "" { + if err := r.SetQueryParam("backupsEnabled", qBackupsEnabled); err != nil { + return err + } + } + + } + + if o.ClusterSize != nil { + + // query param clusterSize + var qrClusterSize int32 + if o.ClusterSize != nil { + qrClusterSize = *o.ClusterSize + } + qClusterSize := swag.FormatInt32(qrClusterSize) + if qClusterSize != "" { + if err := r.SetQueryParam("clusterSize", qClusterSize); err != nil { + return err + } + } + } if o.ClusterWideEnabled != nil { // query param clusterWideEnabled var qrClusterWideEnabled bool - if o.ClusterWideEnabled != nil { qrClusterWideEnabled = *o.ClusterWideEnabled } qClusterWideEnabled := swag.FormatBool(qrClusterWideEnabled) if qClusterWideEnabled != "" { - if err := r.SetQueryParam("clusterWideEnabled", qClusterWideEnabled); err != nil { return err } } + } if o.CustomResourceUID != nil { // query param customResourceUid var qrCustomResourceUID string - if o.CustomResourceUID != nil { qrCustomResourceUID = *o.CustomResourceUID } qCustomResourceUID := qrCustomResourceUID if qCustomResourceUID != "" { - if err := r.SetQueryParam("customResourceUid", qCustomResourceUID); err != nil { return err } } + } if o.DatabaseVersion != nil { // query param databaseVersion var qrDatabaseVersion string - if o.DatabaseVersion != nil { qrDatabaseVersion = *o.DatabaseVersion } qDatabaseVersion := qrDatabaseVersion if qDatabaseVersion != "" { - if err := r.SetQueryParam("databaseVersion", qDatabaseVersion); err != nil { return err } } + } if o.HaproxyVersion != nil { // query param haproxyVersion var qrHaproxyVersion string - if o.HaproxyVersion != nil { qrHaproxyVersion = *o.HaproxyVersion } qHaproxyVersion := qrHaproxyVersion if qHaproxyVersion != "" { - if err := r.SetQueryParam("haproxyVersion", qHaproxyVersion); err != nil { return err } } + } if o.HashicorpVaultEnabled != nil { // query param hashicorpVaultEnabled var qrHashicorpVaultEnabled bool - if o.HashicorpVaultEnabled != nil { qrHashicorpVaultEnabled = *o.HashicorpVaultEnabled } qHashicorpVaultEnabled := swag.FormatBool(qrHashicorpVaultEnabled) if qHashicorpVaultEnabled != "" { - if err := r.SetQueryParam("hashicorpVaultEnabled", qHashicorpVaultEnabled); err != nil { return err } } + + } + + if o.HelmDeployCr != nil { + + // query param helmDeployCr + var qrHelmDeployCr bool + if o.HelmDeployCr != nil { + qrHelmDeployCr = *o.HelmDeployCr + } + qHelmDeployCr := swag.FormatBool(qrHelmDeployCr) + if qHelmDeployCr != "" { + if err := r.SetQueryParam("helmDeployCr", qHelmDeployCr); err != nil { + return err + } + } + + } + + if o.HelmDeployOperator != nil { + + // query param helmDeployOperator + var qrHelmDeployOperator bool + if o.HelmDeployOperator != nil { + qrHelmDeployOperator = *o.HelmDeployOperator + } + qHelmDeployOperator := swag.FormatBool(qrHelmDeployOperator) + if qHelmDeployOperator != "" { + if err := r.SetQueryParam("helmDeployOperator", qHelmDeployOperator); err != nil { + return err + } + } + } if o.KubeVersion != nil { // query param kubeVersion var qrKubeVersion string - if o.KubeVersion != nil { qrKubeVersion = *o.KubeVersion } qKubeVersion := qrKubeVersion if qKubeVersion != "" { - if err := r.SetQueryParam("kubeVersion", qKubeVersion); err != nil { return err } } + } if o.LogCollectorVersion != nil { // query param logCollectorVersion var qrLogCollectorVersion string - if o.LogCollectorVersion != nil { qrLogCollectorVersion = *o.LogCollectorVersion } qLogCollectorVersion := qrLogCollectorVersion if qLogCollectorVersion != "" { - if err := r.SetQueryParam("logCollectorVersion", qLogCollectorVersion); err != nil { return err } } + } if o.NamespaceUID != nil { // query param namespaceUid var qrNamespaceUID string - if o.NamespaceUID != nil { qrNamespaceUID = *o.NamespaceUID } qNamespaceUID := qrNamespaceUID if qNamespaceUID != "" { - if err := r.SetQueryParam("namespaceUid", qNamespaceUID); err != nil { return err } } + } // path param operatorVersion @@ -516,38 +651,84 @@ func (o *VersionServiceApplyParams) WriteToRequest(r runtime.ClientRequest, reg return err } + if o.PhysicalBackupScheduled != nil { + + // query param physicalBackupScheduled + var qrPhysicalBackupScheduled bool + if o.PhysicalBackupScheduled != nil { + qrPhysicalBackupScheduled = *o.PhysicalBackupScheduled + } + qPhysicalBackupScheduled := swag.FormatBool(qrPhysicalBackupScheduled) + if qPhysicalBackupScheduled != "" { + if err := r.SetQueryParam("physicalBackupScheduled", qPhysicalBackupScheduled); err != nil { + return err + } + } + + } + + if o.PitrEnabled != nil { + + // query param pitrEnabled + var qrPitrEnabled bool + if o.PitrEnabled != nil { + qrPitrEnabled = *o.PitrEnabled + } + qPitrEnabled := swag.FormatBool(qrPitrEnabled) + if qPitrEnabled != "" { + if err := r.SetQueryParam("pitrEnabled", qPitrEnabled); err != nil { + return err + } + } + + } + if o.Platform != nil { // query param platform var qrPlatform string - if o.Platform != nil { qrPlatform = *o.Platform } qPlatform := qrPlatform if qPlatform != "" { - if err := r.SetQueryParam("platform", qPlatform); err != nil { return err } } + + } + + if o.PmmEnabled != nil { + + // query param pmmEnabled + var qrPmmEnabled bool + if o.PmmEnabled != nil { + qrPmmEnabled = *o.PmmEnabled + } + qPmmEnabled := swag.FormatBool(qrPmmEnabled) + if qPmmEnabled != "" { + if err := r.SetQueryParam("pmmEnabled", qPmmEnabled); err != nil { + return err + } + } + } if o.PmmVersion != nil { // query param pmmVersion var qrPmmVersion string - if o.PmmVersion != nil { qrPmmVersion = *o.PmmVersion } qPmmVersion := qrPmmVersion if qPmmVersion != "" { - if err := r.SetQueryParam("pmmVersion", qPmmVersion); err != nil { return err } } + } // path param product @@ -555,38 +736,68 @@ func (o *VersionServiceApplyParams) WriteToRequest(r runtime.ClientRequest, reg return err } + if o.ProxysqlScheduler != nil { + + // query param proxysqlScheduler + var qrProxysqlScheduler string + if o.ProxysqlScheduler != nil { + qrProxysqlScheduler = *o.ProxysqlScheduler + } + qProxysqlScheduler := qrProxysqlScheduler + if qProxysqlScheduler != "" { + if err := r.SetQueryParam("proxysqlScheduler", qProxysqlScheduler); err != nil { + return err + } + } + + } + if o.ProxysqlVersion != nil { // query param proxysqlVersion var qrProxysqlVersion string - if o.ProxysqlVersion != nil { qrProxysqlVersion = *o.ProxysqlVersion } qProxysqlVersion := qrProxysqlVersion if qProxysqlVersion != "" { - if err := r.SetQueryParam("proxysqlVersion", qProxysqlVersion); err != nil { return err } } + } if o.ShardingEnabled != nil { // query param shardingEnabled var qrShardingEnabled bool - if o.ShardingEnabled != nil { qrShardingEnabled = *o.ShardingEnabled } qShardingEnabled := swag.FormatBool(qrShardingEnabled) if qShardingEnabled != "" { - if err := r.SetQueryParam("shardingEnabled", qShardingEnabled); err != nil { return err } } + + } + + if o.SidecarsUsed != nil { + + // query param sidecarsUsed + var qrSidecarsUsed bool + if o.SidecarsUsed != nil { + qrSidecarsUsed = *o.SidecarsUsed + } + qSidecarsUsed := swag.FormatBool(qrSidecarsUsed) + if qSidecarsUsed != "" { + if err := r.SetQueryParam("sidecarsUsed", qSidecarsUsed); err != nil { + return err + } + } + } if len(res) > 0 { diff --git a/version/client/version_service/version_service_apply_responses.go b/version/client/version_service/version_service_apply_responses.go index 677847438c..36349e7e0b 100644 --- a/version/client/version_service/version_service_apply_responses.go +++ b/version/client/version_service/version_service_apply_responses.go @@ -46,8 +46,7 @@ func NewVersionServiceApplyOK() *VersionServiceApplyOK { return &VersionServiceApplyOK{} } -/* -VersionServiceApplyOK describes a response with status code 200, with default header values. +/*VersionServiceApplyOK handles this case with default header values. A successful response. */ @@ -58,6 +57,7 @@ type VersionServiceApplyOK struct { func (o *VersionServiceApplyOK) Error() string { return fmt.Sprintf("[GET /versions/v1/{product}/{operatorVersion}/{apply}][%d] versionServiceApplyOK %+v", 200, o.Payload) } + func (o *VersionServiceApplyOK) GetPayload() *models.VersionVersionResponse { return o.Payload } @@ -81,8 +81,7 @@ func NewVersionServiceApplyDefault(code int) *VersionServiceApplyDefault { } } -/* -VersionServiceApplyDefault describes a response with status code -1, with default header values. +/*VersionServiceApplyDefault handles this case with default header values. An unexpected error response */ @@ -100,6 +99,7 @@ func (o *VersionServiceApplyDefault) Code() int { func (o *VersionServiceApplyDefault) Error() string { return fmt.Sprintf("[GET /versions/v1/{product}/{operatorVersion}/{apply}][%d] VersionService_Apply default %+v", o._statusCode, o.Payload) } + func (o *VersionServiceApplyDefault) GetPayload() *models.GooglerpcStatus { return o.Payload } diff --git a/version/client/version_service/version_service_client.go b/version/client/version_service/version_service_client.go index 398c120215..c911c5c316 100644 --- a/version/client/version_service/version_service_client.go +++ b/version/client/version_service/version_service_client.go @@ -23,31 +23,29 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - // ClientService is the interface for Client methods type ClientService interface { - VersionServiceApply(params *VersionServiceApplyParams, opts ...ClientOption) (*VersionServiceApplyOK, error) + VersionServiceApply(params *VersionServiceApplyParams) (*VersionServiceApplyOK, error) - VersionServiceOperator(params *VersionServiceOperatorParams, opts ...ClientOption) (*VersionServiceOperatorOK, error) + VersionServiceOperator(params *VersionServiceOperatorParams) (*VersionServiceOperatorOK, error) - VersionServiceProduct(params *VersionServiceProductParams, opts ...ClientOption) (*VersionServiceProductOK, error) + VersionServiceProduct(params *VersionServiceProductParams) (*VersionServiceProductOK, error) SetTransport(transport runtime.ClientTransport) } /* -VersionServiceApply specifics version + VersionServiceApply specifics version -Return specific product version + Return specific product version */ -func (a *Client) VersionServiceApply(params *VersionServiceApplyParams, opts ...ClientOption) (*VersionServiceApplyOK, error) { +func (a *Client) VersionServiceApply(params *VersionServiceApplyParams) (*VersionServiceApplyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewVersionServiceApplyParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "VersionService_Apply", Method: "GET", PathPattern: "/versions/v1/{product}/{operatorVersion}/{apply}", @@ -58,12 +56,7 @@ func (a *Client) VersionServiceApply(params *VersionServiceApplyParams, opts ... Reader: &VersionServiceApplyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -77,16 +70,17 @@ func (a *Client) VersionServiceApply(params *VersionServiceApplyParams, opts ... } /* -VersionServiceOperator products versions for specific operator version + VersionServiceOperator products versions for specific operator version -Return product versions for specific operator + Return product versions for specific operator */ -func (a *Client) VersionServiceOperator(params *VersionServiceOperatorParams, opts ...ClientOption) (*VersionServiceOperatorOK, error) { +func (a *Client) VersionServiceOperator(params *VersionServiceOperatorParams) (*VersionServiceOperatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewVersionServiceOperatorParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "VersionService_Operator", Method: "GET", PathPattern: "/versions/v1/{product}/{operatorVersion}", @@ -97,12 +91,7 @@ func (a *Client) VersionServiceOperator(params *VersionServiceOperatorParams, op Reader: &VersionServiceOperatorReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -116,16 +105,17 @@ func (a *Client) VersionServiceOperator(params *VersionServiceOperatorParams, op } /* -VersionServiceProduct products versions for all operator version + VersionServiceProduct products versions for all operator version -Return product versions for all operator + Return product versions for all operator */ -func (a *Client) VersionServiceProduct(params *VersionServiceProductParams, opts ...ClientOption) (*VersionServiceProductOK, error) { +func (a *Client) VersionServiceProduct(params *VersionServiceProductParams) (*VersionServiceProductOK, error) { // TODO: Validate the params before sending if params == nil { params = NewVersionServiceProductParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "VersionService_Product", Method: "GET", PathPattern: "/versions/v1/{product}", @@ -136,12 +126,7 @@ func (a *Client) VersionServiceProduct(params *VersionServiceProductParams, opts Reader: &VersionServiceProductReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } diff --git a/version/client/version_service/version_service_operator_parameters.go b/version/client/version_service/version_service_operator_parameters.go index 1da63ea38a..2e4b5912ce 100644 --- a/version/client/version_service/version_service_operator_parameters.go +++ b/version/client/version_service/version_service_operator_parameters.go @@ -17,122 +17,104 @@ import ( "github.com/go-openapi/swag" ) -// NewVersionServiceOperatorParams creates a new VersionServiceOperatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewVersionServiceOperatorParams creates a new VersionServiceOperatorParams object +// with the default values initialized. func NewVersionServiceOperatorParams() *VersionServiceOperatorParams { + var () return &VersionServiceOperatorParams{ + timeout: cr.DefaultTimeout, } } // NewVersionServiceOperatorParamsWithTimeout creates a new VersionServiceOperatorParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewVersionServiceOperatorParamsWithTimeout(timeout time.Duration) *VersionServiceOperatorParams { + var () return &VersionServiceOperatorParams{ + timeout: timeout, } } // NewVersionServiceOperatorParamsWithContext creates a new VersionServiceOperatorParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewVersionServiceOperatorParamsWithContext(ctx context.Context) *VersionServiceOperatorParams { + var () return &VersionServiceOperatorParams{ + Context: ctx, } } // NewVersionServiceOperatorParamsWithHTTPClient creates a new VersionServiceOperatorParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewVersionServiceOperatorParamsWithHTTPClient(client *http.Client) *VersionServiceOperatorParams { + var () return &VersionServiceOperatorParams{ HTTPClient: client, } } -/* -VersionServiceOperatorParams contains all the parameters to send to the API endpoint - - for the version service operator operation. - - Typically these are written to a http.Request. +/*VersionServiceOperatorParams contains all the parameters to send to the API endpoint +for the version service operator operation typically these are written to a http.Request */ type VersionServiceOperatorParams struct { - // BackupVersion. + /*BackupVersion*/ BackupVersion *string - - // ClusterWideEnabled. - // - // Format: boolean + /*BackupsEnabled*/ + BackupsEnabled *bool + /*ClusterSize*/ + ClusterSize *int32 + /*ClusterWideEnabled*/ ClusterWideEnabled *bool - - // CustomResourceUID. + /*CustomResourceUID*/ CustomResourceUID *string - - // DatabaseVersion. + /*DatabaseVersion*/ DatabaseVersion *string - - // HaproxyVersion. + /*HaproxyVersion*/ HaproxyVersion *string - - // HashicorpVaultEnabled. - // - // Format: boolean + /*HashicorpVaultEnabled*/ HashicorpVaultEnabled *bool - - // KubeVersion. + /*HelmDeployCr*/ + HelmDeployCr *bool + /*HelmDeployOperator*/ + HelmDeployOperator *bool + /*KubeVersion*/ KubeVersion *string - - // LogCollectorVersion. + /*LogCollectorVersion*/ LogCollectorVersion *string - - // NamespaceUID. + /*NamespaceUID*/ NamespaceUID *string - - // OperatorVersion. + /*OperatorVersion*/ OperatorVersion string - - // Platform. + /*PhysicalBackupScheduled*/ + PhysicalBackupScheduled *bool + /*PitrEnabled*/ + PitrEnabled *bool + /*Platform*/ Platform *string - - // PmmVersion. + /*PmmEnabled*/ + PmmEnabled *bool + /*PmmVersion*/ PmmVersion *string - - // Product. + /*Product*/ Product string - - // ProxysqlVersion. + /*ProxysqlScheduler*/ + ProxysqlScheduler *string + /*ProxysqlVersion*/ ProxysqlVersion *string - - // ShardingEnabled. - // - // Format: boolean + /*ShardingEnabled*/ ShardingEnabled *bool + /*SidecarsUsed*/ + SidecarsUsed *bool timeout time.Duration Context context.Context HTTPClient *http.Client } -// WithDefaults hydrates default values in the version service operator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VersionServiceOperatorParams) WithDefaults() *VersionServiceOperatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the version service operator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VersionServiceOperatorParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the version service operator params func (o *VersionServiceOperatorParams) WithTimeout(timeout time.Duration) *VersionServiceOperatorParams { o.SetTimeout(timeout) @@ -177,6 +159,28 @@ func (o *VersionServiceOperatorParams) SetBackupVersion(backupVersion *string) { o.BackupVersion = backupVersion } +// WithBackupsEnabled adds the backupsEnabled to the version service operator params +func (o *VersionServiceOperatorParams) WithBackupsEnabled(backupsEnabled *bool) *VersionServiceOperatorParams { + o.SetBackupsEnabled(backupsEnabled) + return o +} + +// SetBackupsEnabled adds the backupsEnabled to the version service operator params +func (o *VersionServiceOperatorParams) SetBackupsEnabled(backupsEnabled *bool) { + o.BackupsEnabled = backupsEnabled +} + +// WithClusterSize adds the clusterSize to the version service operator params +func (o *VersionServiceOperatorParams) WithClusterSize(clusterSize *int32) *VersionServiceOperatorParams { + o.SetClusterSize(clusterSize) + return o +} + +// SetClusterSize adds the clusterSize to the version service operator params +func (o *VersionServiceOperatorParams) SetClusterSize(clusterSize *int32) { + o.ClusterSize = clusterSize +} + // WithClusterWideEnabled adds the clusterWideEnabled to the version service operator params func (o *VersionServiceOperatorParams) WithClusterWideEnabled(clusterWideEnabled *bool) *VersionServiceOperatorParams { o.SetClusterWideEnabled(clusterWideEnabled) @@ -232,6 +236,28 @@ func (o *VersionServiceOperatorParams) SetHashicorpVaultEnabled(hashicorpVaultEn o.HashicorpVaultEnabled = hashicorpVaultEnabled } +// WithHelmDeployCr adds the helmDeployCr to the version service operator params +func (o *VersionServiceOperatorParams) WithHelmDeployCr(helmDeployCr *bool) *VersionServiceOperatorParams { + o.SetHelmDeployCr(helmDeployCr) + return o +} + +// SetHelmDeployCr adds the helmDeployCr to the version service operator params +func (o *VersionServiceOperatorParams) SetHelmDeployCr(helmDeployCr *bool) { + o.HelmDeployCr = helmDeployCr +} + +// WithHelmDeployOperator adds the helmDeployOperator to the version service operator params +func (o *VersionServiceOperatorParams) WithHelmDeployOperator(helmDeployOperator *bool) *VersionServiceOperatorParams { + o.SetHelmDeployOperator(helmDeployOperator) + return o +} + +// SetHelmDeployOperator adds the helmDeployOperator to the version service operator params +func (o *VersionServiceOperatorParams) SetHelmDeployOperator(helmDeployOperator *bool) { + o.HelmDeployOperator = helmDeployOperator +} + // WithKubeVersion adds the kubeVersion to the version service operator params func (o *VersionServiceOperatorParams) WithKubeVersion(kubeVersion *string) *VersionServiceOperatorParams { o.SetKubeVersion(kubeVersion) @@ -276,6 +302,28 @@ func (o *VersionServiceOperatorParams) SetOperatorVersion(operatorVersion string o.OperatorVersion = operatorVersion } +// WithPhysicalBackupScheduled adds the physicalBackupScheduled to the version service operator params +func (o *VersionServiceOperatorParams) WithPhysicalBackupScheduled(physicalBackupScheduled *bool) *VersionServiceOperatorParams { + o.SetPhysicalBackupScheduled(physicalBackupScheduled) + return o +} + +// SetPhysicalBackupScheduled adds the physicalBackupScheduled to the version service operator params +func (o *VersionServiceOperatorParams) SetPhysicalBackupScheduled(physicalBackupScheduled *bool) { + o.PhysicalBackupScheduled = physicalBackupScheduled +} + +// WithPitrEnabled adds the pitrEnabled to the version service operator params +func (o *VersionServiceOperatorParams) WithPitrEnabled(pitrEnabled *bool) *VersionServiceOperatorParams { + o.SetPitrEnabled(pitrEnabled) + return o +} + +// SetPitrEnabled adds the pitrEnabled to the version service operator params +func (o *VersionServiceOperatorParams) SetPitrEnabled(pitrEnabled *bool) { + o.PitrEnabled = pitrEnabled +} + // WithPlatform adds the platform to the version service operator params func (o *VersionServiceOperatorParams) WithPlatform(platform *string) *VersionServiceOperatorParams { o.SetPlatform(platform) @@ -287,6 +335,17 @@ func (o *VersionServiceOperatorParams) SetPlatform(platform *string) { o.Platform = platform } +// WithPmmEnabled adds the pmmEnabled to the version service operator params +func (o *VersionServiceOperatorParams) WithPmmEnabled(pmmEnabled *bool) *VersionServiceOperatorParams { + o.SetPmmEnabled(pmmEnabled) + return o +} + +// SetPmmEnabled adds the pmmEnabled to the version service operator params +func (o *VersionServiceOperatorParams) SetPmmEnabled(pmmEnabled *bool) { + o.PmmEnabled = pmmEnabled +} + // WithPmmVersion adds the pmmVersion to the version service operator params func (o *VersionServiceOperatorParams) WithPmmVersion(pmmVersion *string) *VersionServiceOperatorParams { o.SetPmmVersion(pmmVersion) @@ -309,6 +368,17 @@ func (o *VersionServiceOperatorParams) SetProduct(product string) { o.Product = product } +// WithProxysqlScheduler adds the proxysqlScheduler to the version service operator params +func (o *VersionServiceOperatorParams) WithProxysqlScheduler(proxysqlScheduler *string) *VersionServiceOperatorParams { + o.SetProxysqlScheduler(proxysqlScheduler) + return o +} + +// SetProxysqlScheduler adds the proxysqlScheduler to the version service operator params +func (o *VersionServiceOperatorParams) SetProxysqlScheduler(proxysqlScheduler *string) { + o.ProxysqlScheduler = proxysqlScheduler +} + // WithProxysqlVersion adds the proxysqlVersion to the version service operator params func (o *VersionServiceOperatorParams) WithProxysqlVersion(proxysqlVersion *string) *VersionServiceOperatorParams { o.SetProxysqlVersion(proxysqlVersion) @@ -331,6 +401,17 @@ func (o *VersionServiceOperatorParams) SetShardingEnabled(shardingEnabled *bool) o.ShardingEnabled = shardingEnabled } +// WithSidecarsUsed adds the sidecarsUsed to the version service operator params +func (o *VersionServiceOperatorParams) WithSidecarsUsed(sidecarsUsed *bool) *VersionServiceOperatorParams { + o.SetSidecarsUsed(sidecarsUsed) + return o +} + +// SetSidecarsUsed adds the sidecarsUsed to the version service operator params +func (o *VersionServiceOperatorParams) SetSidecarsUsed(sidecarsUsed *bool) { + o.SidecarsUsed = sidecarsUsed +} + // WriteToRequest writes these params to a swagger request func (o *VersionServiceOperatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -343,153 +424,208 @@ func (o *VersionServiceOperatorParams) WriteToRequest(r runtime.ClientRequest, r // query param backupVersion var qrBackupVersion string - if o.BackupVersion != nil { qrBackupVersion = *o.BackupVersion } qBackupVersion := qrBackupVersion if qBackupVersion != "" { - if err := r.SetQueryParam("backupVersion", qBackupVersion); err != nil { return err } } + + } + + if o.BackupsEnabled != nil { + + // query param backupsEnabled + var qrBackupsEnabled bool + if o.BackupsEnabled != nil { + qrBackupsEnabled = *o.BackupsEnabled + } + qBackupsEnabled := swag.FormatBool(qrBackupsEnabled) + if qBackupsEnabled != "" { + if err := r.SetQueryParam("backupsEnabled", qBackupsEnabled); err != nil { + return err + } + } + + } + + if o.ClusterSize != nil { + + // query param clusterSize + var qrClusterSize int32 + if o.ClusterSize != nil { + qrClusterSize = *o.ClusterSize + } + qClusterSize := swag.FormatInt32(qrClusterSize) + if qClusterSize != "" { + if err := r.SetQueryParam("clusterSize", qClusterSize); err != nil { + return err + } + } + } if o.ClusterWideEnabled != nil { // query param clusterWideEnabled var qrClusterWideEnabled bool - if o.ClusterWideEnabled != nil { qrClusterWideEnabled = *o.ClusterWideEnabled } qClusterWideEnabled := swag.FormatBool(qrClusterWideEnabled) if qClusterWideEnabled != "" { - if err := r.SetQueryParam("clusterWideEnabled", qClusterWideEnabled); err != nil { return err } } + } if o.CustomResourceUID != nil { // query param customResourceUid var qrCustomResourceUID string - if o.CustomResourceUID != nil { qrCustomResourceUID = *o.CustomResourceUID } qCustomResourceUID := qrCustomResourceUID if qCustomResourceUID != "" { - if err := r.SetQueryParam("customResourceUid", qCustomResourceUID); err != nil { return err } } + } if o.DatabaseVersion != nil { // query param databaseVersion var qrDatabaseVersion string - if o.DatabaseVersion != nil { qrDatabaseVersion = *o.DatabaseVersion } qDatabaseVersion := qrDatabaseVersion if qDatabaseVersion != "" { - if err := r.SetQueryParam("databaseVersion", qDatabaseVersion); err != nil { return err } } + } if o.HaproxyVersion != nil { // query param haproxyVersion var qrHaproxyVersion string - if o.HaproxyVersion != nil { qrHaproxyVersion = *o.HaproxyVersion } qHaproxyVersion := qrHaproxyVersion if qHaproxyVersion != "" { - if err := r.SetQueryParam("haproxyVersion", qHaproxyVersion); err != nil { return err } } + } if o.HashicorpVaultEnabled != nil { // query param hashicorpVaultEnabled var qrHashicorpVaultEnabled bool - if o.HashicorpVaultEnabled != nil { qrHashicorpVaultEnabled = *o.HashicorpVaultEnabled } qHashicorpVaultEnabled := swag.FormatBool(qrHashicorpVaultEnabled) if qHashicorpVaultEnabled != "" { - if err := r.SetQueryParam("hashicorpVaultEnabled", qHashicorpVaultEnabled); err != nil { return err } } + + } + + if o.HelmDeployCr != nil { + + // query param helmDeployCr + var qrHelmDeployCr bool + if o.HelmDeployCr != nil { + qrHelmDeployCr = *o.HelmDeployCr + } + qHelmDeployCr := swag.FormatBool(qrHelmDeployCr) + if qHelmDeployCr != "" { + if err := r.SetQueryParam("helmDeployCr", qHelmDeployCr); err != nil { + return err + } + } + + } + + if o.HelmDeployOperator != nil { + + // query param helmDeployOperator + var qrHelmDeployOperator bool + if o.HelmDeployOperator != nil { + qrHelmDeployOperator = *o.HelmDeployOperator + } + qHelmDeployOperator := swag.FormatBool(qrHelmDeployOperator) + if qHelmDeployOperator != "" { + if err := r.SetQueryParam("helmDeployOperator", qHelmDeployOperator); err != nil { + return err + } + } + } if o.KubeVersion != nil { // query param kubeVersion var qrKubeVersion string - if o.KubeVersion != nil { qrKubeVersion = *o.KubeVersion } qKubeVersion := qrKubeVersion if qKubeVersion != "" { - if err := r.SetQueryParam("kubeVersion", qKubeVersion); err != nil { return err } } + } if o.LogCollectorVersion != nil { // query param logCollectorVersion var qrLogCollectorVersion string - if o.LogCollectorVersion != nil { qrLogCollectorVersion = *o.LogCollectorVersion } qLogCollectorVersion := qrLogCollectorVersion if qLogCollectorVersion != "" { - if err := r.SetQueryParam("logCollectorVersion", qLogCollectorVersion); err != nil { return err } } + } if o.NamespaceUID != nil { // query param namespaceUid var qrNamespaceUID string - if o.NamespaceUID != nil { qrNamespaceUID = *o.NamespaceUID } qNamespaceUID := qrNamespaceUID if qNamespaceUID != "" { - if err := r.SetQueryParam("namespaceUid", qNamespaceUID); err != nil { return err } } + } // path param operatorVersion @@ -497,38 +633,84 @@ func (o *VersionServiceOperatorParams) WriteToRequest(r runtime.ClientRequest, r return err } + if o.PhysicalBackupScheduled != nil { + + // query param physicalBackupScheduled + var qrPhysicalBackupScheduled bool + if o.PhysicalBackupScheduled != nil { + qrPhysicalBackupScheduled = *o.PhysicalBackupScheduled + } + qPhysicalBackupScheduled := swag.FormatBool(qrPhysicalBackupScheduled) + if qPhysicalBackupScheduled != "" { + if err := r.SetQueryParam("physicalBackupScheduled", qPhysicalBackupScheduled); err != nil { + return err + } + } + + } + + if o.PitrEnabled != nil { + + // query param pitrEnabled + var qrPitrEnabled bool + if o.PitrEnabled != nil { + qrPitrEnabled = *o.PitrEnabled + } + qPitrEnabled := swag.FormatBool(qrPitrEnabled) + if qPitrEnabled != "" { + if err := r.SetQueryParam("pitrEnabled", qPitrEnabled); err != nil { + return err + } + } + + } + if o.Platform != nil { // query param platform var qrPlatform string - if o.Platform != nil { qrPlatform = *o.Platform } qPlatform := qrPlatform if qPlatform != "" { - if err := r.SetQueryParam("platform", qPlatform); err != nil { return err } } + + } + + if o.PmmEnabled != nil { + + // query param pmmEnabled + var qrPmmEnabled bool + if o.PmmEnabled != nil { + qrPmmEnabled = *o.PmmEnabled + } + qPmmEnabled := swag.FormatBool(qrPmmEnabled) + if qPmmEnabled != "" { + if err := r.SetQueryParam("pmmEnabled", qPmmEnabled); err != nil { + return err + } + } + } if o.PmmVersion != nil { // query param pmmVersion var qrPmmVersion string - if o.PmmVersion != nil { qrPmmVersion = *o.PmmVersion } qPmmVersion := qrPmmVersion if qPmmVersion != "" { - if err := r.SetQueryParam("pmmVersion", qPmmVersion); err != nil { return err } } + } // path param product @@ -536,38 +718,68 @@ func (o *VersionServiceOperatorParams) WriteToRequest(r runtime.ClientRequest, r return err } + if o.ProxysqlScheduler != nil { + + // query param proxysqlScheduler + var qrProxysqlScheduler string + if o.ProxysqlScheduler != nil { + qrProxysqlScheduler = *o.ProxysqlScheduler + } + qProxysqlScheduler := qrProxysqlScheduler + if qProxysqlScheduler != "" { + if err := r.SetQueryParam("proxysqlScheduler", qProxysqlScheduler); err != nil { + return err + } + } + + } + if o.ProxysqlVersion != nil { // query param proxysqlVersion var qrProxysqlVersion string - if o.ProxysqlVersion != nil { qrProxysqlVersion = *o.ProxysqlVersion } qProxysqlVersion := qrProxysqlVersion if qProxysqlVersion != "" { - if err := r.SetQueryParam("proxysqlVersion", qProxysqlVersion); err != nil { return err } } + } if o.ShardingEnabled != nil { // query param shardingEnabled var qrShardingEnabled bool - if o.ShardingEnabled != nil { qrShardingEnabled = *o.ShardingEnabled } qShardingEnabled := swag.FormatBool(qrShardingEnabled) if qShardingEnabled != "" { - if err := r.SetQueryParam("shardingEnabled", qShardingEnabled); err != nil { return err } } + + } + + if o.SidecarsUsed != nil { + + // query param sidecarsUsed + var qrSidecarsUsed bool + if o.SidecarsUsed != nil { + qrSidecarsUsed = *o.SidecarsUsed + } + qSidecarsUsed := swag.FormatBool(qrSidecarsUsed) + if qSidecarsUsed != "" { + if err := r.SetQueryParam("sidecarsUsed", qSidecarsUsed); err != nil { + return err + } + } + } if len(res) > 0 { diff --git a/version/client/version_service/version_service_operator_responses.go b/version/client/version_service/version_service_operator_responses.go index 88f2a8dfcc..8c4bebb262 100644 --- a/version/client/version_service/version_service_operator_responses.go +++ b/version/client/version_service/version_service_operator_responses.go @@ -46,8 +46,7 @@ func NewVersionServiceOperatorOK() *VersionServiceOperatorOK { return &VersionServiceOperatorOK{} } -/* -VersionServiceOperatorOK describes a response with status code 200, with default header values. +/*VersionServiceOperatorOK handles this case with default header values. A successful response. */ @@ -58,6 +57,7 @@ type VersionServiceOperatorOK struct { func (o *VersionServiceOperatorOK) Error() string { return fmt.Sprintf("[GET /versions/v1/{product}/{operatorVersion}][%d] versionServiceOperatorOK %+v", 200, o.Payload) } + func (o *VersionServiceOperatorOK) GetPayload() *models.VersionOperatorResponse { return o.Payload } @@ -81,8 +81,7 @@ func NewVersionServiceOperatorDefault(code int) *VersionServiceOperatorDefault { } } -/* -VersionServiceOperatorDefault describes a response with status code -1, with default header values. +/*VersionServiceOperatorDefault handles this case with default header values. An unexpected error response */ @@ -100,6 +99,7 @@ func (o *VersionServiceOperatorDefault) Code() int { func (o *VersionServiceOperatorDefault) Error() string { return fmt.Sprintf("[GET /versions/v1/{product}/{operatorVersion}][%d] VersionService_Operator default %+v", o._statusCode, o.Payload) } + func (o *VersionServiceOperatorDefault) GetPayload() *models.GooglerpcStatus { return o.Payload } diff --git a/version/client/version_service/version_service_product_parameters.go b/version/client/version_service/version_service_product_parameters.go index cb82db85d1..e9d9fb0d3f 100644 --- a/version/client/version_service/version_service_product_parameters.go +++ b/version/client/version_service/version_service_product_parameters.go @@ -17,119 +17,102 @@ import ( "github.com/go-openapi/swag" ) -// NewVersionServiceProductParams creates a new VersionServiceProductParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewVersionServiceProductParams creates a new VersionServiceProductParams object +// with the default values initialized. func NewVersionServiceProductParams() *VersionServiceProductParams { + var () return &VersionServiceProductParams{ + timeout: cr.DefaultTimeout, } } // NewVersionServiceProductParamsWithTimeout creates a new VersionServiceProductParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewVersionServiceProductParamsWithTimeout(timeout time.Duration) *VersionServiceProductParams { + var () return &VersionServiceProductParams{ + timeout: timeout, } } // NewVersionServiceProductParamsWithContext creates a new VersionServiceProductParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewVersionServiceProductParamsWithContext(ctx context.Context) *VersionServiceProductParams { + var () return &VersionServiceProductParams{ + Context: ctx, } } // NewVersionServiceProductParamsWithHTTPClient creates a new VersionServiceProductParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewVersionServiceProductParamsWithHTTPClient(client *http.Client) *VersionServiceProductParams { + var () return &VersionServiceProductParams{ HTTPClient: client, } } -/* -VersionServiceProductParams contains all the parameters to send to the API endpoint - - for the version service product operation. - - Typically these are written to a http.Request. +/*VersionServiceProductParams contains all the parameters to send to the API endpoint +for the version service product operation typically these are written to a http.Request */ type VersionServiceProductParams struct { - // BackupVersion. + /*BackupVersion*/ BackupVersion *string - - // ClusterWideEnabled. - // - // Format: boolean + /*BackupsEnabled*/ + BackupsEnabled *bool + /*ClusterSize*/ + ClusterSize *int32 + /*ClusterWideEnabled*/ ClusterWideEnabled *bool - - // CustomResourceUID. + /*CustomResourceUID*/ CustomResourceUID *string - - // DatabaseVersion. + /*DatabaseVersion*/ DatabaseVersion *string - - // HaproxyVersion. + /*HaproxyVersion*/ HaproxyVersion *string - - // HashicorpVaultEnabled. - // - // Format: boolean + /*HashicorpVaultEnabled*/ HashicorpVaultEnabled *bool - - // KubeVersion. + /*HelmDeployCr*/ + HelmDeployCr *bool + /*HelmDeployOperator*/ + HelmDeployOperator *bool + /*KubeVersion*/ KubeVersion *string - - // LogCollectorVersion. + /*LogCollectorVersion*/ LogCollectorVersion *string - - // NamespaceUID. + /*NamespaceUID*/ NamespaceUID *string - - // Platform. + /*PhysicalBackupScheduled*/ + PhysicalBackupScheduled *bool + /*PitrEnabled*/ + PitrEnabled *bool + /*Platform*/ Platform *string - - // PmmVersion. + /*PmmEnabled*/ + PmmEnabled *bool + /*PmmVersion*/ PmmVersion *string - - // Product. + /*Product*/ Product string - - // ProxysqlVersion. + /*ProxysqlScheduler*/ + ProxysqlScheduler *string + /*ProxysqlVersion*/ ProxysqlVersion *string - - // ShardingEnabled. - // - // Format: boolean + /*ShardingEnabled*/ ShardingEnabled *bool + /*SidecarsUsed*/ + SidecarsUsed *bool timeout time.Duration Context context.Context HTTPClient *http.Client } -// WithDefaults hydrates default values in the version service product params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VersionServiceProductParams) WithDefaults() *VersionServiceProductParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the version service product params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VersionServiceProductParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the version service product params func (o *VersionServiceProductParams) WithTimeout(timeout time.Duration) *VersionServiceProductParams { o.SetTimeout(timeout) @@ -174,6 +157,28 @@ func (o *VersionServiceProductParams) SetBackupVersion(backupVersion *string) { o.BackupVersion = backupVersion } +// WithBackupsEnabled adds the backupsEnabled to the version service product params +func (o *VersionServiceProductParams) WithBackupsEnabled(backupsEnabled *bool) *VersionServiceProductParams { + o.SetBackupsEnabled(backupsEnabled) + return o +} + +// SetBackupsEnabled adds the backupsEnabled to the version service product params +func (o *VersionServiceProductParams) SetBackupsEnabled(backupsEnabled *bool) { + o.BackupsEnabled = backupsEnabled +} + +// WithClusterSize adds the clusterSize to the version service product params +func (o *VersionServiceProductParams) WithClusterSize(clusterSize *int32) *VersionServiceProductParams { + o.SetClusterSize(clusterSize) + return o +} + +// SetClusterSize adds the clusterSize to the version service product params +func (o *VersionServiceProductParams) SetClusterSize(clusterSize *int32) { + o.ClusterSize = clusterSize +} + // WithClusterWideEnabled adds the clusterWideEnabled to the version service product params func (o *VersionServiceProductParams) WithClusterWideEnabled(clusterWideEnabled *bool) *VersionServiceProductParams { o.SetClusterWideEnabled(clusterWideEnabled) @@ -229,6 +234,28 @@ func (o *VersionServiceProductParams) SetHashicorpVaultEnabled(hashicorpVaultEna o.HashicorpVaultEnabled = hashicorpVaultEnabled } +// WithHelmDeployCr adds the helmDeployCr to the version service product params +func (o *VersionServiceProductParams) WithHelmDeployCr(helmDeployCr *bool) *VersionServiceProductParams { + o.SetHelmDeployCr(helmDeployCr) + return o +} + +// SetHelmDeployCr adds the helmDeployCr to the version service product params +func (o *VersionServiceProductParams) SetHelmDeployCr(helmDeployCr *bool) { + o.HelmDeployCr = helmDeployCr +} + +// WithHelmDeployOperator adds the helmDeployOperator to the version service product params +func (o *VersionServiceProductParams) WithHelmDeployOperator(helmDeployOperator *bool) *VersionServiceProductParams { + o.SetHelmDeployOperator(helmDeployOperator) + return o +} + +// SetHelmDeployOperator adds the helmDeployOperator to the version service product params +func (o *VersionServiceProductParams) SetHelmDeployOperator(helmDeployOperator *bool) { + o.HelmDeployOperator = helmDeployOperator +} + // WithKubeVersion adds the kubeVersion to the version service product params func (o *VersionServiceProductParams) WithKubeVersion(kubeVersion *string) *VersionServiceProductParams { o.SetKubeVersion(kubeVersion) @@ -262,6 +289,28 @@ func (o *VersionServiceProductParams) SetNamespaceUID(namespaceUID *string) { o.NamespaceUID = namespaceUID } +// WithPhysicalBackupScheduled adds the physicalBackupScheduled to the version service product params +func (o *VersionServiceProductParams) WithPhysicalBackupScheduled(physicalBackupScheduled *bool) *VersionServiceProductParams { + o.SetPhysicalBackupScheduled(physicalBackupScheduled) + return o +} + +// SetPhysicalBackupScheduled adds the physicalBackupScheduled to the version service product params +func (o *VersionServiceProductParams) SetPhysicalBackupScheduled(physicalBackupScheduled *bool) { + o.PhysicalBackupScheduled = physicalBackupScheduled +} + +// WithPitrEnabled adds the pitrEnabled to the version service product params +func (o *VersionServiceProductParams) WithPitrEnabled(pitrEnabled *bool) *VersionServiceProductParams { + o.SetPitrEnabled(pitrEnabled) + return o +} + +// SetPitrEnabled adds the pitrEnabled to the version service product params +func (o *VersionServiceProductParams) SetPitrEnabled(pitrEnabled *bool) { + o.PitrEnabled = pitrEnabled +} + // WithPlatform adds the platform to the version service product params func (o *VersionServiceProductParams) WithPlatform(platform *string) *VersionServiceProductParams { o.SetPlatform(platform) @@ -273,6 +322,17 @@ func (o *VersionServiceProductParams) SetPlatform(platform *string) { o.Platform = platform } +// WithPmmEnabled adds the pmmEnabled to the version service product params +func (o *VersionServiceProductParams) WithPmmEnabled(pmmEnabled *bool) *VersionServiceProductParams { + o.SetPmmEnabled(pmmEnabled) + return o +} + +// SetPmmEnabled adds the pmmEnabled to the version service product params +func (o *VersionServiceProductParams) SetPmmEnabled(pmmEnabled *bool) { + o.PmmEnabled = pmmEnabled +} + // WithPmmVersion adds the pmmVersion to the version service product params func (o *VersionServiceProductParams) WithPmmVersion(pmmVersion *string) *VersionServiceProductParams { o.SetPmmVersion(pmmVersion) @@ -295,6 +355,17 @@ func (o *VersionServiceProductParams) SetProduct(product string) { o.Product = product } +// WithProxysqlScheduler adds the proxysqlScheduler to the version service product params +func (o *VersionServiceProductParams) WithProxysqlScheduler(proxysqlScheduler *string) *VersionServiceProductParams { + o.SetProxysqlScheduler(proxysqlScheduler) + return o +} + +// SetProxysqlScheduler adds the proxysqlScheduler to the version service product params +func (o *VersionServiceProductParams) SetProxysqlScheduler(proxysqlScheduler *string) { + o.ProxysqlScheduler = proxysqlScheduler +} + // WithProxysqlVersion adds the proxysqlVersion to the version service product params func (o *VersionServiceProductParams) WithProxysqlVersion(proxysqlVersion *string) *VersionServiceProductParams { o.SetProxysqlVersion(proxysqlVersion) @@ -317,6 +388,17 @@ func (o *VersionServiceProductParams) SetShardingEnabled(shardingEnabled *bool) o.ShardingEnabled = shardingEnabled } +// WithSidecarsUsed adds the sidecarsUsed to the version service product params +func (o *VersionServiceProductParams) WithSidecarsUsed(sidecarsUsed *bool) *VersionServiceProductParams { + o.SetSidecarsUsed(sidecarsUsed) + return o +} + +// SetSidecarsUsed adds the sidecarsUsed to the version service product params +func (o *VersionServiceProductParams) SetSidecarsUsed(sidecarsUsed *bool) { + o.SidecarsUsed = sidecarsUsed +} + // WriteToRequest writes these params to a swagger request func (o *VersionServiceProductParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -329,187 +411,288 @@ func (o *VersionServiceProductParams) WriteToRequest(r runtime.ClientRequest, re // query param backupVersion var qrBackupVersion string - if o.BackupVersion != nil { qrBackupVersion = *o.BackupVersion } qBackupVersion := qrBackupVersion if qBackupVersion != "" { - if err := r.SetQueryParam("backupVersion", qBackupVersion); err != nil { return err } } + + } + + if o.BackupsEnabled != nil { + + // query param backupsEnabled + var qrBackupsEnabled bool + if o.BackupsEnabled != nil { + qrBackupsEnabled = *o.BackupsEnabled + } + qBackupsEnabled := swag.FormatBool(qrBackupsEnabled) + if qBackupsEnabled != "" { + if err := r.SetQueryParam("backupsEnabled", qBackupsEnabled); err != nil { + return err + } + } + + } + + if o.ClusterSize != nil { + + // query param clusterSize + var qrClusterSize int32 + if o.ClusterSize != nil { + qrClusterSize = *o.ClusterSize + } + qClusterSize := swag.FormatInt32(qrClusterSize) + if qClusterSize != "" { + if err := r.SetQueryParam("clusterSize", qClusterSize); err != nil { + return err + } + } + } if o.ClusterWideEnabled != nil { // query param clusterWideEnabled var qrClusterWideEnabled bool - if o.ClusterWideEnabled != nil { qrClusterWideEnabled = *o.ClusterWideEnabled } qClusterWideEnabled := swag.FormatBool(qrClusterWideEnabled) if qClusterWideEnabled != "" { - if err := r.SetQueryParam("clusterWideEnabled", qClusterWideEnabled); err != nil { return err } } + } if o.CustomResourceUID != nil { // query param customResourceUid var qrCustomResourceUID string - if o.CustomResourceUID != nil { qrCustomResourceUID = *o.CustomResourceUID } qCustomResourceUID := qrCustomResourceUID if qCustomResourceUID != "" { - if err := r.SetQueryParam("customResourceUid", qCustomResourceUID); err != nil { return err } } + } if o.DatabaseVersion != nil { // query param databaseVersion var qrDatabaseVersion string - if o.DatabaseVersion != nil { qrDatabaseVersion = *o.DatabaseVersion } qDatabaseVersion := qrDatabaseVersion if qDatabaseVersion != "" { - if err := r.SetQueryParam("databaseVersion", qDatabaseVersion); err != nil { return err } } + } if o.HaproxyVersion != nil { // query param haproxyVersion var qrHaproxyVersion string - if o.HaproxyVersion != nil { qrHaproxyVersion = *o.HaproxyVersion } qHaproxyVersion := qrHaproxyVersion if qHaproxyVersion != "" { - if err := r.SetQueryParam("haproxyVersion", qHaproxyVersion); err != nil { return err } } + } if o.HashicorpVaultEnabled != nil { // query param hashicorpVaultEnabled var qrHashicorpVaultEnabled bool - if o.HashicorpVaultEnabled != nil { qrHashicorpVaultEnabled = *o.HashicorpVaultEnabled } qHashicorpVaultEnabled := swag.FormatBool(qrHashicorpVaultEnabled) if qHashicorpVaultEnabled != "" { - if err := r.SetQueryParam("hashicorpVaultEnabled", qHashicorpVaultEnabled); err != nil { return err } } + + } + + if o.HelmDeployCr != nil { + + // query param helmDeployCr + var qrHelmDeployCr bool + if o.HelmDeployCr != nil { + qrHelmDeployCr = *o.HelmDeployCr + } + qHelmDeployCr := swag.FormatBool(qrHelmDeployCr) + if qHelmDeployCr != "" { + if err := r.SetQueryParam("helmDeployCr", qHelmDeployCr); err != nil { + return err + } + } + + } + + if o.HelmDeployOperator != nil { + + // query param helmDeployOperator + var qrHelmDeployOperator bool + if o.HelmDeployOperator != nil { + qrHelmDeployOperator = *o.HelmDeployOperator + } + qHelmDeployOperator := swag.FormatBool(qrHelmDeployOperator) + if qHelmDeployOperator != "" { + if err := r.SetQueryParam("helmDeployOperator", qHelmDeployOperator); err != nil { + return err + } + } + } if o.KubeVersion != nil { // query param kubeVersion var qrKubeVersion string - if o.KubeVersion != nil { qrKubeVersion = *o.KubeVersion } qKubeVersion := qrKubeVersion if qKubeVersion != "" { - if err := r.SetQueryParam("kubeVersion", qKubeVersion); err != nil { return err } } + } if o.LogCollectorVersion != nil { // query param logCollectorVersion var qrLogCollectorVersion string - if o.LogCollectorVersion != nil { qrLogCollectorVersion = *o.LogCollectorVersion } qLogCollectorVersion := qrLogCollectorVersion if qLogCollectorVersion != "" { - if err := r.SetQueryParam("logCollectorVersion", qLogCollectorVersion); err != nil { return err } } + } if o.NamespaceUID != nil { // query param namespaceUid var qrNamespaceUID string - if o.NamespaceUID != nil { qrNamespaceUID = *o.NamespaceUID } qNamespaceUID := qrNamespaceUID if qNamespaceUID != "" { - if err := r.SetQueryParam("namespaceUid", qNamespaceUID); err != nil { return err } } + + } + + if o.PhysicalBackupScheduled != nil { + + // query param physicalBackupScheduled + var qrPhysicalBackupScheduled bool + if o.PhysicalBackupScheduled != nil { + qrPhysicalBackupScheduled = *o.PhysicalBackupScheduled + } + qPhysicalBackupScheduled := swag.FormatBool(qrPhysicalBackupScheduled) + if qPhysicalBackupScheduled != "" { + if err := r.SetQueryParam("physicalBackupScheduled", qPhysicalBackupScheduled); err != nil { + return err + } + } + + } + + if o.PitrEnabled != nil { + + // query param pitrEnabled + var qrPitrEnabled bool + if o.PitrEnabled != nil { + qrPitrEnabled = *o.PitrEnabled + } + qPitrEnabled := swag.FormatBool(qrPitrEnabled) + if qPitrEnabled != "" { + if err := r.SetQueryParam("pitrEnabled", qPitrEnabled); err != nil { + return err + } + } + } if o.Platform != nil { // query param platform var qrPlatform string - if o.Platform != nil { qrPlatform = *o.Platform } qPlatform := qrPlatform if qPlatform != "" { - if err := r.SetQueryParam("platform", qPlatform); err != nil { return err } } + + } + + if o.PmmEnabled != nil { + + // query param pmmEnabled + var qrPmmEnabled bool + if o.PmmEnabled != nil { + qrPmmEnabled = *o.PmmEnabled + } + qPmmEnabled := swag.FormatBool(qrPmmEnabled) + if qPmmEnabled != "" { + if err := r.SetQueryParam("pmmEnabled", qPmmEnabled); err != nil { + return err + } + } + } if o.PmmVersion != nil { // query param pmmVersion var qrPmmVersion string - if o.PmmVersion != nil { qrPmmVersion = *o.PmmVersion } qPmmVersion := qrPmmVersion if qPmmVersion != "" { - if err := r.SetQueryParam("pmmVersion", qPmmVersion); err != nil { return err } } + } // path param product @@ -517,38 +700,68 @@ func (o *VersionServiceProductParams) WriteToRequest(r runtime.ClientRequest, re return err } + if o.ProxysqlScheduler != nil { + + // query param proxysqlScheduler + var qrProxysqlScheduler string + if o.ProxysqlScheduler != nil { + qrProxysqlScheduler = *o.ProxysqlScheduler + } + qProxysqlScheduler := qrProxysqlScheduler + if qProxysqlScheduler != "" { + if err := r.SetQueryParam("proxysqlScheduler", qProxysqlScheduler); err != nil { + return err + } + } + + } + if o.ProxysqlVersion != nil { // query param proxysqlVersion var qrProxysqlVersion string - if o.ProxysqlVersion != nil { qrProxysqlVersion = *o.ProxysqlVersion } qProxysqlVersion := qrProxysqlVersion if qProxysqlVersion != "" { - if err := r.SetQueryParam("proxysqlVersion", qProxysqlVersion); err != nil { return err } } + } if o.ShardingEnabled != nil { // query param shardingEnabled var qrShardingEnabled bool - if o.ShardingEnabled != nil { qrShardingEnabled = *o.ShardingEnabled } qShardingEnabled := swag.FormatBool(qrShardingEnabled) if qShardingEnabled != "" { - if err := r.SetQueryParam("shardingEnabled", qShardingEnabled); err != nil { return err } } + + } + + if o.SidecarsUsed != nil { + + // query param sidecarsUsed + var qrSidecarsUsed bool + if o.SidecarsUsed != nil { + qrSidecarsUsed = *o.SidecarsUsed + } + qSidecarsUsed := swag.FormatBool(qrSidecarsUsed) + if qSidecarsUsed != "" { + if err := r.SetQueryParam("sidecarsUsed", qSidecarsUsed); err != nil { + return err + } + } + } if len(res) > 0 { diff --git a/version/client/version_service/version_service_product_responses.go b/version/client/version_service/version_service_product_responses.go index 74b9e8e4f5..5a1183e37d 100644 --- a/version/client/version_service/version_service_product_responses.go +++ b/version/client/version_service/version_service_product_responses.go @@ -46,8 +46,7 @@ func NewVersionServiceProductOK() *VersionServiceProductOK { return &VersionServiceProductOK{} } -/* -VersionServiceProductOK describes a response with status code 200, with default header values. +/*VersionServiceProductOK handles this case with default header values. A successful response. */ @@ -58,6 +57,7 @@ type VersionServiceProductOK struct { func (o *VersionServiceProductOK) Error() string { return fmt.Sprintf("[GET /versions/v1/{product}][%d] versionServiceProductOK %+v", 200, o.Payload) } + func (o *VersionServiceProductOK) GetPayload() *models.VersionProductResponse { return o.Payload } @@ -81,8 +81,7 @@ func NewVersionServiceProductDefault(code int) *VersionServiceProductDefault { } } -/* -VersionServiceProductDefault describes a response with status code -1, with default header values. +/*VersionServiceProductDefault handles this case with default header values. An unexpected error response */ @@ -100,6 +99,7 @@ func (o *VersionServiceProductDefault) Code() int { func (o *VersionServiceProductDefault) Error() string { return fmt.Sprintf("[GET /versions/v1/{product}][%d] VersionService_Product default %+v", o._statusCode, o.Payload) } + func (o *VersionServiceProductDefault) GetPayload() *models.GooglerpcStatus { return o.Payload } From b0cae122a391bbdf4ea4fe30b97ccd292dd72ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20G=C3=BCne=C5=9F?= Date: Wed, 14 Jun 2023 11:23:10 +0300 Subject: [PATCH 5/7] address review comments --- pkg/apis/pxc/v1/pxc_types.go | 2 +- pkg/pxc/app/statefulset/proxysql.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/apis/pxc/v1/pxc_types.go b/pkg/apis/pxc/v1/pxc_types.go index 94dff7a6e9..0bb2644798 100644 --- a/pkg/apis/pxc/v1/pxc_types.go +++ b/pkg/apis/pxc/v1/pxc_types.go @@ -819,7 +819,7 @@ func (cr *PerconaXtraDBCluster) CheckNSetDefaults(serverVersion *version.ServerV c.ProxySQL.ImagePullPolicy = corev1.PullAlways } - if cr.CompareVersionWith("1.12.0") >= 0 && len(c.ProxySQL.PXCHandler) == 0 { + if cr.CompareVersionWith("1.13.0") >= 0 && len(c.ProxySQL.PXCHandler) == 0 { c.ProxySQL.PXCHandler = "internal" } diff --git a/pkg/pxc/app/statefulset/proxysql.go b/pkg/pxc/app/statefulset/proxysql.go index c3683f7e5f..d8094fe5c3 100644 --- a/pkg/pxc/app/statefulset/proxysql.go +++ b/pkg/pxc/app/statefulset/proxysql.go @@ -147,7 +147,7 @@ func (c *Proxy) AppContainer(spec *api.PodSpec, secrets string, cr *api.PerconaX } } - if cr.CompareVersionWith("1.12.0") >= 0 { + if cr.CompareVersionWith("1.13.0") >= 0 { appc.Env = append(appc.Env, corev1.EnvVar{ Name: "PXC_HANDLER", Value: cr.Spec.ProxySQL.PXCHandler, @@ -244,7 +244,7 @@ func (c *Proxy) SidecarContainers(spec *api.PodSpec, secrets string, cr *api.Per }, } - if cr.CompareVersionWith("1.12.0") >= 0 { + if cr.CompareVersionWith("1.13.0") >= 0 { pxcMonit.Env = append(pxcMonit.Env, corev1.EnvVar{ Name: "PXC_HANDLER", Value: cr.Spec.ProxySQL.PXCHandler, From dc30831103a3c22a52941f0c7484c7b0c9ca3f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20G=C3=BCne=C5=9F?= Date: Wed, 14 Jun 2023 11:27:57 +0300 Subject: [PATCH 6/7] add constants for pxc handler --- pkg/apis/pxc/v1/pxc_types.go | 9 ++++++++- pkg/controller/pxc/upgrade.go | 2 +- pkg/controller/pxc/users.go | 2 +- pkg/pxc/app/statefulset/proxysql.go | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pkg/apis/pxc/v1/pxc_types.go b/pkg/apis/pxc/v1/pxc_types.go index 0bb2644798..e22af97cc5 100644 --- a/pkg/apis/pxc/v1/pxc_types.go +++ b/pkg/apis/pxc/v1/pxc_types.go @@ -448,6 +448,13 @@ type ProxySQLSpec struct { PXCHandler string `json:"pxchandler,omitempty"` } +const ( + // ProxySQL's internal PXC handler + PXCHandlerInternal = "internal" + // Percona's scheduler + PXCHandlerScheduler = "scheduler" +) + type PodDisruptionBudgetSpec struct { MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"` MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` @@ -820,7 +827,7 @@ func (cr *PerconaXtraDBCluster) CheckNSetDefaults(serverVersion *version.ServerV } if cr.CompareVersionWith("1.13.0") >= 0 && len(c.ProxySQL.PXCHandler) == 0 { - c.ProxySQL.PXCHandler = "internal" + c.ProxySQL.PXCHandler = PXCHandlerInternal } c.ProxySQL.VolumeSpec.reconcileOpts() diff --git a/pkg/controller/pxc/upgrade.go b/pkg/controller/pxc/upgrade.go index 16821b3dab..6cc7297238 100644 --- a/pkg/controller/pxc/upgrade.go +++ b/pkg/controller/pxc/upgrade.go @@ -366,7 +366,7 @@ func (r *ReconcilePerconaXtraDBCluster) applyNWait(ctx context.Context, cr *api. return errors.Wrap(err, "failed to wait pxc sync") } - if cr.Spec.ProxySQL.PXCHandler == "internal" { + if cr.Spec.ProxySQL.PXCHandler == api.PXCHandlerInternal { if err := r.waitHostgroups(ctx, cr, sfs.Name, pod, waitLimit); err != nil { return errors.Wrap(err, "failed to wait hostgroups status") } diff --git a/pkg/controller/pxc/users.go b/pkg/controller/pxc/users.go index 1029fe1310..050a19c9d0 100644 --- a/pkg/controller/pxc/users.go +++ b/pkg/controller/pxc/users.go @@ -995,7 +995,7 @@ func (r *ReconcilePerconaXtraDBCluster) syncPXCUsersWithProxySQL(ctx context.Con } var errb, outb bytes.Buffer - if cr.Spec.ProxySQL.PXCHandler == "scheduler" { + if cr.Spec.ProxySQL.PXCHandler == api.PXCHandlerScheduler { var db queries.Database var hasLock bool diff --git a/pkg/pxc/app/statefulset/proxysql.go b/pkg/pxc/app/statefulset/proxysql.go index d8094fe5c3..3dd4347b0b 100644 --- a/pkg/pxc/app/statefulset/proxysql.go +++ b/pkg/pxc/app/statefulset/proxysql.go @@ -253,7 +253,7 @@ func (c *Proxy) SidecarContainers(spec *api.PodSpec, secrets string, cr *api.Per Name: "PXC_HANDLER", Value: cr.Spec.ProxySQL.PXCHandler, }) - if cr.Spec.ProxySQL.PXCHandler == "scheduler" { + if cr.Spec.ProxySQL.PXCHandler == api.PXCHandlerScheduler { volMounts := []corev1.VolumeMount{ { Name: "ssl", From 1de6526a17773e328821e758b5834f9480f2ea72 Mon Sep 17 00:00:00 2001 From: Viacheslav Sarzhan Date: Wed, 14 Jun 2023 21:28:58 +0300 Subject: [PATCH 7/7] fix upgrade-consistency and upgrade-proxysql test --- .../compare/statefulset_some-name-proxysql-1120-oc.yml | 4 ---- .../compare/statefulset_some-name-proxysql-1120.yml | 6 +----- e2e-tests/upgrade-proxysql/run | 5 ++++- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120-oc.yml b/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120-oc.yml index edfeee687e..b3b7ccc5fd 100644 --- a/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120-oc.yml +++ b/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120-oc.yml @@ -62,8 +62,6 @@ spec: secretKeyRef: key: monitor name: internal-some-name - - name: PXC_HANDLER - value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql @@ -117,8 +115,6 @@ spec: secretKeyRef: key: monitor name: internal-some-name - - name: PXC_HANDLER - value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql diff --git a/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120.yml b/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120.yml index a937c33885..be6397b47a 100644 --- a/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120.yml +++ b/e2e-tests/upgrade-consistency/compare/statefulset_some-name-proxysql-1120.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: annotations: {} - generation: 3 + generation: 1 name: some-name-proxysql ownerReferences: - controller: true @@ -62,8 +62,6 @@ spec: secretKeyRef: key: monitor name: internal-some-name - - name: PXC_HANDLER - value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql @@ -117,8 +115,6 @@ spec: secretKeyRef: key: monitor name: internal-some-name - - name: PXC_HANDLER - value: internal envFrom: - secretRef: name: some-name-env-vars-proxysql diff --git a/e2e-tests/upgrade-proxysql/run b/e2e-tests/upgrade-proxysql/run index 06227bc391..1d782a6944 100755 --- a/e2e-tests/upgrade-proxysql/run +++ b/e2e-tests/upgrade-proxysql/run @@ -100,8 +100,11 @@ function main() { echo 'Operator image has not been updated' exit 1 fi - compare_generation "1" "${proxy}" "${CLUSTER}" + #we need to wait to make sure that sts will not be updated later + sleep 30 + + compare_generation "1" "${proxy}" "${CLUSTER}" desc 'patch pxc images and upgrade' kubectl_bin patch pxc "${CLUSTER}" --type=merge --patch '{ "spec": {