diff --git a/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml b/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml index cd2db07849..a20b0b7092 100644 --- a/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml +++ b/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml @@ -4080,6 +4080,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 501460435b..29b2975502 100644 --- a/deploy/bundle.yaml +++ b/deploy/bundle.yaml @@ -4817,6 +4817,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 167c456ee0..55192e6c6f 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 d13aeb554b..22ade32720 100644 --- a/deploy/crd.yaml +++ b/deploy/crd.yaml @@ -4817,6 +4817,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 d4733affb7..49974cb6de 100644 --- a/deploy/cw-bundle.yaml +++ b/deploy/cw-bundle.yaml @@ -4817,6 +4817,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 bb57ef6f3b..1cca02603c 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 d6c782395a..69b788baea 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 3cd0ab3c2e..4f9ef30666 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 5fe23d7005..8e0d07818d 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 cfe333a9b1..1ca2f4c6d8 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 9c16936710..2b1054c74f 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 1e07819a35..09667159f5 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 f79c0b6c60..316d5d90df 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 3456530861..27c672fa1e 100755 --- a/e2e-tests/functions +++ b/e2e-tests/functions @@ -561,12 +561,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 8da68f47a8..35e44c66fb 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 bccb37b9c7..2bda68ce44 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 b411097cea..1ba1225520 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 ac0cee0095..1b8e9d3ac4 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 91d98dc13c..b04b576e0a 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 d01e35162c..3e15b8ea84 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 ca990a79a3..c74b87a082 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 026c73d3ef..5dbbfd9271 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 a121acab72..fb86b27405 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 6b86908b72..bb0c9004ab 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 d2b30c6490..3a607ceb93 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 7e37d73d83..66eb43d390 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 d2b30c6490..3a607ceb93 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 7e37d73d83..66eb43d390 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 729258d00e..70e902ae89 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 86c3fbe87a..d35bbc155c 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 65eeb4636a..e61ba9ca10 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 262f17de2d..090ec5996e 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 c09038eb04..dc623d5e62 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 a970162ea9..7042fc1b41 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 8ac10b315d..2e1c4ec077 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 5f0e849841..bfb59775f7 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 8ac10b315d..2e1c4ec077 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 b2aa11c5af..24976d420c 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 6d2c0d01d9..4212a39ba4 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 10214cc90d..dab545a140 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 fc0760a79a..7f1b07fad6 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 87d72b541b..9ea7c47f2b 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..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 @@ -148,6 +148,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..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 @@ -148,6 +148,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 8a84374989..62ec76717e 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 5b4d0d38b8..bfce6981df 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/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": { diff --git a/pkg/apis/pxc/v1/pxc_types.go b/pkg/apis/pxc/v1/pxc_types.go index 14e213adcb..e22af97cc5 100644 --- a/pkg/apis/pxc/v1/pxc_types.go +++ b/pkg/apis/pxc/v1/pxc_types.go @@ -34,7 +34,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"` @@ -442,6 +442,19 @@ type HAProxySpec struct { ReplicasLoadBalancerIP string `json:"replicasLoadBalancerIP,omitempty"` } +type ProxySQLSpec struct { + PodSpec `json:",inline"` + // +kubebuilder:validation:Enum={internal,scheduler} + 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"` @@ -813,6 +826,10 @@ func (cr *PerconaXtraDBCluster) CheckNSetDefaults(serverVersion *version.ServerV c.ProxySQL.ImagePullPolicy = corev1.PullAlways } + if cr.CompareVersionWith("1.13.0") >= 0 && len(c.ProxySQL.PXCHandler) == 0 { + c.ProxySQL.PXCHandler = PXCHandlerInternal + } + 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 aac9ddf1d6..f3d8632993 100644 --- a/pkg/apis/pxc/v1/zz_generated.deepcopy.go +++ b/pkg/apis/pxc/v1/zz_generated.deepcopy.go @@ -695,7 +695,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 { @@ -985,6 +985,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 d9135ed502..53041f0a2a 100644 --- a/pkg/controller/pxc/controller.go +++ b/pkg/controller/pxc/controller.go @@ -364,7 +364,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, proxyInits) + err = r.updatePod(ctx, proxysqlSet, &o.Spec.ProxySQL.PodSpec, o, proxyInits) if err != nil { return reconcile.Result{}, errors.Wrap(err, "ProxySQL upgrade error") } @@ -673,7 +673,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, proxyInits, log, r.getConfigVolume) + proxySet, err := pxc.StatefulSet(sfsProxy, &cr.Spec.ProxySQL.PodSpec, cr, secrets, proxyInits, 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 f194d11e27..5c8ab62d34 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 f79094507d..ae97028788 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 fed8e7ddc6..6cc7297238 100644 --- a/pkg/controller/pxc/upgrade.go +++ b/pkg/controller/pxc/upgrade.go @@ -366,8 +366,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 == api.PXCHandlerInternal { + 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 f3df49dc03..050a19c9d0 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,36 @@ func (r *ReconcilePerconaXtraDBCluster) syncPXCUsersWithProxySQL(ctx context.Con } else if err != nil { 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 == api.PXCHandlerScheduler { + 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) + } if err != nil { return errors.Errorf("exec syncusers: %v / %s / %s", err, outb.String(), errb.String()) } 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/pkg/pxc/app/statefulset/proxysql.go b/pkg/pxc/app/statefulset/proxysql.go index ae74e7b130..3dd4347b0b 100644 --- a/pkg/pxc/app/statefulset/proxysql.go +++ b/pkg/pxc/app/statefulset/proxysql.go @@ -147,6 +147,13 @@ func (c *Proxy) AppContainer(spec *api.PodSpec, secrets string, cr *api.PerconaX } } + if cr.CompareVersionWith("1.13.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", @@ -236,6 +243,30 @@ func (c *Proxy) SidecarContainers(spec *api.PodSpec, secrets string, cr *api.Per }, }, } + + if cr.CompareVersionWith("1.13.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 == api.PXCHandlerScheduler { + 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", 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 +} 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 }