Skip to content

Commit 20c87a5

Browse files
committed
alter cluster_create field to state
1 parent 05b7110 commit 20c87a5

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

docs/index.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ entries:
33
postgres-operator:
44
- apiVersion: v2
55
appVersion: v0.9.0
6-
created: "2022-10-26T11:23:13.433386984+08:00"
6+
created: "2022-10-28T12:26:56.118402102+08:00"
77
description: A Helm chart for Kubernetes
8-
digest: ce205b9aa4ec8f96d6c632fb9767e3702dde5ea6ac56a988d63a618ebd1f8ff9
8+
digest: a321f1cc510f737fab2b240d850c447b533accb14b7fe60c978f236fa515bef4
99
home: https://github.com/radondb/multi-platform-postgresql
1010
keywords:
1111
- operator
@@ -25,4 +25,4 @@ entries:
2525
urls:
2626
- https://radondb.github.io/multi-platform-postgresql/postgres-operator-v1.0.0.tgz
2727
version: v1.0.0
28-
generated: "2022-10-26T11:23:13.432936706+08:00"
28+
generated: "2022-10-28T12:26:56.117932431+08:00"

docs/postgres-operator-v1.0.0.tgz

-5 Bytes
Binary file not shown.

platforms/kubernetes/postgres-operator/deploy/postgres-operator.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ spec:
2828
name: DeletePvc
2929
type: boolean
3030
priority: 0 # show in standard view
31-
- jsonPath: .status.cluster_create
31+
- jsonPath: .status.state
3232
description: The postgresql cluster status
33-
name: Clusterstatus
33+
name: State
3434
type: string
3535
priority: 0 # show in standard view
3636
- jsonPath: .spec.autofailover.podspec.containers[0].image

platforms/kubernetes/postgres-operator/deploy/postgres-operator.yaml.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ spec:
2828
name: DeletePvc
2929
type: boolean
3030
priority: 0 # show in standard view
31-
- jsonPath: .status.cluster_create
31+
- jsonPath: .status.state
3232
description: The postgresql cluster status
33-
name: Clusterstatus
33+
name: State
3434
type: string
3535
priority: 0 # show in standard view
3636
- jsonPath: .spec.autofailover.podspec.containers[0].image

platforms/kubernetes/postgres-operator/postgres/constants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
RESOURCE_KIND_POSTGRESQL = "PostgreSQL"
6565

6666
# status.CLUSTER_CREATE_CLUSTER
67-
CLUSTER_CREATE_CLUSTER = "cluster_create"
67+
CLUSTER_STATE = "state"
6868
CLUSTER_CREATE_BEGIN = "begin"
6969
CLUSTER_CREATE_ADD_FAILOVER = "addition failover"
7070
CLUSTER_CREATE_ADD_READWRITE = "addition readwrite"

platforms/kubernetes/postgres-operator/postgres/handle.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
API_VERSION_V1,
6565
RESOURCE_POSTGRESQL,
6666
RESOURCE_KIND_POSTGRESQL,
67-
CLUSTER_CREATE_CLUSTER,
67+
CLUSTER_STATE,
6868
CLUSTER_CREATE_BEGIN,
6969
CLUSTER_CREATE_ADD_FAILOVER,
7070
CLUSTER_CREATE_ADD_READWRITE,
@@ -2513,7 +2513,7 @@ async def create_cluster(
25132513
logger: logging.Logger,
25142514
) -> None:
25152515
try:
2516-
set_cluster_status(meta, CLUSTER_CREATE_CLUSTER, CLUSTER_STATUS_CREATE,
2516+
set_cluster_status(meta, CLUSTER_STATE, CLUSTER_STATUS_CREATE,
25172517
logger)
25182518

25192519
logging.info("check create_cluster params")
@@ -2529,13 +2529,13 @@ async def create_cluster(
25292529
time.sleep(5)
25302530
# cluster running
25312531
update_number_sync_standbys(meta, spec, patch, status, logger)
2532-
set_cluster_status(meta, CLUSTER_CREATE_CLUSTER, CLUSTER_STATUS_RUN,
2532+
set_cluster_status(meta, CLUSTER_STATE, CLUSTER_STATUS_RUN,
25332533
logger)
25342534
except Exception as e:
25352535
logger.error(f"error occurs, {e}")
25362536
traceback.print_exc()
25372537
traceback.format_exc()
2538-
set_cluster_status(meta, CLUSTER_CREATE_CLUSTER,
2538+
set_cluster_status(meta, CLUSTER_STATE,
25392539
CLUSTER_STATUS_CREATE_FAILED, logger)
25402540

25412541

@@ -2546,7 +2546,7 @@ async def delete_cluster(
25462546
status: kopf.Status,
25472547
logger: logging.Logger,
25482548
) -> None:
2549-
set_cluster_status(meta, CLUSTER_CREATE_CLUSTER, CLUSTER_STATUS_TERMINATE,
2549+
set_cluster_status(meta, CLUSTER_STATE, CLUSTER_STATUS_TERMINATE,
25502550
logger)
25512551
await delete_postgresql_cluster(meta, spec, patch, status, logger)
25522552

@@ -3677,7 +3677,7 @@ async def update_cluster(
36773677
diffs: kopf.Diff,
36783678
) -> None:
36793679
try:
3680-
set_cluster_status(meta, CLUSTER_CREATE_CLUSTER, CLUSTER_STATUS_UPDATE,
3680+
set_cluster_status(meta, CLUSTER_STATE, CLUSTER_STATUS_UPDATE,
36813681
logger)
36823682
logger.info("check update_cluster params")
36833683
check_param(spec, logger, create=False)
@@ -3749,11 +3749,11 @@ async def update_cluster(
37493749
else:
37503750
cluster_status = CLUSTER_STATUS_RUN
37513751
# set Running
3752-
set_cluster_status(meta, CLUSTER_CREATE_CLUSTER, cluster_status,
3752+
set_cluster_status(meta, CLUSTER_STATE, cluster_status,
37533753
logger)
37543754
except Exception as e:
37553755
logger.error(f"error occurs, {e}")
37563756
traceback.print_exc()
37573757
traceback.format_exc()
3758-
set_cluster_status(meta, CLUSTER_CREATE_CLUSTER,
3758+
set_cluster_status(meta, CLUSTER_STATE,
37593759
CLUSTER_STATUS_UPDATE_FAILED, logger)

0 commit comments

Comments
 (0)