Skip to content

Commit

Permalink
fix: Confluent CLI v4 has some breaking changes
Browse files Browse the repository at this point in the history
As we don't version pin the CLI being installed, and we use
`latest`, there are breaking changes moving from the _v3.x_
CLI that was last run ~18 months ago. One of which is that the
the [schema registry](#1) no longer needs to be created
separately as it always-enabled in Confluent Cloud environments.

Due to that breaking change, we will remove the `local-exec`
provisioners from attempting to run the commands required of the prior
_v3.x_ CLI version so that we no longer get failures while trying
to execute (sub)commands that no longer exist.

[1] https://docs.confluent.io/confluent-cli/current/migrate.html#cli-breaking-changes-v4

Refs: #DEVOP-5504

Signed-off-by: Christian Witts <christian@honestbank.com>
  • Loading branch information
ChristianWitts committed Nov 27, 2024
1 parent dc234eb commit 2cb6b5e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
12 changes: 0 additions & 12 deletions modules/enable-schema-registry/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,4 @@ resource "null_resource" "enable_schema_registry" {
provisioner "local-exec" {
command = "./bin/confluent environment use ${var.environment_id}"
}

provisioner "local-exec" {
command = "./bin/confluent schema-registry cluster enable --cloud ${var.schema_registry_cloud} --geo ${var.schema_registry_geo} 1> schema-registry-result.txt 2> schema-registry-error.txt"
}

provisioner "local-exec" {
command = "cat schema-registry-result.txt"
}

provisioner "local-exec" {
command = "cat schema-registry-error.txt"
}
}
2 changes: 1 addition & 1 deletion test/create_env_cluster_topics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestEnvClusterTopic(t *testing.T) {
output = terraform.Output(t, runOptions, "connector_gcs_sink_connector_id")
a.NotEmpty(output)

output = terraform.Destroy(t, runOptions)
output, _ = terraform.DestroyE(t, runOptions)
a.True(strings.Contains(output, "disable lifecycle.prevent_destroy or reduce the scope of the plan"))
})
}
4 changes: 2 additions & 2 deletions test/ksql_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestKsqldbCluster(t *testing.T) {
})
})

// Uncomment and remove #L105-107 once ACLs have moved to their own module
// Uncomment and remove #L82-84 once ACLs have moved to their own module
// defer terraform.Destroy(t, runOptions)
terraform.InitAndApply(t, runOptions)

Expand All @@ -80,7 +80,7 @@ func TestKsqldbCluster(t *testing.T) {
output = terraform.Output(t, runOptions, "id")
a.NotEmpty(output)

output = terraform.Destroy(t, runOptions)
output, _ = terraform.DestroyE(t, runOptions)
a.True(strings.Contains(output, "disable lifecycle.prevent_destroy or reduce the scope of the plan"))
})
}

0 comments on commit 2cb6b5e

Please sign in to comment.