Skip to content

Fixes wrong timestamp calculation#5988

Merged
eddumelendez merged 1 commit into
testcontainers:mainfrom
leblonk:leblonk-patch-1
Nov 1, 2022
Merged

Fixes wrong timestamp calculation#5988
eddumelendez merged 1 commit into
testcontainers:mainfrom
leblonk:leblonk-patch-1

Conversation

@leblonk

@leblonk leblonk commented Oct 12, 2022

Copy link
Copy Markdown
Contributor

As already noted in #4275

The docker api returns the created date in epoch seconds, not in epoch millis. This caused the max age pull policy to always pull the image, as the calculated date ended up in the 1970ies. This fixes that by parsing the date as seconds, rather than millis.
See documentation here: https://docs.docker.com/engine/api/v1.41/#tag/Image/operation/ImageList

Created | required | integerDate and time at which the image was created as a Unix timestamp (number of seconds sinds EPOCH).
-- | --

@leblonk leblonk requested a review from a team October 12, 2022 20:25
@leblonk

leblonk commented Oct 13, 2022

Copy link
Copy Markdown
Contributor Author

@kiview

@eddumelendez eddumelendez added this to the next milestone Nov 1, 2022
@eddumelendez eddumelendez merged commit 7dead16 into testcontainers:main Nov 1, 2022
@eddumelendez

Copy link
Copy Markdown
Member

@leblonk sorry for the delay and thanks for the contribution! This is now in main branch

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants