segmentio / topicctl

Tool for declarative management of Kafka topics
MIT License
579 stars 54 forks source link

Support for topic settings deletion if they are present on the broker but not in config (with flag to enable) #197

Open fpacifici opened 1 month ago

fpacifici commented 1 month ago

Hi, I really like the tool. thanks.

If I remove a topic setting from my config, while the setting is still on the broker, topicctl would not delete it and leave it as it is

Found 1 key(s) set in cluster but missing from config:
-------------------------+----------------
                     KEY | CLUSTER VALUE
-------------------------+----------------
  message.timestamp.type | LogAppendTime
-------------------------+----------------
These will be left as-is."

Topicctl though supports deletion of a setting by setting it to empty string. https://github.com/segmentio/topicctl/blob/master/pkg/admin/brokerclient.go#L770-L774

Is there any reason to specifically avoid deleting topic settings when there is a mismatch between config and broker? I think that would make topic settings management actually declarative. I can see the potential for damages (provide an empty config by mistake) when allowing this, though updates go through user confirmation and there could be a flag to enable the destructive behavior.

If there is any interest in having this feature I would try to build it.