Skip to content
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

Add support for Kaniko flag --image-fs-extract-retry #6380

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/content/en/schemas/v2beta21.json
Original file line number Diff line number Diff line change
Expand Up @@ -2146,6 +2146,11 @@
"description": "Docker image used by the Kaniko pod. Defaults to the latest released version of `gcr.io/kaniko-project/executor`.",
"x-intellij-html-description": "Docker image used by the Kaniko pod. Defaults to the latest released version of <code>gcr.io/kaniko-project/executor</code>."
},
"imageFSExtractRetry": {
"type": "string",
"description": "number of retries that should happen for extracting an image filesystem.",
"x-intellij-html-description": "number of retries that should happen for extracting an image filesystem."
},
"imageNameWithDigestFile": {
"type": "string",
"description": "specify a file to save the image name with digest of the built image to.",
Expand Down Expand Up @@ -2325,6 +2330,7 @@
"initImage",
"image",
"digestFile",
"imageFSExtractRetry",
"imageNameWithDigestFile",
"logFormat",
"ociLayoutPath",
Expand Down
10 changes: 10 additions & 0 deletions pkg/skaffold/build/gcb/kaniko_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ func TestKanikoBuildSpec(t *testing.T) {
kaniko.ForceFlag,
},
},
{
description: "with ImageFSExtractRetry",
artifact: &latestV1.KanikoArtifact{
DockerfilePath: "Dockerfile",
ImageFSExtractRetry: "5",
},
expectedArgs: []string{
"--image-fs-extract-retry", "5",
},
},
{
description: "with ImageNameWithDigestFile",
artifact: &latestV1.KanikoArtifact{
Expand Down
4 changes: 4 additions & 0 deletions pkg/skaffold/build/kaniko/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func Args(artifact *latestV1.KanikoArtifact, tag, context string) ([]string, err
args = append(args, ForceFlag)
}

if artifact.ImageFSExtractRetry != "" {
args = append(args, ImageFSExtractRetryFlag, artifact.ImageFSExtractRetry)
}

if artifact.ImageNameWithDigestFile != "" {
args = append(args, ImageNameWithDigestFileFlag, artifact.ImageNameWithDigestFile)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/skaffold/build/kaniko/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const (
DigestFileFlag = "--digest-file"
// ForceFlag additional flag
ForceFlag = "--force"
// ImageFSExtractRetry additional flag
ImageFSExtractRetryFlag = "--image-fs-extract-retry"
// ImageNameWithDigestFileFlag additional flag
ImageNameWithDigestFileFlag = "--image-name-with-digest-file"
// InsecureFlag additional flag
Expand Down
3 changes: 3 additions & 0 deletions pkg/skaffold/schema/latest/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,9 @@ type KanikoArtifact struct {
// This can be used to automatically track the exact image built by kaniko.
DigestFile string `yaml:"digestFile,omitempty"`

// ImageFSExtractRetry is the number of retries that should happen for extracting an image filesystem.
ImageFSExtractRetry string `yaml:"imageFSExtractRetry,omitempty"`

// ImageNameWithDigestFile specify a file to save the image name with digest of the built image to.
ImageNameWithDigestFile string `yaml:"imageNameWithDigestFile,omitempty"`

Expand Down