Skip to content

Commit 40a3e4d

Browse files
committed
Separate bridge client structs and CBC API structs. Create separate request and response payload structs. Add fields to CBC status.
1 parent 400131c commit 40a3e4d

File tree

6 files changed

+405
-242
lines changed

6 files changed

+405
-242
lines changed

Diff for: config/crd/bases/postgres-operator.crunchydata.com_crunchybridgeclusters.yaml

+55-58
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,13 @@ spec:
103103
items:
104104
properties:
105105
name:
106-
description: 'The name of this PostgreSQL role. The value may
107-
contain only lowercase letters, numbers, and hyphen so that
108-
it fits into Kubernetes metadata. The above is problematic
109-
for us as Bridge has a role with an underscore. TODO: figure
110-
out underscore dilemma'
111-
pattern: ^[A-Za-z][A-Za-z0-9\-_ ]*[A-Za-z0-9]$
106+
description: 'Name of the role within Crunchy Bridge. More info:
107+
https://docs.crunchybridge.com/concepts/users'
112108
type: string
113109
secretName:
114110
description: The name of the Secret that will hold the role
115111
credentials.
116-
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
112+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
117113
type: string
118114
required:
119115
- name
@@ -151,57 +147,8 @@ spec:
151147
description: CrunchyBridgeClusterStatus defines the observed state of
152148
CrunchyBridgeCluster
153149
properties:
154-
clusterStatus:
155-
description: The cluster as represented by Bridge
156-
properties:
157-
id:
158-
type: string
159-
isHa:
160-
type: boolean
161-
majorVersion:
162-
type: integer
163-
name:
164-
type: string
165-
planId:
166-
type: string
167-
postgresVersionId:
168-
anyOf:
169-
- type: integer
170-
- type: string
171-
x-kubernetes-int-or-string: true
172-
providerId:
173-
type: string
174-
regionId:
175-
type: string
176-
state:
177-
type: string
178-
storage:
179-
format: int64
180-
type: integer
181-
teamId:
182-
type: string
183-
type: object
184-
clusterUpgradeResponse:
185-
description: The cluster upgrade as represented by Bridge
186-
properties:
187-
operations:
188-
items:
189-
properties:
190-
flavor:
191-
type: string
192-
starting_from:
193-
type: string
194-
state:
195-
type: string
196-
required:
197-
- flavor
198-
- starting_from
199-
- state
200-
type: object
201-
type: array
202-
type: object
203150
conditions:
204-
description: conditions represent the observations of postgrescluster's
151+
description: conditions represent the observations of postgres cluster's
205152
current state.
206153
items:
207154
description: "Condition contains details for one aspect of the current
@@ -273,16 +220,66 @@ spec:
273220
x-kubernetes-list-map-keys:
274221
- type
275222
x-kubernetes-list-type: map
223+
host:
224+
description: The Hostname of the postgres cluster in Bridge, provided
225+
by Bridge API and null until then.
226+
type: string
276227
id:
277-
description: The ID of the postgrescluster in Bridge, provided by
228+
description: The ID of the postgres cluster in Bridge, provided by
278229
Bridge API and null until then.
279230
type: string
231+
isHa:
232+
description: Whether the cluster is high availability, meaning that
233+
it has a secondary it can fail over to quickly in case the primary
234+
becomes unavailable.
235+
type: boolean
236+
isProtected:
237+
description: Whether the cluster is protected. Protected clusters
238+
can't be destroyed until their protected flag is removed
239+
type: boolean
240+
majorVersion:
241+
description: The cluster's major Postgres version.
242+
type: integer
243+
name:
244+
description: The name of the cluster in Bridge.
245+
type: string
280246
observedGeneration:
281247
description: observedGeneration represents the .metadata.generation
282248
on which the status was based.
283249
format: int64
284250
minimum: 0
285251
type: integer
252+
ongoingUpgrade:
253+
description: The cluster upgrade as represented by Bridge
254+
items:
255+
properties:
256+
flavor:
257+
type: string
258+
starting_from:
259+
type: string
260+
state:
261+
type: string
262+
required:
263+
- flavor
264+
- starting_from
265+
- state
266+
type: object
267+
type: array
268+
planId:
269+
description: The ID of the cluster's plan. Determines instance, CPU,
270+
and memory.
271+
type: string
272+
responses:
273+
description: Most recent, raw responses from Bridge API
274+
type: object
275+
x-kubernetes-preserve-unknown-fields: true
276+
state:
277+
description: State of cluster in Bridge.
278+
type: string
279+
storage:
280+
description: The amount of storage available to the cluster in gigabytes.
281+
format: int64
282+
type: integer
286283
type: object
287284
type: object
288285
served: true

0 commit comments

Comments
 (0)