Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(CSI-342): get filesystem free space via API without requiring fs mount #476

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

sergeyberezansky
Copy link
Collaborator

@sergeyberezansky sergeyberezansky commented Mar 10, 2025

TL;DR

Added support for force-fresh filesystem capacity queries through the API

What changed?

  • Added ForceFresh parameter to filesystem API calls to ensure accurate capacity reporting
  • Implemented new getFilesystemFreeSpaceByApi method to query filesystem capacity directly through API
  • Modified getFilesystemFreeSpace to prioritize API-based capacity queries when possible
  • Added unit tests to verify both capacity query methods

How to test?

  1. Run the new unit tests using:
go test -v ./pkg/wekafs -args \
  -api-endpoint=<your-endpoint> \
  -api-username=<username> \
  -api-password=<password> \
  -api-org=<org> \
  -fs-name=<filesystem-name>
  1. Verify that both TestVolume_getFilesystemFreeSpaceByApi and TestVolume_getFilesystemFreeSpace pass
  2. Confirm that filesystem capacity queries return accurate, non-zero values

Why make this change?

To improve the accuracy and efficiency of filesystem capacity reporting by leveraging direct API queries instead of requiring filesystem mounts. This provides more reliable capacity information and reduces operational overhead.

Copy link
Collaborator Author

sergeyberezansky commented Mar 10, 2025

@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from 87cdfcb to 17cfafe Compare March 10, 2025 17:25
@sergeyberezansky sergeyberezansky force-pushed the sergey/panic-on-no-endpoints branch from 794e6f5 to 15d3499 Compare March 10, 2025 17:25
@sergeyberezansky sergeyberezansky changed the title feat(CSI-342): replace mount with API calls for several provisioning operations feat(CSI-342): get filesystem free space via API without requiring fs mount Mar 10, 2025
@sergeyberezansky sergeyberezansky marked this pull request as ready for review March 10, 2025 17:34
@graphite-app graphite-app bot requested a review from tigrawap March 10, 2025 17:34
Copy link

graphite-app bot commented Mar 10, 2025

Graphite Automations

"Request reviewers once CI passes" took an action on this PR • (03/10/25)

1 reviewer was added to this PR based on Sergey Berezansky's automation.

@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from 17cfafe to 7102b85 Compare March 10, 2025 18:07
@sergeyberezansky sergeyberezansky force-pushed the sergey/panic-on-no-endpoints branch from 15d3499 to 6ca8551 Compare March 10, 2025 18:07
Copy link
Collaborator Author

sergeyberezansky commented Mar 11, 2025

Merge activity

@sergeyberezansky sergeyberezansky changed the base branch from sergey/panic-on-no-endpoints to graphite-base/476 March 11, 2025 11:39
@sergeyberezansky sergeyberezansky added the enhancement New feature or request label Mar 11, 2025 — with Graphite App
@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from 7102b85 to dc109c0 Compare March 11, 2025 12:11
@sergeyberezansky sergeyberezansky changed the base branch from graphite-base/476 to sergey/panic-on-no-endpoints March 11, 2025 12:11
@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from dc109c0 to 7c18afd Compare March 11, 2025 12:39
@sergeyberezansky sergeyberezansky changed the base branch from sergey/panic-on-no-endpoints to graphite-base/476 March 12, 2025 08:26
@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from 7c18afd to c53f25d Compare March 12, 2025 08:26
@sergeyberezansky sergeyberezansky changed the base branch from graphite-base/476 to dev March 12, 2025 08:27
@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch 2 times, most recently from 350def4 to ff24efe Compare March 12, 2025 10:32
@sergeyberezansky sergeyberezansky changed the base branch from dev to graphite-base/476 March 12, 2025 12:52
@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from ff24efe to e551e20 Compare March 12, 2025 12:52
@sergeyberezansky sergeyberezansky changed the base branch from graphite-base/476 to sergey/update-labels-only-if-missing March 12, 2025 12:52
@sergeyberezansky sergeyberezansky force-pushed the sergey/update-labels-only-if-missing branch from f6fc4ea to 8428edc Compare March 12, 2025 13:36
@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from e551e20 to 64b2cce Compare March 12, 2025 13:36
@sergeyberezansky sergeyberezansky changed the base branch from sergey/update-labels-only-if-missing to graphite-base/476 March 12, 2025 13:49
@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from 64b2cce to 1a1c89e Compare March 12, 2025 13:49
@sergeyberezansky sergeyberezansky changed the base branch from graphite-base/476 to dev March 12, 2025 13:50
@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from 1a1c89e to 5a3a384 Compare March 12, 2025 13:50
@sergeyberezansky sergeyberezansky changed the base branch from dev to graphite-base/476 March 13, 2025 09:43
@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from 5a3a384 to f57ffce Compare March 13, 2025 09:43
@sergeyberezansky sergeyberezansky changed the base branch from graphite-base/476 to sergey/forbid-wekafs-mount-on-no-client March 13, 2025 09:43
@sergeyberezansky sergeyberezansky changed the base branch from sergey/forbid-wekafs-mount-on-no-client to graphite-base/476 March 13, 2025 10:16
@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from f57ffce to 99545be Compare March 13, 2025 10:17
@sergeyberezansky sergeyberezansky changed the base branch from graphite-base/476 to dev March 13, 2025 10:17
@sergeyberezansky sergeyberezansky force-pushed the sergey/replace-mounts-with-api branch from 99545be to 3e3c98f Compare March 13, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant