Skip to content

Fix LocalClient#delete_all_in_path not using partitioned key#5237

Merged
johha merged 1 commit into
cloudfoundry:mainfrom
sap-contributions:fix-local-client-delete-all-in-path
Jun 26, 2026
Merged

Fix LocalClient#delete_all_in_path not using partitioned key#5237
johha merged 1 commit into
cloudfoundry:mainfrom
sap-contributions:fix-local-client-delete-all-in-path

Conversation

@WeiQuan0605

@WeiQuan0605 WeiQuan0605 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor
  • A short explanation of the proposed change:

LocalClient#delete_all_in_path was building the target path with the raw key instead of partitioned_key(key), so it looked in the wrong directory and silently deleted nothing.

All other LocalClient methods (exists?, cp_to_blobstore, file_path, etc.) use partitioned_key consistently, which maps a key like abcdef1234 to ab/cd/abcdef1234. delete_all_in_path was the only method missing this, making it a no-op in practice.

  • An explanation of the use cases your change solves
  • lib/cloud_controller/blobstore/local/local_client.rb: use partitioned_key(path) in delete_all_in_path
  • spec/unit/lib/cloud_controller/blobstore/local/local_client_spec.rb: rewrite the test using real blobstore keys so the partitioned path is actually exercised (the old test used raw directory names and did not catch the bug)
  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@WeiQuan0605 WeiQuan0605 force-pushed the fix-local-client-delete-all-in-path branch from 879e4a5 to bc32cd6 Compare June 26, 2026 12:21
delete_all_in_path was building the path with the raw key instead of
partitioned_key, so it looked in the wrong directory and deleted nothing.
All other LocalClient methods use partitioned_key consistently.
@WeiQuan0605 WeiQuan0605 force-pushed the fix-local-client-delete-all-in-path branch from bc32cd6 to badf724 Compare June 26, 2026 12:25

@johha johha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@johha johha merged commit d1bf989 into cloudfoundry:main Jun 26, 2026
11 checks passed
@johha johha deleted the fix-local-client-delete-all-in-path branch June 26, 2026 12:46
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Jun 26, 2026
Changes in cloud_controller_ng:

- Fix LocalClient#delete_all_in_path not using partitioned key
    PR: cloudfoundry/cloud_controller_ng#5237
    Author: Wei Quan <64415962+WeiQuan0605@users.noreply.github.com>
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