Skip to content

api/types/volume: move UpdateOptions to client.VolumeUpdateOptions#51205

Merged
thaJeztah merged 1 commit intomoby:masterfrom
austinvazquez:move-volume-update-options-to-client
Oct 17, 2025
Merged

api/types/volume: move UpdateOptions to client.VolumeUpdateOptions#51205
thaJeztah merged 1 commit intomoby:masterfrom
austinvazquez:move-volume-update-options-to-client

Conversation

@austinvazquez
Copy link
Contributor

@austinvazquez austinvazquez commented Oct 16, 2025

- 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

api/types/volume: moved `UpdateOptions` into client module

- A picture of a cute animal (not mandatory but encouraged)

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
Copy link
Member

Choose a reason for hiding this comment

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

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.Version as positional argument, which is good because it's required
  • ... for cluster volumes 👈 👈👈👈
  • But it also prevents us from ever using Client.VolumeUpdate for 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.Version part 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; UpdateClusterVolumes having it as positional argument (but using that positional argument to fill-in the option-struct's swarm.version field)
  • Or distinct option-structs (but calling the same API endpoint under the hood)

LOL; I clearly need to think a bit about this.

@thaJeztah
Copy link
Member

Ah; same failure

=== RUN   TestMacAddressIsAppliedToMainNetworkWithShortID
    run_linux_test.go:279: assertion failed: error is not nil: Error response from daemon: client version 1.43 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version
--- FAIL: TestMacAddressIsAppliedToMainNetworkWithShortID (0.80s)

@austinvazquez austinvazquez force-pushed the move-volume-update-options-to-client branch from 7acc64a to 96f7ff2 Compare October 16, 2025 20:43
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
@austinvazquez austinvazquez force-pushed the move-volume-update-options-to-client branch from 96f7ff2 to aa36c44 Compare October 16, 2025 21:08
@austinvazquez austinvazquez added area/api API impact/api kind/refactor PR's that refactor, or clean-up code labels Oct 16, 2025
@austinvazquez austinvazquez added this to the 29.0.0 milestone Oct 16, 2025
@austinvazquez austinvazquez marked this pull request as ready for review October 16, 2025 21:24
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit bb749ba into moby:master Oct 17, 2025
292 of 298 checks passed
@austinvazquez austinvazquez deleted the move-volume-update-options-to-client branch October 17, 2025 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

volume_update.go

2 participants