From 3c3e4e0454ac469c45e71dc1ac92f459c3f16973 Mon Sep 17 00:00:00 2001 From: Soohyun Kim Date: Fri, 8 Jul 2022 14:32:25 +0200 Subject: [PATCH 1/2] METAL-3554 do not use metadata from reference --- api/v1alpha1/database_types.go | 7 ++++--- charts/db-operator/crds/kci.rocks_databases.yaml | 5 ++++- config/crd/bases/kci.rocks_databases.yaml | 5 ++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/api/v1alpha1/database_types.go b/api/v1alpha1/database_types.go index 50f97a70..a9b09de2 100644 --- a/api/v1alpha1/database_types.go +++ b/api/v1alpha1/database_types.go @@ -42,9 +42,9 @@ type DatabaseSpec struct { // Postgres struct should be used to provide resource that only applicable to postgres type Postgres struct { // If set to true, the public schema will be dropped after the database creation - DropPublicSchema bool `json:"dropPublicSchema,omitempty"` + DropPublicSchema bool `json:"dropPublicSchema,omitempty"` // Specify schemas to be created. The user created by db-operator will have all access on them. - Schemas []string `json:"schemas,omitempty"` + Schemas []string `json:"schemas,omitempty"` } // DatabaseStatus defines the observed state of Database @@ -58,6 +58,7 @@ type DatabaseStatus struct { ProxyStatus DatabaseProxyStatus `json:"proxyStatus,omitempty"` DatabaseName string `json:"database"` UserName string `json:"user"` + InstanceName string `json:"instanceName"` } // DatabaseProxyStatus defines whether proxy for database is enabled or not @@ -80,7 +81,7 @@ type DatabaseBackup struct { //+kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="current db phase" //+kubebuilder:printcolumn:name="Status",type=boolean,JSONPath=`.status.status`,description="current db status" //+kubebuilder:printcolumn:name="Protected",type=boolean,JSONPath=`.spec.deletionProtected`,description="If database is protected to not get deleted." -//+kubebuilder:printcolumn:name="DBInstance",type=string,JSONPath=`.status.instanceRef.metadata.name`,description="instance reference" +//+kubebuilder:printcolumn:name="DBInstance",type=string,JSONPath=`.status.instanceName`,description="instance reference" //+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="time since creation of resource" // Database is the Schema for the databases API diff --git a/charts/db-operator/crds/kci.rocks_databases.yaml b/charts/db-operator/crds/kci.rocks_databases.yaml index f36b4758..2639489f 100644 --- a/charts/db-operator/crds/kci.rocks_databases.yaml +++ b/charts/db-operator/crds/kci.rocks_databases.yaml @@ -32,7 +32,7 @@ spec: name: Protected type: boolean - description: instance reference - jsonPath: .status.instanceRef.metadata.name + jsonPath: .status.instanceName name: DBInstance type: string - description: time since creation of resource @@ -115,6 +115,8 @@ spec: properties: database: type: string + instanceName: + type: string instanceRef: description: DbInstance is the Schema for the dbinstances API properties: @@ -303,6 +305,7 @@ spec: type: string required: - database + - instanceName - instanceRef - phase - status diff --git a/config/crd/bases/kci.rocks_databases.yaml b/config/crd/bases/kci.rocks_databases.yaml index f36b4758..2639489f 100644 --- a/config/crd/bases/kci.rocks_databases.yaml +++ b/config/crd/bases/kci.rocks_databases.yaml @@ -32,7 +32,7 @@ spec: name: Protected type: boolean - description: instance reference - jsonPath: .status.instanceRef.metadata.name + jsonPath: .status.instanceName name: DBInstance type: string - description: time since creation of resource @@ -115,6 +115,8 @@ spec: properties: database: type: string + instanceName: + type: string instanceRef: description: DbInstance is the Schema for the dbinstances API properties: @@ -303,6 +305,7 @@ spec: type: string required: - database + - instanceName - instanceRef - phase - status From f23877815dc88f2a0f8f62bd977aabbedee103e5 Mon Sep 17 00:00:00 2001 From: Soohyun Kim Date: Fri, 8 Jul 2022 14:45:12 +0200 Subject: [PATCH 2/2] METAL-3554 bump chart patch --- charts/db-operator/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/db-operator/Chart.yaml b/charts/db-operator/Chart.yaml index 3492dbff..94191e33 100644 --- a/charts/db-operator/Chart.yaml +++ b/charts/db-operator/Chart.yaml @@ -4,4 +4,4 @@ kubeVersion: ">= 1.19-prerelease <= 1.23-prerelease" appVersion: "1.6.1" description: A Database Operator name: db-operator -version: 1.2.2 +version: 1.2.3