-
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
Allow configuring jib
plugin type
#2964
Conversation
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.
Is it possible to update old schemas? There's a build error saying you shouldn't (if I understood it right).
Codecov Report
|
@@ -778,6 +778,8 @@ type JibArtifact struct { | |||
// For example: `["--no-build-cache"]`. | |||
Flags []string `yaml:"args,omitempty"` | |||
|
|||
// Type the Jib builder type (internal: see jib.PluginType) | |||
Type int `yaml:"-"` |
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 be fine as it actually helps making the upgrade process to not break when the detection mechanism doesn't work. It is a conservative change. I will use admin rights to merge this PR.
Please visit http://35.236.103.231:1313 to view changes to the docs. |
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.
The Jib logic part looks good.
Sorry @balopat, this totally slipped through the cracks. |
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 wonder if we can make the string an enum / oneOf somehow
pkg/skaffold/schema/latest/config.go
Outdated
@@ -778,6 +778,8 @@ type JibArtifact struct { | |||
// For example: `["--no-build-cache"]`. | |||
Flags []string `yaml:"args,omitempty"` | |||
|
|||
// Type the Jib builder type (internal: see jib.PluginType) | |||
Type int `yaml:"-"` | |||
// Type the Jib builder type; normally determined automatically. Valid types are: |
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.
// Type the Jib builder type; normally determined automatically. Valid types are: | |
// Type the Jib builder type; if not set then it is detected automatically. Valid types are: |
I need to update this in light of #3041 |
I hacked up the schema generator to emit JSON schema |
This is awesome, thanks for putting the enum together as well! |
Merged with admin privileges for the historical version change as it actually helps with upgrades. |
Fixes #2963.
Note that this is a somewhat unorthodox change as it exposes an internal and previously ignored field from the
v1beta14
'sjib
config.Description
In #2808 we unified the
jibMaven
andjibGradle
configuration blocks into a singlejib
block. The Skaffold-Jib builder looks for certain files to determine the Jib plugin type (Maven or Gradle). We've had a report where Skaffold-Jib was unable to guess the Jib plugin type. This PR adds the ability to explicitly configure thejib
block to specify the plugin type.The unified
JibArtifact
already has aType
field which allows explicitly specifying the builder type. This field is internal and not marshalled. The intent was to expose this field to encode a Go enum (with correspondingMarshalYAML()
andUnmarshalYAML()
) but I punted at the time as it required teaching the schema generator to output JSON schemaenum
. But I realized that thepkg/skaffold/schema/validation
approach was easier, but it requires changing the type ofType
.User facing changes
This PR changes the type of
JibArtifact
'sType
field and exposes it. As a result:v1beta14
andv1beta15
'sjib
now have optionaltype
fieldsskaffold fix
onv1beta13
jibMaven
andjibGradle
configurations will now have atype
fieldReviewer Notes
Release Notes
jib
artifacts can explicitly specify the plugin type asmaven
orgradle