Skip to content

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

Merged
dateutli merged 4 commits intomasterfrom
fix/bootstrap-missing-configs
Mar 17, 2026
Merged

fix: take into account all existing files in given path when bootstraping#256
dateutli merged 4 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
hhahn-tw
hhahn-tw previously approved these changes Mar 16, 2026
@dateutli dateutli merged commit 9c1f75c into master Mar 17, 2026
9 checks passed
@dateutli dateutli deleted the fix/bootstrap-missing-configs branch March 17, 2026 16:48
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