K8s-config-connector: cnrm.cloud.google.com/project-id not applied to resources

Created on 15 Jan 2021  路  4Comments  路  Source: GoogleCloudPlatform/k8s-config-connector

Describe the bug

According to the doc, cnrm resources should be able to "pick up" cnrm.cloud.google.com/project-id annotation if it's defined on the namespace.

However, my resources are currently failing to be deployed with

      error building a minimal unstructured skeleton for the IAM resource:
      error building unstructured skeleton from referenced resource: couldn''t get
      resource id for resource reference: error getting import ID for referenced resource:
      no value found for annotation cnrm.cloud.google.com/project-id

ConfigConnector Version
1.30.0

To Reproduce
Steps to reproduce the behavior:

YAML snippets:

apiVersion: v1
kind: Namespace
metadata:
  name: test
  annotations:
    cnrm.cloud.google.com/project-id: test-project
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeAddress
metadata:
  name: address
  namespace: test
spec:
  location: global
bug

All 4 comments

Weirdly, when I just deleted and re-deployed these namespaces, it worked. It appears as if there was some kind of race condition, and ComputeAddress did not "see" the namespace being created with the right annotation at first.

@dinvlad, sorry you ran into this. As you observed, your bug might be due a race condition where the namespace was not fully updated with the new annotation before creating the ComputeAddress. We'll look into making this expectation clearer so future users won't run into this race condition.

Thanks! It would be great for the resource annotation updater to keep watching the namespace, to automatically update the resource annotation when namespace gets updated.

That being said, in my case the namespace was created _with_ the annotation, so I was expecting there wouldn't be a moment where it's not yet "applied" to the namespace.

Thanks @dinvlad if you run into this issue again or have more insight into the pattern that cause the issue can you please open up a new issue?

Was this page helpful?
0 / 5 - 0 ratings