Skip to content

fix: remove current time from random.Image history#1678

Merged
jonjohnsonjr merged 1 commit intogoogle:mainfrom
ktarplee:random-source-fix
Apr 27, 2023
Merged

fix: remove current time from random.Image history#1678
jonjohnsonjr merged 1 commit intogoogle:mainfrom
ktarplee:random-source-fix

Conversation

@ktarplee
Copy link
Copy Markdown
Contributor

The history contained the time.Now() which I missed in my prior PR #1675 . Using the current time makes the random images non-reproducible which defeats the purpose of setting the random source. I removed the CreatedBy time since it is optional according to the OCI spec. We could instead use the random source to generate a random time but the time is not used for anything important so I do not see the value in doing that.

I added tests that revealed the issue then fixed the issue.

Related to #1674

This makes the images non-reproducible which defeats the purpose of setting the random source.
Copy link
Copy Markdown
Collaborator

@jonjohnsonjr jonjohnsonjr left a comment

Choose a reason for hiding this comment

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

Thanks again!

@jonjohnsonjr jonjohnsonjr merged commit d64f9e0 into google:main Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants