Skip to content

[23.0 backport] Fix volume CreatedAt being altered on initialization#44725

Merged
thaJeztah merged 1 commit into
moby:23.0from
thaJeztah:23.0_backport_fix_volume_createdat
Jan 3, 2023
Merged

[23.0 backport] Fix volume CreatedAt being altered on initialization#44725
thaJeztah merged 1 commit into
moby:23.0from
thaJeztah:23.0_backport_fix_volume_createdat

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

The CreatedAt date was determined from the volume's _data directory (/var/lib/docker/volumes/<volumename>/_data). However, when initializing a volume, this directory is updated, causing the date to change.

Instead of using the _data directory, use its root directory, which is not updated afterwards, and should reflect the time that the volume was created.

This is basically the same as the original PR, but uses rootPath directly instead of manipulating the path.

- Description for the changelog
Volume's CreatedAt doesn't change when volume content is modified.

@thaJeztah thaJeztah added this to the 23.0.0 milestone Dec 31, 2022
@neersighted neersighted marked this pull request as draft January 3, 2023 16:00
@neersighted
Copy link
Copy Markdown
Member

Moved to draft as the original commit changed and this needs to be cherry-picked again.

The CreatedAt date was determined from the volume's `_data`
directory (`/var/lib/docker/volumes/<volumename>/_data`).
However, when initializing a volume, this directory is updated,
causing the date to change.

Instead of using the `_data` directory, use its parent directory,
which is not updated afterwards, and should reflect the time that
the volume was created.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Paweł Gronowski <[email protected]>
(cherry picked from commit 01fd23b)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Copy Markdown
Member Author

No worries; it was a bit of a gamble; I re-cherry-picked

@thaJeztah thaJeztah force-pushed the 23.0_backport_fix_volume_createdat branch from b0e0d86 to fe097e0 Compare January 3, 2023 16:56
@thaJeztah thaJeztah marked this pull request as ready for review January 3, 2023 16:56
@thaJeztah thaJeztah merged commit cb13848 into moby:23.0 Jan 3, 2023
@thaJeztah thaJeztah deleted the 23.0_backport_fix_volume_createdat branch January 3, 2023 20:43
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.

2 participants