Skip to content

PubSubSubscription fails when setting deadLetterPolicy.deadLetterTopicRef #281

@lawrencejones

Description

@lawrencejones

ConfigConnector Version

Latest at time of writing, 1.20.1
Describe the bug

When provisioning a PubSubSubscription that has a deadLetterPolicy.deadLetterTopicRef, like this:

---
apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
kind: PubSubSubscription
metadata:
  labels:
    app: abacus
    app.kubernetes.io/instance: prd-abacus-live-staging-abacus
    environment: live-staging
    part-of: abacus
    release: abacus
  name: abacus-payments-service-syncing
  namespace: abacus-live-staging
spec:
  deadLetterPolicy:
    deadLetterTopicRef:
      name: abacus-book-entries-payments-service-syncing-dead-letter-queue
    maxDeliveryAttempts: 5
  expirationPolicy:
    ttl: ''
  topicRef:
    name: abacus-book-entries

The deadletter topic is definitely there, as you can see from:

$ kubectl get pubsubtopic abacus-book-entries-payments-service-syncing-dead-letter-queue -o yaml
apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
kind: PubSubTopic
metadata:
  annotations:
    cnrm.cloud.google.com/management-conflict-prevention-policy: resource
    cnrm.cloud.google.com/project-id: gc-prd-abacus-liv-staging-e420
  labels:
    app: abacus
    app.kubernetes.io/instance: prd-abacus-live-staging-abacus
    environment: live-staging
    part-of: abacus
    release: abacus
  name: abacus-book-entries-payments-service-syncing-dead-letter-queue
  namespace: abacus-live-staging
status:
  conditions:
  - lastTransitionTime: "2020-09-18T14:54:38Z"
    message: The resource is up to date
    reason: UpToDate
    status: "True"
    type: Ready

We see the following update error:

Update call failed: error fetching live state: error converting resource config: error resolving value of target field of referenced resource: referenced resource's target field name is unsupported

This is the associated cnrm log:

{
  "level": "error",
  "ts": 1600441440.4124084,
  "logger": "controller-runtime.controller",
  "msg": "Reconciler error",
  "controller": "iampolicymember-controller",
  "request": "abacus-live-staging/abacus-journal-entries-abacus-booking-pubsub-subscriber",
  "error": "error setting policy member: error applying changes: Error retrieving IAM policy for pubsub subscription \"projects/gc-prd-abacus-liv-staging-e420/subscriptions/abacus-booking\": googleapi: Error 404: Resource not found (resource=abacus-booking)., notFound",
  "stacktrace": "cnrm.googlesource.com/cnrm/vendor/github.com/go-logr/zapr.(*zapLogger).Error\n\t/go/src/cnrm.googlesource.com/cnrm/vendor/github.com/go-logr/zapr/zapr.go:128\ncnrm.googlesource.com/cnrm/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/src/cnrm.googlesource.com/cnrm/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:258\ncnrm.googlesource.com/cnrm/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/src/cnrm.googlesource.com/cnrm/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:232\ncnrm.googlesource.com/cnrm/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\t/go/src/cnrm.googlesource.com/cnrm/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:211\ncnrm.googlesource.com/cnrm/vendor/k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/go/src/cnrm.googlesource.com/cnrm/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155\ncnrm.googlesource.com/cnrm/vendor/k8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/go/src/cnrm.googlesource.com/cnrm/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156\ncnrm.googlesource.com/cnrm/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/go/src/cnrm.googlesource.com/cnrm/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133\ncnrm.googlesource.com/cnrm/vendor/k8s.io/apimachinery/pkg/util/wait.Until\n\t/go/src/cnrm.googlesource.com/cnrm/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions