Skip to content

Commit

Permalink
Merge pull request #3438 from maqiuyujoyce/202412-sqlinstance-test
Browse files Browse the repository at this point in the history
Mark 'spec.deletionPolicy' mutable-but-unreadable in SQLDatabase
  • Loading branch information
google-oss-prow[bot] authored Dec 20, 2024
2 parents 94cd909 + decc085 commit 7eaca66
Show file tree
Hide file tree
Showing 11 changed files with 921 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/servicemappings/sql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ spec:
containers:
- type: project
tfField: project
mutableButUnreadableFields:
- deletion_policy
- name: google_sql_database_instance
kind: SQLInstance
metadataMapping:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: SQLDatabase
metadata:
annotations:
cnrm.cloud.google.com/management-conflict-prevention-policy: none
cnrm.cloud.google.com/mutable-but-unreadable-fields: '{}'
cnrm.cloud.google.com/project-id: ${projectId}
cnrm.cloud.google.com/state-into-spec: absent
finalizers:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: sql.cnrm.cloud.google.com/v1beta1
kind: SQLDatabase
metadata:
annotations:
cnrm.cloud.google.com/management-conflict-prevention-policy: none
cnrm.cloud.google.com/mutable-but-unreadable-fields: '{"spec":{"deletionPolicy":"DELETE"}}'
cnrm.cloud.google.com/project-id: ${projectId}
cnrm.cloud.google.com/state-into-spec: merge
finalizers:
- cnrm.cloud.google.com/finalizer
- cnrm.cloud.google.com/deletion-defender
generation: 3
labels:
cnrm-test: "true"
name: sqldatabase-${uniqueId}
namespace: ${uniqueId}
spec:
charset: utf8mb4
collation: utf8mb4_bin
deletionPolicy: DELETE
instanceRef:
name: sqlinstance-${uniqueId}
resourceID: sqldatabase-${uniqueId}
status:
conditions:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: The resource is up to date
reason: UpToDate
status: "True"
type: Ready
observedGeneration: 3
selfLink: https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}/databases/sqldatabase-${uniqueId}
Loading

0 comments on commit 7eaca66

Please sign in to comment.