Open Constantin07 opened 4 years ago
What's strange - if I deploy kafka_acls
resources - I don't get those warning but if I deploy topics - I do.
Looks like this is happening because both old and new config parameters are mapped to the same environment variables
Specifically:
ca_cert_file
is deprecated and reads from the KAFKA_CA_CERT
env varca_cert
instead, but this also reads from KAFKA_CA_CERT
So if you set KFAKA_CA_CERT
I guess both get set, resulting in a deprecation warning from ca_cert_file
.
I wonder if this can be avoided by adding another env var for ca_cert
(the naming is a bit unfortunate, since the deprecated var already makes use of KAFKA_CA_CERT
which is what ca_cert
would naturally map to):
diff --git a/kafka/provider.go b/kafka/provider.go
index 58fcabb..770380d 100644
--- a/kafka/provider.go
+++ b/kafka/provider.go
@@ -40,7 +40,7 @@ func Provider() *schema.Provider {
"ca_cert": {
Type: schema.TypeString,
Optional: true,
- DefaultFunc: schema.EnvDefaultFunc("KAFKA_CA_CERT", nil),
+ DefaultFunc: schema.MultiEnvDefaultFunc([]string{"KAFKA_CA_CERT", "KAFKA_CA_CERT_FILE"}, nil),
Description: "CA certificate file to validate the server's certificate.",
},
"client_cert": {
EDIT: and further, the same issue for:
KAFKA_CLIENT_KEY
which is shared between client_key
and the deprecated client_key_file
, andKAFKA_CLIENT_CERT
which is shared between client_cert
and the deprecated client_cert_file
Also impacted here following the use of KAFKA_CLIENT_KEY
and KAFKA_CLIENT_CERT
environnent variable.
I think @matthewhughes-uw is right, using the same environment variable name for the two parameters trigger the deprecation message.
Maybe time has come to remove the deprecated parameters ? :)
I'm using environment variables to pass credentials to Kafka provider, e.g.
Provider configuration :
when I ran the plan I get this:
This is confusing as I'm not using the configuration parameters in provider - neither old names nor new ones.
Looks like this is happening because both old and new config parameters are mapped to the same environment variables, e.g.
Is it supposed to work like that ?