Skip to content

Commit

Permalink
Expose deletionPolicy field on GCP databases
Browse files Browse the repository at this point in the history
  • Loading branch information
kimtore committed May 28, 2024
1 parent 8ffc5b6 commit 6f0607c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions config/crd/bases/sql.cnrm.cloud.google.com_sqldatabases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ spec:
type: object
spec:
properties:
deletionPolicy:
type: string
instanceRef:
properties:
external:
Expand All @@ -51,6 +53,7 @@ spec:
resourceID:
type: string
required:
- deletionPolicy
- instanceRef
type: object
required:
Expand Down
8 changes: 6 additions & 2 deletions pkg/apis/sql.cnrm.cloud.google.com/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,13 @@ type InstanceRef struct {
External string `json:"external,omitempty"`
}

const DeletionPolicyAbandon = "ABANDON"
const DeletionPolicyDelete = "DELETE"

type SQLDatabaseSpec struct {
ResourceID string `json:"resourceID,omitempty"`
InstanceRef InstanceRef `json:"instanceRef"`
ResourceID string `json:"resourceID,omitempty"`
InstanceRef InstanceRef `json:"instanceRef"`
DeletionPolicy string `json:"deletionPolicy"`
}

// +kubebuilder:object:root=true
Expand Down

0 comments on commit 6f0607c

Please sign in to comment.