<p>I'm using the <a href="https://github.com/GoogleCloudPlatform/k8s-config-connector/tree/master/resources/storagenotification" rel="nofollow noreferrer">Config Connector example</a> for the StorageNotification but I keep getting the following error (take from <code>kubectl describe</code>)</p>

<blockquote>
  <p>storagenotification-controller  Update call failed: error applying desired state: project: required field is not set</p>
</blockquote>

<p>I have followed the <a href="https://cloud.google.com/config-connector/docs/how-to/setting-default-namespace" rel="nofollow noreferrer">Setting Config Connector's default namespace</a> but no joy. The StorageNotification API spec doesn't have a field for "project". I thought it just had to be in the right namespace?</p>

<p>All the other resources seem to setup OK. Just the notification is not working. Here is my complete yaml</p>

<pre><code># Bucket Starts the chain of events
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageBucket
metadata:
  labels:
    app: something-processing
  name: example-something
  namespace: ${GCP_PROJECT_ID}
---
# Pub/Sub topic that bucket events will publish to
apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
kind: PubSubTopic
metadata:
  name: my-pubsub-topic  
  labels:
    app: something-processing
  namespace: ${GCP_PROJECT_ID}
---
# Publisher IAM permissions
apiVersion: iam.cnrm.cloud.google.com/v1beta1
kind: IAMPolicy
metadata:
  name: my-pubsub-topic-iam
  namespace: ${GCP_PROJECT_ID}
  labels:
    app: something-processing
spec:
  resourceRef:
    apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
    kind: PubSubTopic
    name: my-pubsub-topic
  bindings:
    - role: roles/pubsub.publisher
      members:
        - serviceAccount:service-${GCP_PROJECT_ID}@gs-project-accounts.iam.gserviceaccount.com  
---
# Trigger that connects the bucket to the pubsub topic
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageNotification
metadata:
  name: storage-notification
  namespace: ${GCP_PROJECT_ID}
  project: ${GCP_PROJECT_ID}
  labels:
    app: something-processing
spec:
  bucketRef:
    name: something
  payloadFormat: JSON_API_V1
  topicRef:
    name: my-pubsub-topic
  eventTypes:
    - "OBJECT_FINALIZE"
---
# subscription that gets events from the topic and PUSHes them 
# to the K8s Ingress endpoint
apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
kind: PubSubSubscription
metadata:
  name: pubsub-subscription-topic
  namespace: ${GCP_PROJECT_ID}
  labels:
    app: something-processing
spec:
  pushConfig:
    # This should match the Ingress path
    pushEndpoint: https://example.zone/some-ingress-end-point/
  topicRef:
    name: my-pubsub-topic

</code></pre>

<p>Note: I'm using <code>envsubt</code> to replace the <code>${GCP_PROJECT_ID}</code> with the project ID ;)</p>

CpILL
<p>I was having the same issue and managed to resolve it by changing the topicRef.name to topicRef.external with the fully qualified topic name as expected in the <a href="https://cloud.google.com/storage/docs/json_api/v1/notifications/insert" rel="nofollow noreferrer">REST API</a>. My installation of the config connector was done following the Workload Identity scenario described in the <a href="https://cloud.google.com/config-connector/docs/how-to/install-upgrade-uninstall" rel="nofollow noreferrer">documentation</a>.</p>

<pre><code>---
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageNotification
metadata:
  name: storage-notification
spec:
  bucketRef:
    name: ${BUCKET}
  payloadFormat: JSON_API_V1
  topicRef:
    external: "//pubsub.googleapis.com/projects/${PROJECT_ID}/topics/${TOPIC}"
  eventType:
    - "OBJECT_FINALIZE"
</code></pre>
