Skip to content

fix: take into account all existing files in given path when bootstraping#256

Open
dateutli wants to merge 3 commits intomasterfrom
fix/bootstrap-missing-configs
Open

fix: take into account all existing files in given path when bootstraping#256
dateutli wants to merge 3 commits intomasterfrom
fix/bootstrap-missing-configs

Conversation

@dateutli
Copy link
Contributor

Description:
Currently, when bootstrapping missing config files, a map of existing files is created so when clean up is performed we don't remove any existing ones. However, this line effectively makes it so only existing valid yaml files are considered for this map. If there were any other existing files this could lead to the accidental removal of those.

Testing:
Current behavior:

> mkdir testing
> touch testing/sample.txt
> touch testing/sample2    
> ls testing/ 
sample.txt sample2
> topicctl rebalance --cluster-config='examples/local-cluster/cluster.yaml' --path-prefix='testing' --bootstrap-missing-configs
[2026-03-13 13:45:25]  INFO --progress-interval is 0s. Not showing progress...
[2026-03-13 13:45:25]  INFO Getting all topic configs from path prefix testing
[2026-03-13 13:45:25]  INFO Rebalance complete! 0 topics rebalanced successfully, 0 topics had errors
> ls testing/

After fix:

> touch testing/sample.txt
> touch testing/sample2    
> ls testing/ 
sample.txt sample2
> topicctl rebalance --cluster-config='examples/local-cluster/cluster.yaml' --path-prefix='testing' --bootstrap-missing-configs
[2026-03-13 13:56:25]  INFO --progress-interval is 0s. Not showing progress...
[2026-03-13 13:56:25]  INFO Getting all topic configs from path prefix testing
[2026-03-13 13:56:25]  INFO Rebalance complete! 0 topics rebalanced successfully, 0 topics had errors
> ls testing/ 
sample     sample.txt

@dateutli dateutli requested a review from hhahn-tw March 13, 2026 19:05
@dateutli dateutli requested a review from a team as a code owner March 13, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants