-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pack should support run image extension on Platform API 0.12 #1698
Conversation
Signed-off-by: Natalie Arellano <narellano@vmware.com>
look in <layers>/generated/build for Dockerfiles instead of looking in the order. Extensions could have been present in the order, but not detected. Signed-off-by: Natalie Arellano <narellano@vmware.com>
…ayers>/analyzed.toml and check if extend is true. Signed-off-by: Natalie Arellano <narellano@vmware.com>
…ions Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
4f16428
to
46578c1
Compare
Signed-off-by: Natalie Arellano <narellano@vmware.com>
…irectory Signed-off-by: Natalie Arellano <narellano@vmware.com>
4ee84fb
to
8863809
Compare
Signed-off-by: Natalie Arellano <narellano@vmware.com>
…te successfully <layers>/generated/build isn't guaranteed to exist Signed-off-by: Natalie Arellano <narellano@vmware.com>
cde918b
to
1ba8367
Compare
Signed-off-by: Natalie Arellano <narellano@vmware.com>
925077c
to
0861bc7
Compare
@@ -798,7 +798,7 @@ func testAcceptance( | |||
it("creates builder", func() { | |||
// Linux containers (including Linux containers on Windows) | |||
extSimpleLayersDiffID := "sha256:b9e4a0ddfb650c7aa71d1e6aceea1665365e409b3078bfdc1e51c2b07ab2b423" | |||
extReadEnvDiffID := "sha256:b49f178f802bbeb04acf4776bd41dcea8c47504ce31b06b580ec697387629cf2" | |||
extReadEnvDiffID := "sha256:ab7419c5e0b1a0789bd07cef2ed0573ec6e98eb05d7f05eb95d4f035243e331c" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the fixture, so the SHA changed
}) | ||
}) | ||
|
||
when("there are run image extensions", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test won't run in CI until there's a lifecycle that supports run image extension. But I've verified with my dev lifecycle that it does the job.
Signed-off-by: Natalie Arellano <narellano@vmware.com>
7901654
to
d83204c
Compare
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Personally I think Codecov is being too picky, but I'll see about adding some more tests. I think this is ready for feedback now |
l.assert.ContainsAll(l.output, "[detector]", "[analyzer]", "[extender]", "[exporter]") | ||
// Earlier pack versions print `[extender]`, later pack versions print `[extender (build)]`. | ||
// Removing the `]` for the extend phase allows us to navigate compat suite complexity without undo headache. | ||
// When previous pack is old enough, we can make the matcher more precise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice explanatory comment :)
internal/build/container_ops.go
Outdated
// CopyOutErr copies container directories to a handler function. The handler is responsible for closing the Reader. | ||
// CopyOutErr differs from CopyOut in that it does not require the source files to exist in the container | ||
// in order to exit without error. | ||
func CopyOutErr(handler func(closer io.ReadCloser) error, srcs ...string) ContainerOperation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit but also the two hardest things in computer science, amirite ? I had to read your carefully written note to understand what this name means.
What are the options?
i think there's an existing go idiom where you could rename the other function to MustCopyOut
and then call this one CopyOut
? which of course would only endlessly confuse people who used to know the behavior/contract of the old function, i.e. the existing maintainers...
i think in some other languages with paradigms for optional types there's conventions around putting words like "maybe" to indicate that something might return what you asked for but it's the caller's job to check. To make that explicit in go could we add "permits" e.g. CopyOutPermitsErr
? is there some other word?
it's possible that this is a golang idiom; feel free to tell me I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test to this branch/PR d6aedda to try and cover this. But I didn't understand the statement well enough to write a test "does not require the source files to exist in the container in order to exit without error".
I think maybe CopyOutMaybe
is a better name? I'd like a test for this too, but I'm struggling to understand it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CopyOutMaybe
sounds good to me - updated in 24ce465 along with the comment to hopefully be more clear
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Also test that -stack is provided for older platforms Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Green! |
Fixes #1620