Skip to content
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

inspect-builder throws error with missing remote and local builder #406

Merged
merged 1 commit into from
Dec 9, 2019

Conversation

ktpv
Copy link
Contributor

@ktpv ktpv commented Dec 6, 2019

Signed-off-by: ktpv ktpv@users.noreply.github.com

@ktpv ktpv requested a review from a team as a code owner December 6, 2019 16:41
@ktpv ktpv changed the title fixes #386 inspect-builder throws error with missing remote and local builder Dec 6, 2019
remoteOutput, remoteWarnings, remoteErr := inspectBuilderOutput(client, cfg, imageName, false)
localOutput, localWarnings, localErr := inspectBuilderOutput(client, cfg, imageName, true)

if remoteOutput == "(not present)" && localOutput == "(not present)" {
Copy link
Member

Choose a reason for hiding this comment

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

I would feel more comfortable with a string comparison if it was a constant used inside the inspectBuilderOutput function and in this statement.

Alternatively, an additional return value similar to how maps returns a boolean value (ok) if it was found would work here.

No strong opinion either way but something should be changed to not just do arbitrary freeform string comparisons IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did the 2nd option and added additional return value 'present'

@@ -60,14 +60,12 @@ func testInspectBuilderCommand(t *testing.T, when spec.G, it spec.S) {

when("#Get", func() {
when("image cannot be found", func() {
it("logs 'Not present'", func() {
it("logs 'ERROR Unable'", func() {
Copy link
Member

@jromero jromero Dec 6, 2019

Choose a reason for hiding this comment

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

This should read it("errors when no image is found") or something similar.

Copy link
Member

Choose a reason for hiding this comment

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

We also need at least one test (preferably two) where we test when only one of the two is returned and ensure it doesn't error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done and done after reorganizing test data.

Signed-off-by: ktpv <ktpv@users.noreply.github.com>
@jromero jromero merged commit 3b65cd7 into buildpacks:master Dec 9, 2019
@ktpv ktpv deleted the i386_fix branch December 9, 2019 21:39
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