Skip to content

Commit

Permalink
chore(build): add verbose flag for Kaniko builds
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaferraro authored and astefanutti committed Jan 21, 2020
1 parent 3155e77 commit 1faab73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/modules/ROOT/pages/traits/builder.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ The following configuration options are available:
| bool
| Can be used to enable or disable a trait. All traits share this common property.

| builder.verbose
| bool
| Enable verbose logging on build components that support it (e.g. Kaniko build pod).

|===

// End of autogenerated code - DO NOT EDIT! (configuration)
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/traits/jolokia.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ applicable when `protocol` is `https` and `use-ssl-client-authentication` is `tr
(default `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt` for OpenShift).

| jolokia.client-principal
| string
| []string
| The principal which must be given in a client certificate to allow access to the Jolokia endpoint,
applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
(default `clientPrincipal=cn=system:master-proxy` for OpenShift).
Expand Down
6 changes: 6 additions & 0 deletions pkg/trait/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const builderDir = "/builder"
// +camel-k:trait=builder
type builderTrait struct {
BaseTrait `property:",squash"`
// Enable verbose logging on build components that support it (e.g. Kaniko build pod).
Verbose bool `property:"verbose"`
}

func newBuilderTrait() *builderTrait {
Expand Down Expand Up @@ -213,6 +215,10 @@ func (t *builderTrait) kanikoTask(e *Environment) (*v1.KanikoTask, error) {
args := make([]string, 0, len(baseArgs))
args = append(args, baseArgs...)

if t.Verbose {
args = append(args, "-v=debug")
}

if e.Platform.Status.Build.Registry.Insecure {
args = append(args, "--insecure")
args = append(args, "--insecure-pull")
Expand Down

0 comments on commit 1faab73

Please sign in to comment.