api/types/volume: move UpdateOptions to client.VolumeUpdateOptions#51205
Merged
thaJeztah merged 1 commit intomoby:masterfrom Oct 17, 2025
Merged
Conversation
thaJeztah
reviewed
Oct 16, 2025
| VolumeRemove(ctx context.Context, volumeID string, force bool) error | ||
| VolumesPrune(ctx context.Context, opts VolumePruneOptions) (VolumePruneResult, error) | ||
| VolumeUpdate(ctx context.Context, volumeID string, version swarm.Version, options volume.UpdateOptions) error | ||
| VolumeUpdate(ctx context.Context, volumeID string, version swarm.Version, options VolumeUpdateOptions) error |
Member
There was a problem hiding this comment.
NOT for this PR, but something I need to think about a bit (perhaps would warrant a ticket);
- We currently ONLY support updating cluster volumes
- Making this effectively part of a (not-yet existing) Swarm / Cluster Interface
- The current signature has
swarm.Versionas positional argument, which is good because it's required - ... for cluster volumes 👈 👈👈👈
- But it also prevents us from ever using
Client.VolumeUpdatefor non-cluster volumes⚠️ - ☝️ ISTR there was some code .. somewhere that allows updating labels on volumes
- ☝️ which would be possible for non-cluster volumes
So... what options do we have?
- we could make the
swarm.Versionpart of the options-struct - but that would make it inconsistent with other swarm methods, which put it as positional to clearly indicate "required!"
- 💡 possibly we could move this method to
UpdateClusterVolumes, which has it as positional - Or duplicate the method;
UpdateClusterVolumeshaving it as positional argument (but using that positional argument to fill-in the option-struct'sswarm.versionfield) - Or distinct option-structs (but calling the same API endpoint under the hood)
LOL; I clearly need to think a bit about this.
Member
|
Ah; same failure
|
7acc64a to
96f7ff2
Compare
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
96f7ff2 to
aa36c44
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
fixes volume_update.go #51206
- How I did it
Lift and shift
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)