devshawn / kafka-shell

⚡A supercharged, interactive Kafka shell built on top of the existing Kafka CLI tools.
Apache License 2.0
126 stars 11 forks source link

Configuration file validation should evaluate environment variables #13

Closed babadofar closed 5 years ago

babadofar commented 5 years ago

kafka-shell works fine using environment variables for bootstrap server and zookeeper, but barfs at schema_registry_url due to a validation error To Reproduce Use a config.yaml file like this

version: 1
enable:
  history: true
  save_on_exit: true
  auto_complete: true
  auto_suggest: true
  inline_help: true
  fuzzy_search: true
cluster: local
clusters:
  local:
    bootstrap_servers: $BOOTSTRAP_SERVER
    zookeeper_connect: $ZOO_KEEPER
    schema_registry_url: $SCHEMA_REGISTRY

Expected behavior It should evalute the environment variables Screenshots

[root@d89fde020d7f /]# kafka-shell
Invalid user configuration (clusters, local, schema_registry_url): '$SCHEMA_REGISTRY' does 
not match '^https?://(.*)$'
devshawn commented 5 years ago

Hey, thanks for the detailed bug report. This wasn't a use case I considered heavily -- but definitely a great idea. I'll take a look at this tonight and get a fix out.

devshawn commented 5 years ago

Hi there, schema_registry_url and ksql_server_url will now accept environment variables. I've released 0.1.2 to address this.

Please let me know if there are any other configuration settings that you'd like to work with environment variables. Thanks!! :)

babadofar commented 5 years ago

🏆 awesome work! Thanks