Skip to content

Inconsistent defaults for override settings -- no way to unset config properties #164

@klevy-toast

Description

@klevy-toast

Community Note

  • Please vote on this issue by adding a
    👍 reaction to the original
    issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra
    noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Provider 0.6.0

Affected Resource(s)

  • pulsar_namespace
  • pulsar_topic
    specifically, most of the settings within namespace_config and topic_config blocks default to 0, which mean explicitly disabled.

Terraform Configuration Files

terraform {
  required_providers {
    pulsar = {
      source  = "streamnative/pulsar"
      version = "0.6.0"
    }
  }
}

provider "pulsar" {
  web_service_url = "http://localhost:8080"
}

resource "pulsar_tenant" "example" {
  tenant           = "example-tenant"
  allowed_clusters = ["standalone"]
}

resource "pulsar_namespace" "example" {
  tenant    = pulsar_tenant.example.tenant
  namespace = "example-namespace"
  namespace_config {}
}

resource "pulsar_topic" "example" {
  tenant     = pulsar_tenant.example.tenant
  namespace  = pulsar_namespace.example.namespace
  topic_type = "persistent"
  topic_name = "example-topic"
  partitions = 0
  topic_config {}
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

There should be a way to allow these settings to fall back to broker-level defaults. If the setting is left unset in terraform, it should be removed from the namespace / topic config, rather than defaulted to disabled

Actual Behavior

The only options are to explicitly override the settings in an enabled or disabled step.

Steps to Reproduce

  1. hack/pulsar-docker.sh run to set up a standalone docker cluster
  2. Run terraform plan with the attached example spec:

Output:

# pulsar_namespace.example will be created
  + resource "pulsar_namespace" "example" {
      + id        = (known after apply)
      + namespace = "example-namespace"
      + tenant    = "example-tenant"

      + namespace_config {
          + is_allow_auto_update_schema          = true
          + max_consumers_per_subscription       = 0
          + max_consumers_per_topic              = 0
          + max_producers_per_topic              = 0
          + message_ttl_seconds                  = 0
          + offload_threshold_size_in_mb         = -1
          + replication_clusters                 = (known after apply)
          + schema_compatibility_strategy        = "Full"
          + schema_validation_enforce            = false
          + subscription_expiration_time_minutes = 0
        }
    }

  # pulsar_topic.example will be created
  + resource "pulsar_topic" "example" {
      + id         = (known after apply)
      + namespace  = "example-namespace"
      + partitions = 0
      + tenant     = "example-tenant"
      + topic_name = "example-topic"
      + topic_type = "persistent"

      + topic_config {
          + byte_publish_rate                     = 0
          + max_consumers                         = 0
          + max_producers                         = 0
          + max_unacked_messages_per_consumer     = 0
          + max_unacked_messages_per_subscription = 0
          + message_ttl_seconds                   = 0
          + msg_publish_rate                      = 0
        }
    }

Important Factoids

N/A

References

  • PIP-80 describes the general semantics around pulsar settings:
    • null = not set (fall back to higher level setting)
    • 0 = explicitly disabled
  • These new defaults were noted as incompatible here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions