Repository navigation
feat(mount id): Support custom mount ID and rationalize only-dir early - #4991
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new mount-id configuration option to append a custom identifier to the mount ID in logs, and normalizes the OnlyDir path configuration to clean relative paths. The reviewer feedback highlights two main issues: first, cfg/config.go is an auto-generated file and should not be modified manually; second, the implementation of fsName in cmd/legacy_main.go needs to be more robust to handle leading/trailing slashes and GKE environments correctly to avoid duplicate path segments.
… large for some customers bloating the mountInstanceId
…abhishek/update_mount_id
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4991 +/- ##
==========================================
- Coverage 83.79% 83.78% -0.02%
==========================================
Files 173 173
Lines 21316 21318 +2
==========================================
- Hits 17862 17861 -1
- Misses 2774 2776 +2
- Partials 680 681 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
#4991) Adding support for specifying a custom Mount ID to be included in mount instance id and refactors only-dir path rationalization so that it is normalized early during configuration processing.
Description
This PR introduces support for specifying a custom Mount ID to be included in mount instance id and refactors
only-dirpath rationalization so that it is normalized early during configuration processing.Key Changes
1. Custom Mount ID Support in Logs
mount-id(mountId) support to the command-line flags and configuration parameters.MountInstanceIDininternal/loggerto combinefsName, an auto-generated UUID, and an optional custom ID (<fsName>-<customID>-<uuid>when configured, or<fsName>-<uuid>when empty).InitLogFile), default logger updates (UpdateDefaultLogger), and legacy fuse loggers (NewLegacyLogger) to accept and attach the custom mount ID attribute (gcsfuse-mount-id).2. Early Rationalization of
only-dirresolveOnlyDirincfg/rationalize.goto sanitize and normalizeOnlyDirearly (removing leading/trailing slashes and resolving relative segments like..).cmd/legacy_main.go,internal/gcsx/bucket_manager.go, andinternal/storage/storage_handle.go.Testing
MountInstanceIDformatting with and withoutcustomID(internal/logger/logger_test.go).resolveOnlyDirsanitization edge cases (cfg/rationalize_test.go).Link to the issue in case of a bug fix.
b/535703440
Testing details
Any backward incompatible change? If so, please explain.