Skip to content

Commit

Permalink
chore: Fix BuildContextCompressionLevel description, output the level (
Browse files Browse the repository at this point in the history
…#9688)

* chore: Fix BuildContextCompressionLevel description, output the level

Signed-off-by: Suleiman Dibirov <[email protected]>

* fixes

Signed-off-by: Suleiman Dibirov <[email protected]>

---------

Signed-off-by: Suleiman Dibirov <[email protected]>
  • Loading branch information
idsulik authored and plumpy committed Feb 4, 2025
1 parent f132ab2 commit bc67f8c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs-v2/content/en/schemas/v4beta12.json
Original file line number Diff line number Diff line change
Expand Up @@ -2672,8 +2672,8 @@
},
"buildContextCompressionLevel": {
"type": "integer",
"description": "gzip compression level for the build context.",
"x-intellij-html-description": "gzip compression level for the build context.",
"description": "gzip compression level(0-9) for the build context. 0: NoCompression. 1: BestSpeed. 9: BestCompression. -1: DefaultCompression. -2: HuffmanOnly.",
"x-intellij-html-description": "gzip compression level(0-9) for the build context. 0: NoCompression. 1: BestSpeed. 9: BestCompression. -1: DefaultCompression. -2: HuffmanOnly.",
"default": "1"
},
"cache": {
Expand Down
1 change: 1 addition & 0 deletions pkg/skaffold/build/cluster/kaniko.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func (b *Builder) copyKanikoBuildContext(ctx context.Context, out io.Writer, wor
errs := make(chan error, 1)
buildCtxReader, buildCtxWriter := io.Pipe()
gzipWriter, err := gzip.NewWriterLevel(buildCtxWriter, *artifact.BuildContextCompressionLevel)
log.Entry(ctx).Infof("Using gzip compression level %d", *artifact.BuildContextCompressionLevel)

if err != nil {
return fmt.Errorf("creating gzip writer: %w", err)
Expand Down
12 changes: 6 additions & 6 deletions pkg/skaffold/schema/latest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1555,13 +1555,13 @@ type KanikoArtifact struct {
// Defaults to 5 minutes (`5m`).
CopyTimeout string `yaml:"copyTimeout,omitempty"`

// BuildContextCompressionLevel is the gzip compression level for the build context.
// BuildContextCompressionLevel is the gzip compression level(0-9) for the build context.
// 0: NoCompression.
// 1: BestSpeed.
// 9: BestCompression.
// -1: DefaultCompression.
// -2: HuffmanOnly.
// Defaults to `1`.
// 0: NoCompression
// 1: BestSpeed
// 9: BestCompression
// -1: DefaultCompression
// -2: HuffmanOnly
BuildContextCompressionLevel *int `yaml:"buildContextCompressionLevel,omitempty"`
}

Expand Down

0 comments on commit bc67f8c

Please sign in to comment.