Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug][replication]: when destroying resources with replication configs, provider should cleanup the replication config first #81

Open
ericsyh opened this issue Apr 20, 2023 · 0 comments
Assignees

Comments

@ericsyh
Copy link
Member

ericsyh commented Apr 20, 2023

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

v1.0.3

Affected Resource(s)

  • pulsar_tenant
  • pulsar_namespace

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

provider "pulsar"{
    alias = "us-east"
    web_service_url = ""
    issuer_url = ""
    audience = ""
    key_file_path = ""
}

resource "pulsar_cluster" "us-west-cluster" {
  provider = pulsar.us-east
  cluster = "us-west"

  cluster_data {
    web_service_url    = "<web_service_url>"
    broker_service_url = "<broker_service_url>"
  }
}

resource "pulsar_tenant" "us-east-geo-tenant" {
  provider = pulsar.us-east
  tenant = "geo-tenant"
  allowed_clusters = [
    "us-east",
    pulsar_cluster.us-west-cluster.cluster
  ]
}

resource "pulsar_namespace" "us-east-geo-namespace" {
  provider  = pulsar.us-east
  tenant    = pulsar_tenant.us-east-geo-tenant.tenant
  namespace = "geo-namespace"

  namespace_config {
    replication_clusters = [
      "us-east",
      pulsar_cluster.us-west-cluster.cluster
    ]
  }
}

Debug Output

Panic Output

Expected Behavior

Destroy successfully.

Actual Behavior

pulsar_namespace.us-east-geo-namespace: Destroying... [id=geo-tenant/geo-namespace]
pulsar_namespace.us-west-geo-namespace: Destroying... [id=geo-tenant/geo-namespace]
╷
│ Error: ERROR_DELETE_NAMESPACE: code: 412 reason: Cannot delete the global namespace geo-tenant/geo-namespace. There are still more than one replication clusters configured.
│
│
╵
╷
│ Error: ERROR_DELETE_NAMESPACE: code: 412 reason: Cannot delete the global namespace geo-tenant/geo-namespace. There are still more than one replication clusters configured.
│
│
╵

Steps to Reproduce

  1. terraform apply to create resources
  2. terrafrom destroy to cleanup resources

Important Factoids

References

  • I believe this issue is because Pulsar requires to remove the replication configurations on tenant, namespace first then allow to delete this resource.
  • So for the terraform provider should check the replication configuration first before the destroy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants