Skip to content

Conversation

@thaJeztah
Copy link
Member

This is part of a branch that I had locally (and recalled I had after Today's maintainers meeting)

More to come, including some (potential) bugs on Windows

volume/local: remove hack for downgrading docker 1.7 to 1.6

This was added in bd9814f (#13699) to support downgrading
docker 1.7 to 1.6.

The related migration code was removed in 0023abb (#36637)
(Docker 18.05), which was also the last consumer of VolumeDataPathName outside
of the package, so that const can be un-exported.

volume/local: remove redundant Root.scopedPath(), Root.scope

Now that there's no differentiation between Linux and Windows
for this check, we can remove the two implementations and move
the code inline as it's only used in a single location and moving
it inline makes it more transparent on what's being checked.

As part of this change, the now unused "scope" field is also removed.

volume/local.New(): remove some intermediate variables

volume/local.New(): remove redundant filepath.Base()

FileInfo.Name() returns the base name, so no need to remove path information.

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

thaJeztah added 4 commits May 13, 2022 00:33
This was added in bd9814f to support downgrading
docker 1.7 to 1.6.

The related migration code was removed in 0023abb
(Docker 18.05), which was also the last consumer of VolumeDataPathName outside
of the package, so that const can be un-exported.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Now that there's no differentiation between Linux and Windows
for this check, we can remove the two implementations and move
the code inline as it's only used in a single location and moving
it inline makes it more transparent on what's being checked.

As part of this change, the now unused "scope" field is also removed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
FileInfo.Name() returns the base name, so no need to remove
path information.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added status/2-code-review area/volumes Volumes area/daemon Core Engine kind/refactor PR's that refactor, or clean-up code labels May 12, 2022
@thaJeztah thaJeztah requested review from cpuguy83 and tianon May 12, 2022 22:44
Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/daemon Core Engine area/volumes Volumes kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants