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

When changing a description of the default queue of a cluster, the default queue of that cluster is dropped #591

Open
ntascii opened this issue Dec 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ntascii
Copy link

ntascii commented Dec 11, 2024

Describe the bug
When changing a description of a cluster's default queue, the cluster will no longer have its assigned default queue.
We have a cluster managed in terraform. The usage can be simplified like:

resource "buildkite_cluster_queue" "test_queue" {
  key         = "test_queue"
  description = "test description"
  cluster_id  = module.test_cluster.cluster_id
}

resource "buildkite_cluster_default_queue" "default" {
  cluster_id = module.test_cluster.cluster_id
  queue_id   = buildkite_cluster_queue.test_queue
}

To Reproduce
Steps to reproduce the behavior:

  • Change description of the default queue
  • terraform apply
  • The description is updated, the state file still contains resource buildkite_cluster_default_queue however, there is no longer a default queue for the cluster
  • Hit error No default queue is assigned to the cluster whenever doing a terraform plan afterwards.

Expected behavior
Default queue should not be dropped when changing it's description.

Additional context
Add any other context about the problem here.

@tomowatt
Copy link
Member

tomowatt commented Dec 16, 2024

Hey @ntascii

We've found that there is an issue with the GraphQL API itself that results Default Queue being removed when the Queue is updated until this is fixed we recommend adding the replace_triggered_by lifecycle onto the buildkite_cluster_default_queue resources e.g.,

resource "buildkite_cluster" "local" {
  name        = "TF cluster"
  description = "Cluster for TF projects"
}

resource "buildkite_cluster_queue" "test_queue" {
  cluster_id  = buildkite_cluster.local.id
  key         = "test_queue"
  dispatch_paused = "true"
}

resource "buildkite_cluster_default_queue" "test_default_queue" {
  cluster_id = buildkite_cluster.local.id
  queue_id   = buildkite_cluster_queue.test_queue.id

  lifecycle {
    replace_triggered_by = [  buildkite_cluster_queue.test_queue ]
  }
}

the PR linked above includes other fixes for Cluster Queues but we've raised it to the Product Team to correct the GraphQL API so the workaround is not required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants