Skip to content

Commit 56cbc36

Browse files
pooknullhors
andauthored
K8SPG-680: add ReadyForBackup condition to the pg-cluster (#1133)
* K8SPG-680: add `ReadyForBackup` condition to the `pg-cluster` https://perconadev.atlassian.net/browse/K8SPG-680 * add unit-tests * fix lint * fix lint * improve unit-test --------- Co-authored-by: Viacheslav Sarzhan <[email protected]>
1 parent 8102bf5 commit 56cbc36

File tree

18 files changed

+797
-86
lines changed

18 files changed

+797
-86
lines changed

Diff for: build/crd/percona/generated/pgv2.percona.com_perconapgclusters.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -18321,6 +18321,62 @@ spec:
1832118321
!has(u.grantPublicSchemaAccess) || !u.grantPublicSchemaAccess)'
1832218322
status:
1832318323
properties:
18324+
conditions:
18325+
items:
18326+
description: Condition contains details for one aspect of the current
18327+
state of this API Resource.
18328+
properties:
18329+
lastTransitionTime:
18330+
description: |-
18331+
lastTransitionTime is the last time the condition transitioned from one status to another.
18332+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
18333+
format: date-time
18334+
type: string
18335+
message:
18336+
description: |-
18337+
message is a human readable message indicating details about the transition.
18338+
This may be an empty string.
18339+
maxLength: 32768
18340+
type: string
18341+
observedGeneration:
18342+
description: |-
18343+
observedGeneration represents the .metadata.generation that the condition was set based upon.
18344+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
18345+
with respect to the current state of the instance.
18346+
format: int64
18347+
minimum: 0
18348+
type: integer
18349+
reason:
18350+
description: |-
18351+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
18352+
Producers of specific condition types may define expected values and meanings for this field,
18353+
and whether the values are considered a guaranteed API.
18354+
The value should be a CamelCase string.
18355+
This field may not be empty.
18356+
maxLength: 1024
18357+
minLength: 1
18358+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
18359+
type: string
18360+
status:
18361+
description: status of the condition, one of True, False, Unknown.
18362+
enum:
18363+
- "True"
18364+
- "False"
18365+
- Unknown
18366+
type: string
18367+
type:
18368+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
18369+
maxLength: 316
18370+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
18371+
type: string
18372+
required:
18373+
- lastTransitionTime
18374+
- message
18375+
- reason
18376+
- status
18377+
- type
18378+
type: object
18379+
type: array
1832418380
host:
1832518381
type: string
1832618382
installedCustomExtensions:

Diff for: config/crd/bases/pgv2.percona.com_perconapgclusters.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -18728,6 +18728,62 @@ spec:
1872818728
!has(u.grantPublicSchemaAccess) || !u.grantPublicSchemaAccess)'
1872918729
status:
1873018730
properties:
18731+
conditions:
18732+
items:
18733+
description: Condition contains details for one aspect of the current
18734+
state of this API Resource.
18735+
properties:
18736+
lastTransitionTime:
18737+
description: |-
18738+
lastTransitionTime is the last time the condition transitioned from one status to another.
18739+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
18740+
format: date-time
18741+
type: string
18742+
message:
18743+
description: |-
18744+
message is a human readable message indicating details about the transition.
18745+
This may be an empty string.
18746+
maxLength: 32768
18747+
type: string
18748+
observedGeneration:
18749+
description: |-
18750+
observedGeneration represents the .metadata.generation that the condition was set based upon.
18751+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
18752+
with respect to the current state of the instance.
18753+
format: int64
18754+
minimum: 0
18755+
type: integer
18756+
reason:
18757+
description: |-
18758+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
18759+
Producers of specific condition types may define expected values and meanings for this field,
18760+
and whether the values are considered a guaranteed API.
18761+
The value should be a CamelCase string.
18762+
This field may not be empty.
18763+
maxLength: 1024
18764+
minLength: 1
18765+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
18766+
type: string
18767+
status:
18768+
description: status of the condition, one of True, False, Unknown.
18769+
enum:
18770+
- "True"
18771+
- "False"
18772+
- Unknown
18773+
type: string
18774+
type:
18775+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
18776+
maxLength: 316
18777+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
18778+
type: string
18779+
required:
18780+
- lastTransitionTime
18781+
- message
18782+
- reason
18783+
- status
18784+
- type
18785+
type: object
18786+
type: array
1873118787
host:
1873218788
type: string
1873318789
installedCustomExtensions:

Diff for: deploy/bundle.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -19025,6 +19025,62 @@ spec:
1902519025
!has(u.grantPublicSchemaAccess) || !u.grantPublicSchemaAccess)'
1902619026
status:
1902719027
properties:
19028+
conditions:
19029+
items:
19030+
description: Condition contains details for one aspect of the current
19031+
state of this API Resource.
19032+
properties:
19033+
lastTransitionTime:
19034+
description: |-
19035+
lastTransitionTime is the last time the condition transitioned from one status to another.
19036+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
19037+
format: date-time
19038+
type: string
19039+
message:
19040+
description: |-
19041+
message is a human readable message indicating details about the transition.
19042+
This may be an empty string.
19043+
maxLength: 32768
19044+
type: string
19045+
observedGeneration:
19046+
description: |-
19047+
observedGeneration represents the .metadata.generation that the condition was set based upon.
19048+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
19049+
with respect to the current state of the instance.
19050+
format: int64
19051+
minimum: 0
19052+
type: integer
19053+
reason:
19054+
description: |-
19055+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
19056+
Producers of specific condition types may define expected values and meanings for this field,
19057+
and whether the values are considered a guaranteed API.
19058+
The value should be a CamelCase string.
19059+
This field may not be empty.
19060+
maxLength: 1024
19061+
minLength: 1
19062+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
19063+
type: string
19064+
status:
19065+
description: status of the condition, one of True, False, Unknown.
19066+
enum:
19067+
- "True"
19068+
- "False"
19069+
- Unknown
19070+
type: string
19071+
type:
19072+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
19073+
maxLength: 316
19074+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
19075+
type: string
19076+
required:
19077+
- lastTransitionTime
19078+
- message
19079+
- reason
19080+
- status
19081+
- type
19082+
type: object
19083+
type: array
1902819084
host:
1902919085
type: string
1903019086
installedCustomExtensions:

Diff for: deploy/crd.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -19025,6 +19025,62 @@ spec:
1902519025
!has(u.grantPublicSchemaAccess) || !u.grantPublicSchemaAccess)'
1902619026
status:
1902719027
properties:
19028+
conditions:
19029+
items:
19030+
description: Condition contains details for one aspect of the current
19031+
state of this API Resource.
19032+
properties:
19033+
lastTransitionTime:
19034+
description: |-
19035+
lastTransitionTime is the last time the condition transitioned from one status to another.
19036+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
19037+
format: date-time
19038+
type: string
19039+
message:
19040+
description: |-
19041+
message is a human readable message indicating details about the transition.
19042+
This may be an empty string.
19043+
maxLength: 32768
19044+
type: string
19045+
observedGeneration:
19046+
description: |-
19047+
observedGeneration represents the .metadata.generation that the condition was set based upon.
19048+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
19049+
with respect to the current state of the instance.
19050+
format: int64
19051+
minimum: 0
19052+
type: integer
19053+
reason:
19054+
description: |-
19055+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
19056+
Producers of specific condition types may define expected values and meanings for this field,
19057+
and whether the values are considered a guaranteed API.
19058+
The value should be a CamelCase string.
19059+
This field may not be empty.
19060+
maxLength: 1024
19061+
minLength: 1
19062+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
19063+
type: string
19064+
status:
19065+
description: status of the condition, one of True, False, Unknown.
19066+
enum:
19067+
- "True"
19068+
- "False"
19069+
- Unknown
19070+
type: string
19071+
type:
19072+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
19073+
maxLength: 316
19074+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
19075+
type: string
19076+
required:
19077+
- lastTransitionTime
19078+
- message
19079+
- reason
19080+
- status
19081+
- type
19082+
type: object
19083+
type: array
1902819084
host:
1902919085
type: string
1903019086
installedCustomExtensions:

Diff for: deploy/cw-bundle.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -19025,6 +19025,62 @@ spec:
1902519025
!has(u.grantPublicSchemaAccess) || !u.grantPublicSchemaAccess)'
1902619026
status:
1902719027
properties:
19028+
conditions:
19029+
items:
19030+
description: Condition contains details for one aspect of the current
19031+
state of this API Resource.
19032+
properties:
19033+
lastTransitionTime:
19034+
description: |-
19035+
lastTransitionTime is the last time the condition transitioned from one status to another.
19036+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
19037+
format: date-time
19038+
type: string
19039+
message:
19040+
description: |-
19041+
message is a human readable message indicating details about the transition.
19042+
This may be an empty string.
19043+
maxLength: 32768
19044+
type: string
19045+
observedGeneration:
19046+
description: |-
19047+
observedGeneration represents the .metadata.generation that the condition was set based upon.
19048+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
19049+
with respect to the current state of the instance.
19050+
format: int64
19051+
minimum: 0
19052+
type: integer
19053+
reason:
19054+
description: |-
19055+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
19056+
Producers of specific condition types may define expected values and meanings for this field,
19057+
and whether the values are considered a guaranteed API.
19058+
The value should be a CamelCase string.
19059+
This field may not be empty.
19060+
maxLength: 1024
19061+
minLength: 1
19062+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
19063+
type: string
19064+
status:
19065+
description: status of the condition, one of True, False, Unknown.
19066+
enum:
19067+
- "True"
19068+
- "False"
19069+
- Unknown
19070+
type: string
19071+
type:
19072+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
19073+
maxLength: 316
19074+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
19075+
type: string
19076+
required:
19077+
- lastTransitionTime
19078+
- message
19079+
- reason
19080+
- status
19081+
- type
19082+
type: object
19083+
type: array
1902819084
host:
1902919085
type: string
1903019086
installedCustomExtensions:

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0
1919
github.com/onsi/ginkgo/v2 v2.23.4
2020
github.com/onsi/gomega v1.37.0
21-
github.com/pganalyze/pg_query_go/v5 v5.1.0
21+
github.com/pganalyze/pg_query_go/v6 v6.1.0
2222
github.com/pkg/errors v0.9.1
2323
github.com/sirupsen/logrus v1.9.3
2424
github.com/xdg-go/stringprep v1.0.4

Diff for: go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU
169169
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
170170
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
171171
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
172-
github.com/pganalyze/pg_query_go/v5 v5.1.0 h1:MlxQqHZnvA3cbRQYyIrjxEjzo560P6MyTgtlaf3pmXg=
173-
github.com/pganalyze/pg_query_go/v5 v5.1.0/go.mod h1:FsglvxidZsVN+Ltw3Ai6nTgPVcK2BPukH3jCDEqc1Ug=
172+
github.com/pganalyze/pg_query_go/v6 v6.1.0 h1:jG5ZLhcVgL1FAw4C/0VNQaVmX1SUJx71wBGdtTtBvls=
173+
github.com/pganalyze/pg_query_go/v6 v6.1.0/go.mod h1:nvTHIuoud6e1SfrUaFwHqT0i4b5Nr+1rPWVds3B5+50=
174174
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
175175
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
176176
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

Diff for: internal/postgres/users.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"encoding/json"
1111
"strings"
1212

13-
pg_query "github.com/pganalyze/pg_query_go/v5"
13+
pg_query "github.com/pganalyze/pg_query_go/v6"
1414

1515
"github.com/percona/percona-postgresql-operator/internal/feature"
1616
"github.com/percona/percona-postgresql-operator/internal/logging"

0 commit comments

Comments
 (0)