Allow configuring jib plugin type#2964
Conversation
chanseokoh
left a comment
There was a problem hiding this comment.
Is it possible to update old schemas? There's a build error saying you shouldn't (if I understood it right).
Codecov Report
|
| Flags []string `yaml:"args,omitempty"` | ||
|
|
||
| // Type the Jib builder type (internal: see jib.PluginType) | ||
| Type int `yaml:"-"` |
There was a problem hiding this comment.
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. |
chanseokoh
left a comment
There was a problem hiding this comment.
The Jib logic part looks good.
|
Sorry @balopat, this totally slipped through the cracks. |
balopat
left a comment
There was a problem hiding this comment.
I wonder if we can make the string an enum / oneOf somehow
pkg/skaffold/schema/latest/config.go
Outdated
|
|
||
| // 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.
| // 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'sjibconfig.Description
In #2808 we unified the
jibMavenandjibGradleconfiguration blocks into a singlejibblock. 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 thejibblock to specify the plugin type.The unified
JibArtifactalready has aTypefield 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/validationapproach was easier, but it requires changing the type ofType.User facing changes
This PR changes the type of
JibArtifact'sTypefield and exposes it. As a result:v1beta14andv1beta15'sjibnow have optionaltypefieldsskaffold fixonv1beta13jibMavenandjibGradleconfigurations will now have atypefieldReviewer Notes
Release Notes
jibartifacts can explicitly specify the plugin type asmavenorgradle