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
897 stars 231 forks source link

retryPolicy.[maximum|minimum]Backoff doesn't accept documented fractional digits #409

Open daniellervik opened 3 years ago

daniellervik commented 3 years ago

Describe the bug The pubsub_v1beta1_pubsubsubscription retryPolicy object describes maximumBackoff and minimumBackoff accepting fractional digits in the optional durations:

A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

They only seem to accept non-fractional durations, e.g. "3s".

ConfigConnector Version 1.36.0

To Reproduce

  1. Set PubSubSubscription's spec.retryPolicy.minimumBackoff: "60.0s". Apply changes. Expected outcome: The subscription resource starts flickering between Updating/UpToDate indefinitely.
  2. Changing to spec.retryPolicy.minimumBackoff: "60s" and applying works as expected and it settles as UpToDate.

YAML snippets:

  1. With fractional digits, retries to apply indefinitely

    apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
    kind: PubSubSubscription
    metadata:
    name: some-subscription
    namespace: some-namespace
    spec:
    retryPolicy:
    minimumBackoff: 60.0s
    topicRef:
    name: some-subscribed-topic
  2. Without fractional digits, works as expected

    apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
    kind: PubSubSubscription
    metadata:
    name: some-subscription
    namespace: some-namespace
    spec:
    retryPolicy:
    minimumBackoff: 60s
    topicRef:
    name: some-subscribed-topic
toumorokoshi commented 3 years ago

Thanks for the bug report! sorry you're having issues.

I can reproduce the case (here's a more complete example)

apiVersion: v1
kind: Namespace
metadata:
  name: gh-409
  annotations:
    "cnrm.cloud.google.com/project-id": <redacted>
---
  apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
  kind: PubSubSubscription
  metadata:
    namespace: gh-409
    labels:
      label-one: "value-one"
    name: pubsubsubscription-sample
  spec:
    ackDeadlineSeconds: 15
    messageRetentionDuration: 86400s
    retryPolicy:
      minimumBackoff: 60.1s
    retainAckedMessages: false
    topicRef:
      name: pubsubsubscription-dep
---
apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
kind: PubSubTopic
metadata:
  name: pubsubsubscription-dep
  namespace: gh-409

We're taking a look and will try to come back with an ETA to fix.

toumorokoshi commented 3 years ago

Hello! small update: we've tracked down the issue to some inconsistency in the upstream API for normalizing that string. Terraform has a similar bug filed against it now, I'll file a bug with the pubsub team internally.

The best way to get traction is to talk to GCP support for the pubsub issue specifically. But I'll see if I can push on the pubsub team a little bit as well.