-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix redundant Jib image flags generated by init #3191
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,23 +187,19 @@ func TestCreateArtifact(t *testing.T) { | |
config: Jib{BuilderName: "Jib Gradle Plugin", FilePath: filepath.Join("path", "to", "build.gradle"), Image: "image", Project: "project"}, | ||
manifestImage: "different-image", | ||
expectedArtifact: latest.Artifact{ | ||
ImageName: "different-image", | ||
Workspace: filepath.Join("path", "to"), | ||
ArtifactType: latest.ArtifactType{ | ||
JibArtifact: &latest.JibArtifact{Project: "project", Flags: []string{"-Dimage=different-image"}, Type: string(JibGradle)}, | ||
}, | ||
ImageName: "different-image", | ||
Workspace: filepath.Join("path", "to"), | ||
ArtifactType: latest.ArtifactType{JibArtifact: &latest.JibArtifact{Project: "project", Type: string(JibGradle)}}, | ||
}, | ||
}, | ||
{ | ||
description: "jib gradle without image and project", | ||
config: Jib{BuilderName: "Jib Gradle Plugin", FilePath: filepath.Join("path", "to", "build.gradle")}, | ||
manifestImage: "different-image", | ||
expectedArtifact: latest.Artifact{ | ||
ImageName: "different-image", | ||
Workspace: filepath.Join("path", "to"), | ||
ArtifactType: latest.ArtifactType{ | ||
JibArtifact: &latest.JibArtifact{Flags: []string{"-Dimage=different-image"}, Type: string(JibGradle)}, | ||
}, | ||
ImageName: "different-image", | ||
Workspace: filepath.Join("path", "to"), | ||
ArtifactType: latest.ArtifactType{JibArtifact: &latest.JibArtifact{Type: string(JibGradle)}}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. About #3190 (comment), is it easy to get rid of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @briandealwis would know better than I. But I can try some stuff. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be safe to remove. |
||
}, | ||
}, | ||
{ | ||
|
@@ -213,19 +209,17 @@ func TestCreateArtifact(t *testing.T) { | |
expectedArtifact: latest.Artifact{ | ||
ImageName: "different-image", | ||
Workspace: filepath.Join("path", "to"), | ||
ArtifactType: latest.ArtifactType{JibArtifact: &latest.JibArtifact{Project: "project", Flags: []string{"-Dimage=different-image"}, Type: string(JibMaven)}}, | ||
ArtifactType: latest.ArtifactType{JibArtifact: &latest.JibArtifact{Project: "project", Type: string(JibMaven)}}, | ||
}, | ||
}, | ||
{ | ||
description: "jib maven without image and project", | ||
config: Jib{BuilderName: "Jib Maven Plugin", FilePath: filepath.Join("path", "to", "pom.xml")}, | ||
manifestImage: "different-image", | ||
expectedArtifact: latest.Artifact{ | ||
ImageName: "different-image", | ||
Workspace: filepath.Join("path", "to"), | ||
ArtifactType: latest.ArtifactType{ | ||
JibArtifact: &latest.JibArtifact{Flags: []string{"-Dimage=different-image"}, Type: string(JibMaven)}, | ||
}, | ||
ImageName: "different-image", | ||
Workspace: filepath.Join("path", "to"), | ||
ArtifactType: latest.ArtifactType{JibArtifact: &latest.JibArtifact{Type: string(JibMaven)}}, | ||
}, | ||
}, | ||
{ | ||
|
@@ -234,7 +228,7 @@ func TestCreateArtifact(t *testing.T) { | |
manifestImage: "different-image", | ||
expectedArtifact: latest.Artifact{ | ||
ImageName: "different-image", | ||
ArtifactType: latest.ArtifactType{JibArtifact: &latest.JibArtifact{Flags: []string{"-Dimage=different-image"}, Type: string(JibGradle)}}, | ||
ArtifactType: latest.ArtifactType{JibArtifact: &latest.JibArtifact{Type: string(JibGradle)}}, | ||
}, | ||
}, | ||
} | ||
|
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 should have been
--image
too, I think?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.
-Dimage=
will work as well, and I know--image
doesn't work when put before, say,jibDockerBuild
, so I prefer it to--image
. It's safer.