Skip to content

Commit

Permalink
Merge pull request #149 from kloeckner-i/METAL-3554/remove_ref_metada…
Browse files Browse the repository at this point in the history
…ta_dependency

METAL-3554 do not use metadata from reference
  • Loading branch information
hyunysmile authored Jul 12, 2022
2 parents 83941c4 + f238778 commit 4a1c0c9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
7 changes: 4 additions & 3 deletions api/v1alpha1/database_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/db-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion charts/db-operator/crds/kci.rocks_databases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -115,6 +115,8 @@ spec:
properties:
database:
type: string
instanceName:
type: string
instanceRef:
description: DbInstance is the Schema for the dbinstances API
properties:
Expand Down Expand Up @@ -303,6 +305,7 @@ spec:
type: string
required:
- database
- instanceName
- instanceRef
- phase
- status
Expand Down
5 changes: 4 additions & 1 deletion config/crd/bases/kci.rocks_databases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -115,6 +115,8 @@ spec:
properties:
database:
type: string
instanceName:
type: string
instanceRef:
description: DbInstance is the Schema for the dbinstances API
properties:
Expand Down Expand Up @@ -303,6 +305,7 @@ spec:
type: string
required:
- database
- instanceName
- instanceRef
- phase
- status
Expand Down

0 comments on commit 4a1c0c9

Please sign in to comment.