IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
341 stars 671 forks source link

fix: eventstreams sarama clientid #5802

Closed kccox closed 4 days ago

kccox commented 5 days ago

What was done: A customer reported an error running the provider,

'resourceIBMEventStreamsTopicCreate createSaramaAdminClient: kafka: invalid configuration (ClientID is invalid)'

The root cause is the use of os.Hostname() for the ClientID, which in rare cases has an illegal value (either it is "", or it contains an illegal character such as $ or #). Change the ClientID to terraform-provider-ibm which is legal.

Note: the ClientID has no effect on the Event Streams or Kafka operations. It is just used in some log messages.

Community Note

Relates OR Closes #0000

Output from acceptance testing:

Since the same Sarama client is used by all the Event Streams topics tests, it's sufficient to just run the basic tests.

% make testacc TEST=./ibm/service/eventstreams TESTARGS='-run=TestAccIBMEventStreamsTopicDataSourceBasic'
   (skipping messages about environment variables)
=== RUN   TestAccIBMEventStreamsTopicDataSourceBasic
=== RUN   TestAccIBMEventStreamsTopicDataSourceBasic
--- PASS: TestAccIBMEventStreamsTopicDataSourceBasic (99.39s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams    100.978s

% make testacc TEST=./ibm/service/eventstreams TESTARGS='-run=TestAccIBMEventStreamsTopicResourceBasic'
   (skipping messages about environment variables)
=== RUN   TestAccIBMEventStreamsTopicResourceBasic
--- PASS: TestAccIBMEventStreamsTopicResourceBasic (189.22s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams    191.228s