From 2cb6b5ecea92801348812539030c6c9175031224 Mon Sep 17 00:00:00 2001 From: Christian Witts Date: Wed, 27 Nov 2024 18:14:51 +0700 Subject: [PATCH] fix: Confluent CLI v4 has some breaking changes 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 --- modules/enable-schema-registry/main.tf | 12 ------------ test/create_env_cluster_topics_test.go | 2 +- test/ksql_cluster_test.go | 4 ++-- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/modules/enable-schema-registry/main.tf b/modules/enable-schema-registry/main.tf index c34aba6..59162de 100644 --- a/modules/enable-schema-registry/main.tf +++ b/modules/enable-schema-registry/main.tf @@ -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" - } } diff --git a/test/create_env_cluster_topics_test.go b/test/create_env_cluster_topics_test.go index 4c34537..4a4df2a 100644 --- a/test/create_env_cluster_topics_test.go +++ b/test/create_env_cluster_topics_test.go @@ -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")) }) } diff --git a/test/ksql_cluster_test.go b/test/ksql_cluster_test.go index f61f226..26f04f2 100644 --- a/test/ksql_cluster_test.go +++ b/test/ksql_cluster_test.go @@ -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) @@ -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")) }) }