pkg/epoch: extract parsing SOURCE_DATE_EPOCH to a function#8732
Merged
estesp merged 3 commits intocontainerd:mainfrom Jun 23, 2023
Merged
pkg/epoch: extract parsing SOURCE_DATE_EPOCH to a function#8732estesp merged 3 commits intocontainerd:mainfrom
estesp merged 3 commits intocontainerd:mainfrom
Conversation
Teeny-tiny optimizations:
BenchmarkSprintf-10 37735996 32.31 ns/op 0 B/op 0 allocs/op
BenchmarkItoa-10 591945836 2.031 ns/op 0 B/op 0 allocs/op
BenchmarkFormatUint-10 593701444 2.014 ns/op 0 B/op 0 allocs/op
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Member
Author
|
/cc @crazy-max |
|
@thaJeztah: GitHub didn't allow me to request PR reviews from the following users: crazy-max. Note that only containerd members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
68f3eeb to
0f7efca
Compare
AkihiroSuda
reviewed
Jun 23, 2023
AkihiroSuda
reviewed
Jun 23, 2023
0f7efca to
4acae19
Compare
These tests were failing on my macOS; could be the precision issue (like on
Windows), or just because they're "too fast".
=== RUN TestSourceDateEpoch/WithoutSourceDateEpoch
epoch_test.go:51:
Error Trace: /Users/thajeztah/go/src/github.com/containerd/containerd/pkg/epoch/epoch_test.go:51
Error: Should be true
Test: TestSourceDateEpoch/WithoutSourceDateEpoch
Messages: now: 2023-06-23 11:47:09.93118 +0000 UTC, v: 2023-06-23 11:47:09.93118 +0000 UTC
This patch:
- updates the rightAfter utility to allow the timestamps to be "equal"
- updates the asserts to provide some details about the timestamps
- uses UTC for the value we're comparing to, to match the timestamps
that are generated.
Signed-off-by: Sebastiaan van Stijn <[email protected]>
4acae19 to
2b25a5f
Compare
This introduces a ParseSourceDateEpoch function, which can be used to parse "SOURCE_DATE_EPOCH" values for situations where those values are not passed through an env-var (or the env-var has been read through other means). Signed-off-by: Sebastiaan van Stijn <[email protected]>
2b25a5f to
8760b87
Compare
AkihiroSuda
approved these changes
Jun 23, 2023
estesp
approved these changes
Jun 23, 2023
dcantah
approved these changes
Jun 23, 2023
kiashok
added a commit
to kiashok/containerd
that referenced
this pull request
Oct 23, 2024
…/main Merge upstream containerd/main at commit 5d1ab01 into ado fork-external/main Related work items: containerd#7944, containerd#8174, containerd#8334, containerd#8362, containerd#8572, containerd#8582, containerd#8588, containerd#8605, containerd#8606, containerd#8617, containerd#8619, containerd#8626, containerd#8627, containerd#8633, containerd#8637, containerd#8641, containerd#8643, containerd#8645, containerd#8652, containerd#8667, containerd#8672, containerd#8673, containerd#8676, containerd#8680, containerd#8684, containerd#8685, containerd#8692, containerd#8696, containerd#8697, containerd#8701, containerd#8708, containerd#8717, containerd#8726, containerd#8728, containerd#8729, containerd#8731, containerd#8732, containerd#8740, containerd#8752, containerd#8758, containerd#8762, containerd#8764
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pkg/epoch: replace some fmt.Sprintfs with strconv
Teeny-tiny optimizations:
pkg/epoch: fix tests on macOS
These tests were failing on my macOS; could be the precision issue (like on
Windows), or just because they're "too fast".
This patch:
that are generated.
pkg/epoch: extract parsing SOURCE_DATE_EPOCH to a function
This introduces a ParseSourceDateEpoch function, which can be used
to parse "SOURCE_DATE_EPOCH" values for situations where those
values are not passed through an env-var (or the env-var has been
read through other means).