GoogleCloudPlatform / k8s-config-connector

GCP Config Connector, a Kubernetes add-on for managing GCP resources
https://cloud.google.com/config-connector/docs/overview
Apache License 2.0
889 stars 219 forks source link

How to remove schemaSettings from PubSubTopic? #2205

Open rafaph opened 3 months ago

rafaph commented 3 months ago

Describe your question

Hello everyone. I'm trying to remove a PubSubSchema and PubSubTopic association via the k8s python client (using patch_namespaced_custom_object specifically).

So, to remove this association, I have to remove the property schemaSettings from the object (as far as I know), but when I try this, the object does not change.

Here is the body that I'm passing to patch_namespaced_custom_object object:

apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
kind: PubSubTopic
metadata:
  annotations:
    cnrm.cloud.google.com/deletion-policy: abandon
    cnrm.cloud.google.com/reconcile-interval-in-seconds: '3600'
  labels:
    app: test-service
  name: test.pubsubcrdtest.added-1.8.sbx
  namespace: pubsub-events-sbx
spec:
  messageStoragePolicy:
    allowedPersistenceRegions:
      - northamerica-northeast1
      - us-central1
      - us-east1
      - us-east4
      - us-west1
      - us-west2
      - us-west3
      - us-west4

I also tried to pass schemaSettings: null but it had no effect too.

So, does anyone have an idea to solve my problem or could this be a bug?