From e7593b1cc6b0cec004d026c241a2dd75f9b55604 Mon Sep 17 00:00:00 2001 From: David Hovey Date: Wed, 20 Nov 2019 11:08:31 -0700 Subject: [PATCH 01/11] Added config to HelmRelease --- docs/content/en/schemas/v2alpha1.json | 10 ++++-- pkg/skaffold/deploy/helm.go | 11 ++++++ pkg/skaffold/deploy/helm_test.go | 50 +++++++++++++++++++++++++++ pkg/skaffold/schema/latest/config.go | 6 +++- 4 files changed, 74 insertions(+), 3 deletions(-) diff --git a/docs/content/en/schemas/v2alpha1.json b/docs/content/en/schemas/v2alpha1.json index d514c464a49..08cdee5d97f 100755 --- a/docs/content/en/schemas/v2alpha1.json +++ b/docs/content/en/schemas/v2alpha1.json @@ -1243,8 +1243,8 @@ }, "remote": { "type": "boolean", - "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true`.", - "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true.", + "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true` and `upgradeOnChange: false`. `remote: false` implies `upgradeOnChange: true`.", + "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true and upgradeOnChange: false. remote: false implies upgradeOnChange: true.", "default": "false" }, "setFiles": { @@ -1280,6 +1280,11 @@ "x-intellij-html-description": "should build dependencies be skipped.", "default": "false" }, + "upgradeOnChange": { + "type": "boolean", + "description": "specifics whether to upgrade helm chart on code changes.", + "x-intellij-html-description": "specifics whether to upgrade helm chart on code changes." + }, "useHelmSecrets": { "type": "boolean", "description": "instructs skaffold to use secrets plugin on deployment.", @@ -1331,6 +1336,7 @@ "skipBuildDependencies", "useHelmSecrets", "remote", + "upgradeOnChange", "overrides", "packaged", "imageStrategy" diff --git a/pkg/skaffold/deploy/helm.go b/pkg/skaffold/deploy/helm.go index 9d8fb50b783..9ff39b9ad13 100644 --- a/pkg/skaffold/deploy/helm.go +++ b/pkg/skaffold/deploy/helm.go @@ -204,6 +204,9 @@ func (h *HelmDeployer) deployRelease(ctx context.Context, out io.Writer, r lates if !isInstalled { args = append(args, "install", "--name", releaseName) args = append(args, h.Flags.Install...) + } else if !h.shouldUpgradeOnChange(r) { + logrus.Infof("Release %s already installed...\n", releaseName) + return []Artifact{}, nil } else { args = append(args, "upgrade", releaseName) args = append(args, h.Flags.Upgrade...) @@ -541,3 +544,11 @@ func expandPaths(paths []string) []string { return paths } + +func (h *HelmDeployer) shouldUpgradeOnChange(r latest.HelmRelease) bool { + if r.UpgradeOnChange != nil { + return *r.UpgradeOnChange + } + + return !r.Remote +} diff --git a/pkg/skaffold/deploy/helm_test.go b/pkg/skaffold/deploy/helm_test.go index d318e3cfe9f..95d8b6921ea 100644 --- a/pkg/skaffold/deploy/helm_test.go +++ b/pkg/skaffold/deploy/helm_test.go @@ -212,6 +212,15 @@ var testDeployRemoteChart = latest.HelmDeploy{ }}, } +var upgradeOnChangeFalse = false +var testDeployUpgradeOnChange = latest.HelmDeploy{ + Releases: []latest.HelmRelease{{ + Name: "skaffold-helm-upgradeOnChange", + ChartPath: "examples/test", + UpgradeOnChange: &upgradeOnChangeFalse, + }}, +} + var testDeployWithoutTags = latest.HelmDeploy{ Releases: []latest.HelmRelease{{ Name: "skaffold-helm", @@ -339,6 +348,15 @@ func TestHelmDeploy(t *testing.T) { runContext: makeRunContext(testDeploySkipBuildDependencies, false), builds: testBuilds, }, + { + description: "deploy success when `upgradeOnChange: false` and does not upgrade", + commands: &MockHelm{ + installResult: fmt.Errorf("should not have called install"), + upgradeResult: fmt.Errorf("should not have called upgrade"), + }, + runContext: makeRunContext(testDeployUpgradeOnChange, false), + builds: testBuilds, + }, { description: "deploy error remote chart without skipBuildDependencies", commands: &MockHelm{ @@ -859,6 +877,38 @@ func TestGetSetFileValues(t *testing.T) { } } +func TestShouldUpgradeOnChange(t *testing.T) { + trueBool := true + tests := []struct { + description string + input latest.HelmRelease + expected bool + }{ + { + description: "Default `UpgradeOnChange: false` when `Remote: true`", + input: latest.HelmRelease{Remote: true, UpgradeOnChange: nil}, + expected: false, + }, + { + description: "Default `UpgradeOnChange: true` when `Remote: false`", + input: latest.HelmRelease{Remote: false, UpgradeOnChange: nil}, + expected: true, + }, + { + description: "Uses upgradeOnChange value regardless of Remote value", + input: latest.HelmRelease{Remote: true, UpgradeOnChange: &trueBool}, + expected: true, + }, + } + for _, test := range tests { + testutil.Run(t, test.description, func(t *testutil.T) { + deployer := NewHelmDeployer(&runcontext.RunContext{}) + + t.CheckDeepEqual(test.expected, deployer.shouldUpgradeOnChange(test.input)) + }) + } +} + func makeRunContext(deploy latest.HelmDeploy, force bool) *runcontext.RunContext { pipeline := latest.Pipeline{} pipeline.Deploy.DeployType.HelmDeploy = &deploy diff --git a/pkg/skaffold/schema/latest/config.go b/pkg/skaffold/schema/latest/config.go index 7f772471254..2140e0f8549 100644 --- a/pkg/skaffold/schema/latest/config.go +++ b/pkg/skaffold/schema/latest/config.go @@ -502,9 +502,13 @@ type HelmRelease struct { UseHelmSecrets bool `yaml:"useHelmSecrets,omitempty"` // Remote specifies whether the chart path is remote, or exists on the host filesystem. - // `remote: true` implies `skipBuildDependencies: true`. + // `remote: true` implies `skipBuildDependencies: true` and `upgradeOnChange: false`. + // `remote: false` implies `upgradeOnChange: true`. Remote bool `yaml:"remote,omitempty"` + // UpgradeOnChange specifics whether to upgrade helm chart on code changes. + UpgradeOnChange *bool `yaml:"upgradeOnChange,omitempty"` + // Overrides are key-value pairs. // If present, Skaffold will build a Helm `values` file that overrides // the original and use it to call Helm CLI (`--f` flag). From 05b2a7105f1f9968a1989d4fb233ae040ca66a6d Mon Sep 17 00:00:00 2001 From: David Hovey Date: Wed, 27 Nov 2019 10:07:38 -0700 Subject: [PATCH 02/11] Fixed spelling error in comment for HelmRelease.upgradeOnChange --- docs/content/en/schemas/v2alpha1.json | 4 ++-- pkg/skaffold/schema/latest/config.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/en/schemas/v2alpha1.json b/docs/content/en/schemas/v2alpha1.json index 08cdee5d97f..8a3ece57d15 100755 --- a/docs/content/en/schemas/v2alpha1.json +++ b/docs/content/en/schemas/v2alpha1.json @@ -1282,8 +1282,8 @@ }, "upgradeOnChange": { "type": "boolean", - "description": "specifics whether to upgrade helm chart on code changes.", - "x-intellij-html-description": "specifics whether to upgrade helm chart on code changes." + "description": "specifies whether to upgrade helm chart on code changes.", + "x-intellij-html-description": "specifies whether to upgrade helm chart on code changes." }, "useHelmSecrets": { "type": "boolean", diff --git a/pkg/skaffold/schema/latest/config.go b/pkg/skaffold/schema/latest/config.go index 2140e0f8549..f33c66082bd 100644 --- a/pkg/skaffold/schema/latest/config.go +++ b/pkg/skaffold/schema/latest/config.go @@ -506,7 +506,7 @@ type HelmRelease struct { // `remote: false` implies `upgradeOnChange: true`. Remote bool `yaml:"remote,omitempty"` - // UpgradeOnChange specifics whether to upgrade helm chart on code changes. + // UpgradeOnChange specifies whether to upgrade helm chart on code changes. UpgradeOnChange *bool `yaml:"upgradeOnChange,omitempty"` // Overrides are key-value pairs. From fdbf65b6a11e35c49083fe93f2302b51fc9a759a Mon Sep 17 00:00:00 2001 From: David Hovey Date: Mon, 17 Feb 2020 11:07:35 -0700 Subject: [PATCH 03/11] Added more logging for 'upgradeOnChange' default values --- pkg/skaffold/deploy/helm.go | 43 +++++++++++++++++++------------- pkg/skaffold/deploy/helm_test.go | 32 ------------------------ 2 files changed, 26 insertions(+), 49 deletions(-) diff --git a/pkg/skaffold/deploy/helm.go b/pkg/skaffold/deploy/helm.go index fdbed0a8a6f..728989b5037 100644 --- a/pkg/skaffold/deploy/helm.go +++ b/pkg/skaffold/deploy/helm.go @@ -217,17 +217,34 @@ func (h *HelmDeployer) deployRelease(ctx context.Context, out io.Writer, r lates if !isInstalled { args = append(args, "install", "--name", releaseName) args = append(args, h.Flags.Install...) - } else if !h.shouldUpgradeOnChange(r) { - logrus.Infof("Release %s already installed...\n", releaseName) - return []Artifact{}, nil } else { - args = append(args, "upgrade", releaseName) - args = append(args, h.Flags.Upgrade...) - if h.forceDeploy { - args = append(args, "--force") + + var shouldUpgrade bool + if r.UpgradeOnChange != nil { + shouldUpgrade = *r.UpgradeOnChange + + if !shouldUpgrade { + logrus.Infof("Release %s already installed...\n", releaseName) + } + } else { + shouldUpgrade = !r.Remote + + if !shouldUpgrade { + logrus.Infof("Release %s not upgraded since remote (see `upgradeOnChange`)...\n", releaseName) + } } - if r.RecreatePods { - args = append(args, "--recreate-pods") + + if shouldUpgrade { + args = append(args, "upgrade", releaseName) + args = append(args, h.Flags.Upgrade...) + if h.forceDeploy { + args = append(args, "--force") + } + if r.RecreatePods { + args = append(args, "--recreate-pods") + } + } else { + return []Artifact{}, nil } } @@ -546,11 +563,3 @@ func expandPaths(paths []string) []string { return paths } - -func (h *HelmDeployer) shouldUpgradeOnChange(r latest.HelmRelease) bool { - if r.UpgradeOnChange != nil { - return *r.UpgradeOnChange - } - - return !r.Remote -} diff --git a/pkg/skaffold/deploy/helm_test.go b/pkg/skaffold/deploy/helm_test.go index fe287e06016..285ac1f085c 100644 --- a/pkg/skaffold/deploy/helm_test.go +++ b/pkg/skaffold/deploy/helm_test.go @@ -940,38 +940,6 @@ func TestGetSetFileValues(t *testing.T) { } } -func TestShouldUpgradeOnChange(t *testing.T) { - trueBool := true - tests := []struct { - description string - input latest.HelmRelease - expected bool - }{ - { - description: "Default `UpgradeOnChange: false` when `Remote: true`", - input: latest.HelmRelease{Remote: true, UpgradeOnChange: nil}, - expected: false, - }, - { - description: "Default `UpgradeOnChange: true` when `Remote: false`", - input: latest.HelmRelease{Remote: false, UpgradeOnChange: nil}, - expected: true, - }, - { - description: "Uses upgradeOnChange value regardless of Remote value", - input: latest.HelmRelease{Remote: true, UpgradeOnChange: &trueBool}, - expected: true, - }, - } - for _, test := range tests { - testutil.Run(t, test.description, func(t *testutil.T) { - deployer := NewHelmDeployer(&runcontext.RunContext{}) - - t.CheckDeepEqual(test.expected, deployer.shouldUpgradeOnChange(test.input)) - }) - } -} - func makeRunContext(deploy latest.HelmDeploy, force bool) *runcontext.RunContext { pipeline := latest.Pipeline{} pipeline.Deploy.DeployType.HelmDeploy = &deploy From c70e1248a2c9143d3e5fcf87fbfa451cb9718769 Mon Sep 17 00:00:00 2001 From: David Hovey Date: Mon, 17 Feb 2020 14:16:45 -0700 Subject: [PATCH 04/11] Upgrading schema to v2alpha4 --- docs/config.toml | 2 +- docs/content/en/schemas/v2alpha1.json | 10 +- docs/content/en/schemas/v2alpha4.json | 2069 +++++++++++++++++ integration/examples/bazel/skaffold.yaml | 2 +- .../examples/buildpacks-node/skaffold.yaml | 2 +- integration/examples/buildpacks/skaffold.yaml | 2 +- integration/examples/custom/skaffold.yaml | 2 +- integration/examples/gcb-kaniko/skaffold.yaml | 2 +- .../examples/generate-pipeline/skaffold.yaml | 2 +- .../examples/getting-started/skaffold.yaml | 2 +- .../examples/google-cloud-build/skaffold.yaml | 2 +- .../skaffold.yaml | 2 +- .../examples/helm-deployment/skaffold.yaml | 2 +- integration/examples/hot-reload/skaffold.yaml | 2 +- integration/examples/jib-gradle/skaffold.yaml | 2 +- .../examples/jib-multimodule/skaffold.yaml | 2 +- integration/examples/jib/skaffold.yaml | 2 +- integration/examples/kaniko/skaffold.yaml | 2 +- integration/examples/kustomize/skaffold.yaml | 2 +- .../examples/microservices/skaffold.yaml | 2 +- integration/examples/nodejs/skaffold.yaml | 2 +- .../examples/profile-patches/skaffold.yaml | 2 +- integration/examples/profiles/skaffold.yaml | 2 +- .../examples/react-reload/skaffold.yaml | 2 +- integration/examples/ruby/skaffold.yaml | 2 +- .../examples/structure-tests/skaffold.yaml | 2 +- .../skaffold.yaml | 2 +- integration/testdata/build/skaffold.yaml | 2 +- integration/testdata/debug/skaffold.yaml | 2 +- .../testdata/deploy-multiple/skaffold.yaml | 2 +- integration/testdata/dev/skaffold.yaml | 2 +- .../testdata/gke_loadbalancer/skaffold.yaml | 2 +- .../testdata/init/compose/skaffold.yaml | 2 +- integration/testdata/jib/skaffold.yaml | 2 +- .../kaniko-explicit-repo/skaffold.yaml | 2 +- .../app/skaffold.yaml | 2 +- .../kaniko-insecure-registry/skaffold.yaml | 2 +- .../kaniko-microservices/skaffold.yaml | 2 +- .../testdata/kaniko-sub-folder/skaffold.yaml | 2 +- .../testdata/kaniko-target/skaffold.yaml | 2 +- integration/testdata/tagPolicy/skaffold.yaml | 2 +- pkg/skaffold/schema/latest/config.go | 4 +- pkg/skaffold/schema/v2alpha2/upgrade.go | 2 +- pkg/skaffold/schema/v2alpha2/upgrade_test.go | 2 +- pkg/skaffold/schema/v2alpha3/config.go | 861 +++++++ pkg/skaffold/schema/v2alpha3/upgrade.go | 45 + pkg/skaffold/schema/v2alpha3/upgrade_test.go | 172 ++ pkg/skaffold/schema/versions.go | 2 + 48 files changed, 3194 insertions(+), 51 deletions(-) create mode 100755 docs/content/en/schemas/v2alpha4.json create mode 100755 pkg/skaffold/schema/v2alpha3/config.go create mode 100755 pkg/skaffold/schema/v2alpha3/upgrade.go create mode 100755 pkg/skaffold/schema/v2alpha3/upgrade_test.go diff --git a/docs/config.toml b/docs/config.toml index 9a099d4b4d0..30dd327b6b4 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -79,7 +79,7 @@ weight = 1 copyright = "Skaffold Authors" privacy_policy = "https://policies.google.com/privacy" github_repo = "https://github.com/GoogleContainerTools/skaffold" -skaffold_version = "skaffold/v2alpha3" +skaffold_version = "skaffold/v2alpha4" # Google Custom Search Engine ID. Remove or comment out to disable search. gcs_engine_id = "013756393218025596041:3nojel67sum" diff --git a/docs/content/en/schemas/v2alpha1.json b/docs/content/en/schemas/v2alpha1.json index dd6c8d65866..803b21b0527 100755 --- a/docs/content/en/schemas/v2alpha1.json +++ b/docs/content/en/schemas/v2alpha1.json @@ -1243,8 +1243,8 @@ }, "remote": { "type": "boolean", - "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true` and `upgradeOnChange: false`. `remote: false` implies `upgradeOnChange: true`.", - "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true and upgradeOnChange: false. remote: false implies upgradeOnChange: true.", + "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true`.", + "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true.", "default": "false" }, "setFiles": { @@ -1280,11 +1280,6 @@ "x-intellij-html-description": "should build dependencies be skipped.", "default": "false" }, - "upgradeOnChange": { - "type": "boolean", - "description": "specifies whether to upgrade helm chart on code changes.", - "x-intellij-html-description": "specifies whether to upgrade helm chart on code changes." - }, "useHelmSecrets": { "type": "boolean", "description": "instructs skaffold to use secrets plugin on deployment.", @@ -1336,7 +1331,6 @@ "skipBuildDependencies", "useHelmSecrets", "remote", - "upgradeOnChange", "overrides", "packaged", "imageStrategy" diff --git a/docs/content/en/schemas/v2alpha4.json b/docs/content/en/schemas/v2alpha4.json new file mode 100755 index 00000000000..433ac93fa92 --- /dev/null +++ b/docs/content/en/schemas/v2alpha4.json @@ -0,0 +1,2069 @@ +{ + "type": "object", + "anyOf": [ + { + "$ref": "#/definitions/SkaffoldConfig" + } + ], + "$schema": "http://json-schema-org/draft-07/schema#", + "definitions": { + "Activation": { + "properties": { + "command": { + "type": "string", + "description": "a Skaffold command for which the profile is auto-activated.", + "x-intellij-html-description": "a Skaffold command for which the profile is auto-activated.", + "examples": [ + "dev" + ] + }, + "env": { + "type": "string", + "description": "a `key=pattern` pair. The profile is auto-activated if an Environment Variable `key` matches the pattern. If the pattern starts with `!`, activation happens if the remaining pattern is _not_ matched. The pattern matches if the Environment Variable value is exactly `pattern`, or the regex `pattern` is found in it. An empty `pattern` (e.g. `env: \"key=\"`) always only matches if the Environment Variable is undefined or empty.", + "x-intellij-html-description": "a key=pattern pair. The profile is auto-activated if an Environment Variable key matches the pattern. If the pattern starts with !, activation happens if the remaining pattern is not matched. The pattern matches if the Environment Variable value is exactly pattern, or the regex pattern is found in it. An empty pattern (e.g. env: "key=") always only matches if the Environment Variable is undefined or empty.", + "examples": [ + "ENV=production" + ] + }, + "kubeContext": { + "type": "string", + "description": "a Kubernetes context for which the profile is auto-activated.", + "x-intellij-html-description": "a Kubernetes context for which the profile is auto-activated.", + "examples": [ + "minikube" + ] + } + }, + "preferredOrder": [ + "env", + "kubeContext", + "command" + ], + "additionalProperties": false, + "description": "criteria by which a profile is auto-activated.", + "x-intellij-html-description": "criteria by which a profile is auto-activated." + }, + "Artifact": { + "required": [ + "image" + ], + "anyOf": [ + { + "properties": { + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync" + ], + "additionalProperties": false + }, + { + "properties": { + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "docker": { + "$ref": "#/definitions/DockerArtifact", + "description": "*beta* describes an artifact built from a Dockerfile.", + "x-intellij-html-description": "beta describes an artifact built from a Dockerfile." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "docker" + ], + "additionalProperties": false + }, + { + "properties": { + "bazel": { + "$ref": "#/definitions/BazelArtifact", + "description": "*beta* requires bazel CLI to be installed and the sources to contain [Bazel](https://bazel.build/) configuration files.", + "x-intellij-html-description": "beta requires bazel CLI to be installed and the sources to contain Bazel configuration files." + }, + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "bazel" + ], + "additionalProperties": false + }, + { + "properties": { + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "jib": { + "$ref": "#/definitions/JibArtifact", + "description": "builds images using the [Jib plugins for Maven or Gradle](https://github.com/GoogleContainerTools/jib/).", + "x-intellij-html-description": "builds images using the Jib plugins for Maven or Gradle." + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "jib" + ], + "additionalProperties": false + }, + { + "properties": { + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "kaniko": { + "$ref": "#/definitions/KanikoArtifact", + "description": "builds images using [kaniko](https://github.com/GoogleContainerTools/kaniko).", + "x-intellij-html-description": "builds images using kaniko." + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "kaniko" + ], + "additionalProperties": false + }, + { + "properties": { + "buildpack": { + "$ref": "#/definitions/BuildpackArtifact", + "description": "builds images using [Cloud Native Buildpacks](https://buildpacks.io/).", + "x-intellij-html-description": "builds images using Cloud Native Buildpacks." + }, + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "buildpack" + ], + "additionalProperties": false + }, + { + "properties": { + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "custom": { + "$ref": "#/definitions/CustomArtifact", + "description": "*beta* builds images using a custom build script written by the user.", + "x-intellij-html-description": "beta builds images using a custom build script written by the user." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "custom" + ], + "additionalProperties": false + } + ], + "description": "items that need to be built, along with the context in which they should be built.", + "x-intellij-html-description": "items that need to be built, along with the context in which they should be built." + }, + "BazelArtifact": { + "required": [ + "target" + ], + "properties": { + "args": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional args to pass to `bazel build`.", + "x-intellij-html-description": "additional args to pass to bazel build.", + "default": "[]", + "examples": [ + "[\"-flag\", \"--otherflag\"]" + ] + }, + "target": { + "type": "string", + "description": "`bazel build` target to run.", + "x-intellij-html-description": "bazel build target to run.", + "examples": [ + "//:skaffold_example.tar" + ] + } + }, + "preferredOrder": [ + "target", + "args" + ], + "additionalProperties": false, + "description": "describes an artifact built with [Bazel](https://bazel.build/).", + "x-intellij-html-description": "describes an artifact built with Bazel." + }, + "BuildConfig": { + "anyOf": [ + { + "properties": { + "artifacts": { + "items": { + "$ref": "#/definitions/Artifact" + }, + "type": "array", + "description": "the images you're going to be building.", + "x-intellij-html-description": "the images you're going to be building." + }, + "insecureRegistries": { + "items": { + "type": "string" + }, + "type": "array", + "description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "x-intellij-html-description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "default": "[]" + }, + "tagPolicy": { + "$ref": "#/definitions/TagPolicy", + "description": "*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.", + "x-intellij-html-description": "beta determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to gitCommit: {variant: Tags}." + } + }, + "preferredOrder": [ + "artifacts", + "insecureRegistries", + "tagPolicy" + ], + "additionalProperties": false + }, + { + "properties": { + "artifacts": { + "items": { + "$ref": "#/definitions/Artifact" + }, + "type": "array", + "description": "the images you're going to be building.", + "x-intellij-html-description": "the images you're going to be building." + }, + "insecureRegistries": { + "items": { + "type": "string" + }, + "type": "array", + "description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "x-intellij-html-description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "default": "[]" + }, + "local": { + "$ref": "#/definitions/LocalBuild", + "description": "*beta* describes how to do a build on the local docker daemon and optionally push to a repository.", + "x-intellij-html-description": "beta describes how to do a build on the local docker daemon and optionally push to a repository." + }, + "tagPolicy": { + "$ref": "#/definitions/TagPolicy", + "description": "*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.", + "x-intellij-html-description": "beta determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to gitCommit: {variant: Tags}." + } + }, + "preferredOrder": [ + "artifacts", + "insecureRegistries", + "tagPolicy", + "local" + ], + "additionalProperties": false + }, + { + "properties": { + "artifacts": { + "items": { + "$ref": "#/definitions/Artifact" + }, + "type": "array", + "description": "the images you're going to be building.", + "x-intellij-html-description": "the images you're going to be building." + }, + "googleCloudBuild": { + "$ref": "#/definitions/GoogleCloudBuild", + "description": "*beta* describes how to do a remote build on [Google Cloud Build](https://cloud.google.com/cloud-build/).", + "x-intellij-html-description": "beta describes how to do a remote build on Google Cloud Build." + }, + "insecureRegistries": { + "items": { + "type": "string" + }, + "type": "array", + "description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "x-intellij-html-description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "default": "[]" + }, + "tagPolicy": { + "$ref": "#/definitions/TagPolicy", + "description": "*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.", + "x-intellij-html-description": "beta determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to gitCommit: {variant: Tags}." + } + }, + "preferredOrder": [ + "artifacts", + "insecureRegistries", + "tagPolicy", + "googleCloudBuild" + ], + "additionalProperties": false + }, + { + "properties": { + "artifacts": { + "items": { + "$ref": "#/definitions/Artifact" + }, + "type": "array", + "description": "the images you're going to be building.", + "x-intellij-html-description": "the images you're going to be building." + }, + "cluster": { + "$ref": "#/definitions/ClusterDetails", + "description": "*beta* describes how to do an on-cluster build.", + "x-intellij-html-description": "beta describes how to do an on-cluster build." + }, + "insecureRegistries": { + "items": { + "type": "string" + }, + "type": "array", + "description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "x-intellij-html-description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "default": "[]" + }, + "tagPolicy": { + "$ref": "#/definitions/TagPolicy", + "description": "*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.", + "x-intellij-html-description": "beta determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to gitCommit: {variant: Tags}." + } + }, + "preferredOrder": [ + "artifacts", + "insecureRegistries", + "tagPolicy", + "cluster" + ], + "additionalProperties": false + } + ], + "description": "contains all the configuration for the build steps.", + "x-intellij-html-description": "contains all the configuration for the build steps." + }, + "BuildpackArtifact": { + "required": [ + "builder" + ], + "properties": { + "builder": { + "type": "string", + "description": "builder image used.", + "x-intellij-html-description": "builder image used." + }, + "buildpacks": { + "items": { + "type": "string" + }, + "type": "array", + "description": "a list of strings, where each string is a specific buildpack to use with the builder. If you specify buildpacks the builder image automatic detection will be ignored. These buildpacks will be used to build the Image from your source code. Order matters.", + "x-intellij-html-description": "a list of strings, where each string is a specific buildpack to use with the builder. If you specify buildpacks the builder image automatic detection will be ignored. These buildpacks will be used to build the Image from your source code. Order matters.", + "default": "[]" + }, + "dependencies": { + "$ref": "#/definitions/BuildpackDependencies", + "description": "file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact.", + "x-intellij-html-description": "file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact." + }, + "env": { + "items": { + "type": "string" + }, + "type": "array", + "description": "environment variables, in the `key=value` form, passed to the build. Values can use the go template syntax.", + "x-intellij-html-description": "environment variables, in the key=value form, passed to the build. Values can use the go template syntax.", + "default": "[]", + "examples": [ + "[\"key1=value1\", \"key2=value2\", \"key3={{.ENV_VARIABLE}}\"]" + ] + }, + "runImage": { + "type": "string", + "description": "overrides the stack's default run image.", + "x-intellij-html-description": "overrides the stack's default run image." + } + }, + "preferredOrder": [ + "builder", + "runImage", + "env", + "buildpacks", + "dependencies" + ], + "additionalProperties": false, + "description": "*alpha* describes an artifact built using [Cloud Native Buildpacks](https://buildpacks.io/). It can be used to build images out of project's sources without any additional configuration.", + "x-intellij-html-description": "alpha describes an artifact built using Cloud Native Buildpacks. It can be used to build images out of project's sources without any additional configuration." + }, + "BuildpackDependencies": { + "properties": { + "ignore": { + "items": { + "type": "string" + }, + "type": "array", + "description": "specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both `paths` and in `ignore`, it will be ignored, and will be excluded from both rebuilds and file synchronization. Will only work in conjunction with `paths`.", + "x-intellij-html-description": "specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both paths and in ignore, it will be ignored, and will be excluded from both rebuilds and file synchronization. Will only work in conjunction with paths.", + "default": "[]" + }, + "paths": { + "items": { + "type": "string" + }, + "type": "array", + "description": "should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization.", + "x-intellij-html-description": "should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization.", + "default": "[]" + } + }, + "preferredOrder": [ + "paths", + "ignore" + ], + "additionalProperties": false, + "description": "*alpha* used to specify dependencies for an artifact built by a buildpack.", + "x-intellij-html-description": "alpha used to specify dependencies for an artifact built by a buildpack." + }, + "ClusterDetails": { + "properties": { + "HTTPS_PROXY": { + "type": "string", + "description": "for kaniko pod.", + "x-intellij-html-description": "for kaniko pod." + }, + "HTTP_PROXY": { + "type": "string", + "description": "for kaniko pod.", + "x-intellij-html-description": "for kaniko pod." + }, + "concurrency": { + "type": "integer", + "description": "how many artifacts can be built concurrently. 0 means \"no-limit\".", + "x-intellij-html-description": "how many artifacts can be built concurrently. 0 means "no-limit".", + "default": "0" + }, + "dockerConfig": { + "$ref": "#/definitions/DockerConfig", + "description": "describes how to mount the local Docker configuration into a pod.", + "x-intellij-html-description": "describes how to mount the local Docker configuration into a pod." + }, + "namespace": { + "type": "string", + "description": "Kubernetes namespace. Defaults to current namespace in Kubernetes configuration.", + "x-intellij-html-description": "Kubernetes namespace. Defaults to current namespace in Kubernetes configuration." + }, + "pullSecret": { + "type": "string", + "description": "path to the Google Cloud service account secret key file.", + "x-intellij-html-description": "path to the Google Cloud service account secret key file." + }, + "pullSecretMountPath": { + "type": "string", + "description": "path the pull secret will be mounted at within the running container.", + "x-intellij-html-description": "path the pull secret will be mounted at within the running container." + }, + "pullSecretName": { + "type": "string", + "description": "name of the Kubernetes secret for pulling base images and pushing the final image. If given, the secret needs to contain the Google Cloud service account secret key under the key `kaniko-secret`.", + "x-intellij-html-description": "name of the Kubernetes secret for pulling base images and pushing the final image. If given, the secret needs to contain the Google Cloud service account secret key under the key kaniko-secret.", + "default": "kaniko-secret" + }, + "randomDockerConfigSecret": { + "type": "boolean", + "description": "adds a random UUID postfix to the default name of the docker secret to facilitate parallel builds, e.g. docker-cfgfd154022-c761-416f-8eb3-cf8258450b85.", + "x-intellij-html-description": "adds a random UUID postfix to the default name of the docker secret to facilitate parallel builds, e.g. docker-cfgfd154022-c761-416f-8eb3-cf8258450b85.", + "default": "false" + }, + "randomPullSecret": { + "type": "boolean", + "description": "adds a random UUID postfix to the default name of the pull secret to facilitate parallel builds, e.g. kaniko-secretdocker-cfgfd154022-c761-416f-8eb3-cf8258450b85.", + "x-intellij-html-description": "adds a random UUID postfix to the default name of the pull secret to facilitate parallel builds, e.g. kaniko-secretdocker-cfgfd154022-c761-416f-8eb3-cf8258450b85.", + "default": "false" + }, + "resources": { + "$ref": "#/definitions/ResourceRequirements", + "description": "define the resource requirements for the kaniko pod.", + "x-intellij-html-description": "define the resource requirements for the kaniko pod." + }, + "timeout": { + "type": "string", + "description": "amount of time (in seconds) that this build is allowed to run. Defaults to 20 minutes (`20m`).", + "x-intellij-html-description": "amount of time (in seconds) that this build is allowed to run. Defaults to 20 minutes (20m)." + }, + "volumes": { + "items": {}, + "type": "array", + "description": "defines container mounts for ConfigMap and Secret resources.", + "x-intellij-html-description": "defines container mounts for ConfigMap and Secret resources.", + "default": "[]" + } + }, + "preferredOrder": [ + "HTTP_PROXY", + "HTTPS_PROXY", + "pullSecret", + "pullSecretName", + "pullSecretMountPath", + "namespace", + "timeout", + "dockerConfig", + "resources", + "concurrency", + "volumes", + "randomPullSecret", + "randomDockerConfigSecret" + ], + "additionalProperties": false, + "description": "*beta* describes how to do an on-cluster build.", + "x-intellij-html-description": "beta describes how to do an on-cluster build." + }, + "CustomArtifact": { + "properties": { + "buildCommand": { + "type": "string", + "description": "command executed to build the image.", + "x-intellij-html-description": "command executed to build the image." + }, + "dependencies": { + "$ref": "#/definitions/CustomDependencies", + "description": "file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact.", + "x-intellij-html-description": "file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact." + } + }, + "preferredOrder": [ + "buildCommand", + "dependencies" + ], + "additionalProperties": false, + "description": "*beta* describes an artifact built from a custom build script written by the user. It can be used to build images with builders that aren't directly integrated with skaffold.", + "x-intellij-html-description": "beta describes an artifact built from a custom build script written by the user. It can be used to build images with builders that aren't directly integrated with skaffold." + }, + "CustomDependencies": { + "properties": { + "command": { + "type": "string", + "description": "represents a custom command that skaffold executes to obtain dependencies. The output of this command *must* be a valid JSON array.", + "x-intellij-html-description": "represents a custom command that skaffold executes to obtain dependencies. The output of this command must be a valid JSON array." + }, + "dockerfile": { + "$ref": "#/definitions/DockerfileDependency", + "description": "should be set if the artifact is built from a Dockerfile, from which skaffold can determine dependencies.", + "x-intellij-html-description": "should be set if the artifact is built from a Dockerfile, from which skaffold can determine dependencies." + }, + "ignore": { + "items": { + "type": "string" + }, + "type": "array", + "description": "specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both `paths` and in `ignore`, it will be ignored, and will be excluded from both rebuilds and file synchronization. Will only work in conjunction with `paths`.", + "x-intellij-html-description": "specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both paths and in ignore, it will be ignored, and will be excluded from both rebuilds and file synchronization. Will only work in conjunction with paths.", + "default": "[]" + }, + "paths": { + "items": { + "type": "string" + }, + "type": "array", + "description": "should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization.", + "x-intellij-html-description": "should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization.", + "default": "[]" + } + }, + "preferredOrder": [ + "dockerfile", + "command", + "paths", + "ignore" + ], + "additionalProperties": false, + "description": "*beta* used to specify dependencies for an artifact built by a custom build script. Either `dockerfile` or `paths` should be specified for file watching to work as expected.", + "x-intellij-html-description": "beta used to specify dependencies for an artifact built by a custom build script. Either dockerfile or paths should be specified for file watching to work as expected." + }, + "DateTimeTagger": { + "properties": { + "format": { + "type": "string", + "description": "formats the date and time. See [#Time.Format](https://golang.org/pkg/time/#Time.Format).", + "x-intellij-html-description": "formats the date and time. See #Time.Format.", + "default": "2006-01-02_15-04-05.999_MST" + }, + "timezone": { + "type": "string", + "description": "sets the timezone for the date and time. See [Time.LoadLocation](https://golang.org/pkg/time/#Time.LoadLocation). Defaults to the local timezone.", + "x-intellij-html-description": "sets the timezone for the date and time. See Time.LoadLocation. Defaults to the local timezone." + } + }, + "preferredOrder": [ + "format", + "timezone" + ], + "additionalProperties": false, + "description": "*beta* tags images with the build timestamp.", + "x-intellij-html-description": "beta tags images with the build timestamp." + }, + "DeployConfig": { + "properties": { + "helm": { + "$ref": "#/definitions/HelmDeploy", + "description": "*beta* uses the `helm` CLI to apply the charts to the cluster.", + "x-intellij-html-description": "beta uses the helm CLI to apply the charts to the cluster." + }, + "kubeContext": { + "type": "string", + "description": "Kubernetes context that Skaffold should deploy to.", + "x-intellij-html-description": "Kubernetes context that Skaffold should deploy to.", + "examples": [ + "minikube" + ] + }, + "kubectl": { + "$ref": "#/definitions/KubectlDeploy", + "description": "*beta* uses a client side `kubectl apply` to deploy manifests. You'll need a `kubectl` CLI version installed that's compatible with your cluster.", + "x-intellij-html-description": "beta uses a client side kubectl apply to deploy manifests. You'll need a kubectl CLI version installed that's compatible with your cluster." + }, + "kustomize": { + "$ref": "#/definitions/KustomizeDeploy", + "description": "*beta* uses the `kustomize` CLI to \"patch\" a deployment for a target environment.", + "x-intellij-html-description": "beta uses the kustomize CLI to "patch" a deployment for a target environment." + }, + "statusCheckDeadlineSeconds": { + "type": "integer", + "description": "*beta* deadline for deployments to stabilize in seconds.", + "x-intellij-html-description": "beta deadline for deployments to stabilize in seconds." + } + }, + "preferredOrder": [ + "helm", + "kubectl", + "kustomize", + "statusCheckDeadlineSeconds", + "kubeContext" + ], + "additionalProperties": false, + "description": "contains all the configuration needed by the deploy steps.", + "x-intellij-html-description": "contains all the configuration needed by the deploy steps." + }, + "DockerArtifact": { + "properties": { + "buildArgs": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "arguments passed to the docker build.", + "x-intellij-html-description": "arguments passed to the docker build.", + "default": "{}", + "examples": [ + "{\"key1\": \"value1\", \"key2\": \"value2\"}" + ] + }, + "cacheFrom": { + "items": { + "type": "string" + }, + "type": "array", + "description": "the Docker images used as cache sources.", + "x-intellij-html-description": "the Docker images used as cache sources.", + "default": "[]", + "examples": [ + "[\"golang:1.10.1-alpine3.7\", \"alpine:3.7\"]" + ] + }, + "dockerfile": { + "type": "string", + "description": "locates the Dockerfile relative to workspace.", + "x-intellij-html-description": "locates the Dockerfile relative to workspace.", + "default": "Dockerfile" + }, + "network": { + "type": "string", + "description": "passed through to docker and overrides the network configuration of docker builder. If unset, use whatever is configured in the underlying docker daemon. Valid modes are `host`: use the host's networking stack. `bridge`: use the bridged network configuration. `none`: no networking in the container.", + "x-intellij-html-description": "passed through to docker and overrides the network configuration of docker builder. If unset, use whatever is configured in the underlying docker daemon. Valid modes are host: use the host's networking stack. bridge: use the bridged network configuration. none: no networking in the container.", + "enum": [ + "host", + "bridge", + "none" + ] + }, + "noCache": { + "type": "boolean", + "description": "used to pass in --no-cache to docker build to prevent caching.", + "x-intellij-html-description": "used to pass in --no-cache to docker build to prevent caching.", + "default": "false" + }, + "target": { + "type": "string", + "description": "Dockerfile target name to build.", + "x-intellij-html-description": "Dockerfile target name to build." + } + }, + "preferredOrder": [ + "dockerfile", + "target", + "buildArgs", + "network", + "cacheFrom", + "noCache" + ], + "additionalProperties": false, + "description": "describes an artifact built from a Dockerfile, usually using `docker build`.", + "x-intellij-html-description": "describes an artifact built from a Dockerfile, usually using docker build." + }, + "DockerConfig": { + "properties": { + "path": { + "type": "string", + "description": "path to the docker `config.json`.", + "x-intellij-html-description": "path to the docker config.json." + }, + "secretName": { + "type": "string", + "description": "Kubernetes secret that contains the `config.json` Docker configuration. Note that the expected secret type is not 'kubernetes.io/dockerconfigjson' but 'Opaque'.", + "x-intellij-html-description": "Kubernetes secret that contains the config.json Docker configuration. Note that the expected secret type is not 'kubernetes.io/dockerconfigjson' but 'Opaque'." + } + }, + "preferredOrder": [ + "path", + "secretName" + ], + "additionalProperties": false, + "description": "contains information about the docker `config.json` to mount.", + "x-intellij-html-description": "contains information about the docker config.json to mount." + }, + "DockerfileDependency": { + "properties": { + "buildArgs": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "arguments passed to the docker build. It also accepts environment variables via the go template syntax.", + "x-intellij-html-description": "arguments passed to the docker build. It also accepts environment variables via the go template syntax.", + "default": "{}", + "examples": [ + "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"'{{.ENV_VARIABLE}}'\"}" + ] + }, + "path": { + "type": "string", + "description": "locates the Dockerfile relative to workspace.", + "x-intellij-html-description": "locates the Dockerfile relative to workspace." + } + }, + "preferredOrder": [ + "path", + "buildArgs" + ], + "additionalProperties": false, + "description": "*beta* used to specify a custom build artifact that is built from a Dockerfile. This allows skaffold to determine dependencies from the Dockerfile.", + "x-intellij-html-description": "beta used to specify a custom build artifact that is built from a Dockerfile. This allows skaffold to determine dependencies from the Dockerfile." + }, + "EnvTemplateTagger": { + "required": [ + "template" + ], + "properties": { + "template": { + "type": "string", + "description": "used to produce the image name and tag. See golang [text/template](https://golang.org/pkg/text/template/). The template is executed against the current environment, with those variables injected: IMAGE_NAME | Name of the image being built, as supplied in the artifacts section.", + "x-intellij-html-description": "used to produce the image name and tag. See golang text/template. The template is executed against the current environment, with those variables injected: IMAGE_NAME | Name of the image being built, as supplied in the artifacts section.", + "examples": [ + "{{.RELEASE}}-{{.IMAGE_NAME}}" + ] + } + }, + "preferredOrder": [ + "template" + ], + "additionalProperties": false, + "description": "*beta* tags images with a configurable template string.", + "x-intellij-html-description": "beta tags images with a configurable template string." + }, + "GitTagger": { + "properties": { + "variant": { + "type": "string", + "description": "determines the behavior of the git tagger. Valid variants are `Tags` (default): use git tags or fall back to abbreviated commit hash. `CommitSha`: use the full git commit sha. `AbbrevCommitSha`: use the abbreviated git commit sha. `TreeSha`: use the full tree hash of the artifact workingdir. `AbbrevTreeSha`: use the abbreviated tree hash of the artifact workingdir.", + "x-intellij-html-description": "determines the behavior of the git tagger. Valid variants are Tags (default): use git tags or fall back to abbreviated commit hash. CommitSha: use the full git commit sha. AbbrevCommitSha: use the abbreviated git commit sha. TreeSha: use the full tree hash of the artifact workingdir. AbbrevTreeSha: use the abbreviated tree hash of the artifact workingdir.", + "enum": [ + "Tags", + "CommitSha", + "AbbrevCommitSha", + "TreeSha", + "AbbrevTreeSha" + ] + } + }, + "preferredOrder": [ + "variant" + ], + "additionalProperties": false, + "description": "*beta* tags images with the git tag or commit of the artifact's workspace.", + "x-intellij-html-description": "beta tags images with the git tag or commit of the artifact's workspace." + }, + "GoogleCloudBuild": { + "properties": { + "concurrency": { + "type": "integer", + "description": "how many artifacts can be built concurrently. 0 means \"no-limit\".", + "x-intellij-html-description": "how many artifacts can be built concurrently. 0 means "no-limit".", + "default": "0" + }, + "diskSizeGb": { + "type": "integer", + "description": "disk size of the VM that runs the build. See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions).", + "x-intellij-html-description": "disk size of the VM that runs the build. See Cloud Build Reference." + }, + "dockerImage": { + "type": "string", + "description": "image that runs a Docker build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).", + "x-intellij-html-description": "image that runs a Docker build. See Cloud Builders.", + "default": "gcr.io/cloud-builders/docker" + }, + "gradleImage": { + "type": "string", + "description": "image that runs a Gradle build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).", + "x-intellij-html-description": "image that runs a Gradle build. See Cloud Builders.", + "default": "gcr.io/cloud-builders/gradle" + }, + "kanikoImage": { + "type": "string", + "description": "image that runs a Kaniko build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).", + "x-intellij-html-description": "image that runs a Kaniko build. See Cloud Builders.", + "default": "gcr.io/kaniko-project/executor" + }, + "machineType": { + "type": "string", + "description": "type of the VM that runs the build. See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions).", + "x-intellij-html-description": "type of the VM that runs the build. See Cloud Build Reference." + }, + "mavenImage": { + "type": "string", + "description": "image that runs a Maven build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).", + "x-intellij-html-description": "image that runs a Maven build. See Cloud Builders.", + "default": "gcr.io/cloud-builders/mvn" + }, + "packImage": { + "type": "string", + "description": "image that runs a Cloud Native Buildpacks build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).", + "x-intellij-html-description": "image that runs a Cloud Native Buildpacks build. See Cloud Builders.", + "default": "gcr.io/k8s-skaffold/pack" + }, + "projectId": { + "type": "string", + "description": "ID of your Cloud Platform Project. If it is not provided, Skaffold will guess it from the image name. For example, given the artifact image name `gcr.io/myproject/image`, Skaffold will use the `myproject` GCP project.", + "x-intellij-html-description": "ID of your Cloud Platform Project. If it is not provided, Skaffold will guess it from the image name. For example, given the artifact image name gcr.io/myproject/image, Skaffold will use the myproject GCP project." + }, + "timeout": { + "type": "string", + "description": "amount of time (in seconds) that this build should be allowed to run. See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#resource-build).", + "x-intellij-html-description": "amount of time (in seconds) that this build should be allowed to run. See Cloud Build Reference." + } + }, + "preferredOrder": [ + "projectId", + "diskSizeGb", + "machineType", + "timeout", + "dockerImage", + "kanikoImage", + "mavenImage", + "gradleImage", + "packImage", + "concurrency" + ], + "additionalProperties": false, + "description": "*beta* describes how to do a remote build on [Google Cloud Build](https://cloud.google.com/cloud-build/docs/). Docker and Jib artifacts can be built on Cloud Build. The `projectId` needs to be provided and the currently logged in user should be given permissions to trigger new builds.", + "x-intellij-html-description": "beta describes how to do a remote build on Google Cloud Build. Docker and Jib artifacts can be built on Cloud Build. The projectId needs to be provided and the currently logged in user should be given permissions to trigger new builds." + }, + "HelmConventionConfig": { + "properties": { + "explicitRegistry": { + "type": "boolean", + "description": "separates `image.registry` to the image config syntax. Useful for some charts e.g. `postgresql`.", + "x-intellij-html-description": "separates image.registry to the image config syntax. Useful for some charts e.g. postgresql.", + "default": "false" + } + }, + "preferredOrder": [ + "explicitRegistry" + ], + "additionalProperties": false, + "description": "image config in the syntax of image.repository and image.tag.", + "x-intellij-html-description": "image config in the syntax of image.repository and image.tag." + }, + "HelmDeploy": { + "required": [ + "releases" + ], + "properties": { + "flags": { + "$ref": "#/definitions/HelmDeployFlags", + "description": "additional option flags that are passed on the command line to `helm`.", + "x-intellij-html-description": "additional option flags that are passed on the command line to helm." + }, + "releases": { + "items": { + "$ref": "#/definitions/HelmRelease" + }, + "type": "array", + "description": "a list of Helm releases.", + "x-intellij-html-description": "a list of Helm releases." + } + }, + "preferredOrder": [ + "releases", + "flags" + ], + "additionalProperties": false, + "description": "*beta* uses the `helm` CLI to apply the charts to the cluster.", + "x-intellij-html-description": "beta uses the helm CLI to apply the charts to the cluster." + }, + "HelmDeployFlags": { + "properties": { + "global": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed on every command.", + "x-intellij-html-description": "additional flags passed on every command.", + "default": "[]" + }, + "install": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed to (`helm install`).", + "x-intellij-html-description": "additional flags passed to (helm install).", + "default": "[]" + }, + "upgrade": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed to (`helm upgrade`).", + "x-intellij-html-description": "additional flags passed to (helm upgrade).", + "default": "[]" + } + }, + "preferredOrder": [ + "global", + "install", + "upgrade" + ], + "additionalProperties": false, + "description": "additional option flags that are passed on the command line to `helm`.", + "x-intellij-html-description": "additional option flags that are passed on the command line to helm." + }, + "HelmFQNConfig": { + "properties": { + "property": { + "type": "string", + "description": "defines the image config.", + "x-intellij-html-description": "defines the image config." + } + }, + "preferredOrder": [ + "property" + ], + "additionalProperties": false, + "description": "image config to use the FullyQualifiedImageName as param to set.", + "x-intellij-html-description": "image config to use the FullyQualifiedImageName as param to set." + }, + "HelmImageStrategy": { + "anyOf": [ + { + "additionalProperties": false + }, + { + "properties": { + "fqn": { + "$ref": "#/definitions/HelmFQNConfig", + "description": "image configuration uses the syntax `IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG`.", + "x-intellij-html-description": "image configuration uses the syntax IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG." + } + }, + "preferredOrder": [ + "fqn" + ], + "additionalProperties": false + }, + { + "properties": { + "helm": { + "$ref": "#/definitions/HelmConventionConfig", + "description": "image configuration uses the syntax `IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG`.", + "x-intellij-html-description": "image configuration uses the syntax IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG." + } + }, + "preferredOrder": [ + "helm" + ], + "additionalProperties": false + } + ], + "description": "adds image configurations to the Helm `values` file.", + "x-intellij-html-description": "adds image configurations to the Helm values file." + }, + "HelmPackaged": { + "properties": { + "appVersion": { + "type": "string", + "description": "sets the `appVersion` on the chart to this version.", + "x-intellij-html-description": "sets the appVersion on the chart to this version." + }, + "version": { + "type": "string", + "description": "sets the `version` on the chart to this semver version.", + "x-intellij-html-description": "sets the version on the chart to this semver version." + } + }, + "preferredOrder": [ + "version", + "appVersion" + ], + "additionalProperties": false, + "description": "parameters for packaging helm chart (`helm package`).", + "x-intellij-html-description": "parameters for packaging helm chart (helm package)." + }, + "HelmRelease": { + "required": [ + "name", + "chartPath" + ], + "properties": { + "chartPath": { + "type": "string", + "description": "path to the Helm chart.", + "x-intellij-html-description": "path to the Helm chart." + }, + "imageStrategy": { + "$ref": "#/definitions/HelmImageStrategy", + "description": "adds image configurations to the Helm `values` file.", + "x-intellij-html-description": "adds image configurations to the Helm values file." + }, + "name": { + "type": "string", + "description": "name of the Helm release.", + "x-intellij-html-description": "name of the Helm release." + }, + "namespace": { + "type": "string", + "description": "Kubernetes namespace.", + "x-intellij-html-description": "Kubernetes namespace." + }, + "overrides": { + "description": "key-value pairs. If present, Skaffold will build a Helm `values` file that overrides the original and use it to call Helm CLI (`--f` flag).", + "x-intellij-html-description": "key-value pairs. If present, Skaffold will build a Helm values file that overrides the original and use it to call Helm CLI (--f flag)." + }, + "packaged": { + "$ref": "#/definitions/HelmPackaged", + "description": "parameters for packaging helm chart (`helm package`).", + "x-intellij-html-description": "parameters for packaging helm chart (helm package)." + }, + "recreatePods": { + "type": "boolean", + "description": "if `true`, Skaffold will send `--recreate-pods` flag to Helm CLI when upgrading a new version of a chart in subsequent dev loop deploy.", + "x-intellij-html-description": "if true, Skaffold will send --recreate-pods flag to Helm CLI when upgrading a new version of a chart in subsequent dev loop deploy.", + "default": "false" + }, + "remote": { + "type": "boolean", + "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true`.", + "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true.", + "default": "false" + }, + "setFiles": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "key-value pairs. If present, Skaffold will send `--set-file` flag to Helm CLI and append all pairs after the flag.", + "x-intellij-html-description": "key-value pairs. If present, Skaffold will send --set-file flag to Helm CLI and append all pairs after the flag.", + "default": "{}" + }, + "setValueTemplates": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "key-value pairs. If present, Skaffold will try to parse the value part of each key-value pair using environment variables in the system, then send `--set` flag to Helm CLI and append all parsed pairs after the flag.", + "x-intellij-html-description": "key-value pairs. If present, Skaffold will try to parse the value part of each key-value pair using environment variables in the system, then send --set flag to Helm CLI and append all parsed pairs after the flag.", + "default": "{}" + }, + "setValues": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "key-value pairs. If present, Skaffold will send `--set` flag to Helm CLI and append all pairs after the flag.", + "x-intellij-html-description": "key-value pairs. If present, Skaffold will send --set flag to Helm CLI and append all pairs after the flag.", + "default": "{}" + }, + "skipBuildDependencies": { + "type": "boolean", + "description": "should build dependencies be skipped.", + "x-intellij-html-description": "should build dependencies be skipped.", + "default": "false" + }, + "useHelmSecrets": { + "type": "boolean", + "description": "instructs skaffold to use secrets plugin on deployment.", + "x-intellij-html-description": "instructs skaffold to use secrets plugin on deployment.", + "default": "false" + }, + "values": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "key-value pairs supplementing the Helm `values` file.", + "x-intellij-html-description": "key-value pairs supplementing the Helm values file.", + "default": "{}" + }, + "valuesFiles": { + "items": { + "type": "string" + }, + "type": "array", + "description": "paths to the Helm `values` files.", + "x-intellij-html-description": "paths to the Helm values files.", + "default": "[]" + }, + "version": { + "type": "string", + "description": "version of the chart.", + "x-intellij-html-description": "version of the chart." + }, + "wait": { + "type": "boolean", + "description": "if `true`, Skaffold will send `--wait` flag to Helm CLI.", + "x-intellij-html-description": "if true, Skaffold will send --wait flag to Helm CLI.", + "default": "false" + } + }, + "preferredOrder": [ + "name", + "chartPath", + "valuesFiles", + "values", + "namespace", + "version", + "setValues", + "setValueTemplates", + "setFiles", + "wait", + "recreatePods", + "skipBuildDependencies", + "useHelmSecrets", + "remote", + "overrides", + "packaged", + "imageStrategy" + ], + "additionalProperties": false, + "description": "describes a helm release to be deployed.", + "x-intellij-html-description": "describes a helm release to be deployed." + }, + "JSONPatch": { + "required": [ + "path" + ], + "properties": { + "from": { + "type": "string", + "description": "source position in the yaml, used for `copy` or `move` operations.", + "x-intellij-html-description": "source position in the yaml, used for copy or move operations." + }, + "op": { + "type": "string", + "description": "operation carried by the patch: `add`, `remove`, `replace`, `move`, `copy` or `test`.", + "x-intellij-html-description": "operation carried by the patch: add, remove, replace, move, copy or test.", + "default": "replace" + }, + "path": { + "type": "string", + "description": "position in the yaml where the operation takes place. For example, this targets the `dockerfile` of the first artifact built.", + "x-intellij-html-description": "position in the yaml where the operation takes place. For example, this targets the dockerfile of the first artifact built.", + "examples": [ + "/build/artifacts/0/docker/dockerfile" + ] + }, + "value": { + "type": "object", + "description": "value to apply. Can be any portion of yaml.", + "x-intellij-html-description": "value to apply. Can be any portion of yaml." + } + }, + "preferredOrder": [ + "op", + "path", + "from", + "value" + ], + "additionalProperties": false, + "description": "patch to be applied by a profile.", + "x-intellij-html-description": "patch to be applied by a profile." + }, + "JibArtifact": { + "properties": { + "args": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional build flags passed to the builder.", + "x-intellij-html-description": "additional build flags passed to the builder.", + "default": "[]", + "examples": [ + "[\"--no-build-cache\"]" + ] + }, + "project": { + "type": "string", + "description": "selects which sub-project to build for multi-module builds.", + "x-intellij-html-description": "selects which sub-project to build for multi-module builds." + }, + "type": { + "type": "string", + "description": "the Jib builder type; normally determined automatically. Valid types are `maven`: for Maven. `gradle`: for Gradle.", + "x-intellij-html-description": "the Jib builder type; normally determined automatically. Valid types are maven: for Maven. gradle: for Gradle.", + "enum": [ + "maven", + "gradle" + ] + } + }, + "preferredOrder": [ + "project", + "args", + "type" + ], + "additionalProperties": false, + "description": "builds images using the [Jib plugins for Maven and Gradle](https://github.com/GoogleContainerTools/jib/).", + "x-intellij-html-description": "builds images using the Jib plugins for Maven and Gradle." + }, + "KanikoArtifact": { + "properties": { + "buildArgs": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "arguments passed to the docker build. It also accepts environment variables via the go template syntax.", + "x-intellij-html-description": "arguments passed to the docker build. It also accepts environment variables via the go template syntax.", + "default": "{}", + "examples": [ + "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"'{{.ENV_VARIABLE}}'\"}" + ] + }, + "cache": { + "$ref": "#/definitions/KanikoCache", + "description": "configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds.", + "x-intellij-html-description": "configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds." + }, + "dockerfile": { + "type": "string", + "description": "locates the Dockerfile relative to workspace.", + "x-intellij-html-description": "locates the Dockerfile relative to workspace.", + "default": "Dockerfile" + }, + "env": { + "items": {}, + "type": "array", + "description": "environment variables passed to the kaniko pod.", + "x-intellij-html-description": "environment variables passed to the kaniko pod.", + "default": "[]" + }, + "flags": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags to be passed to Kaniko command line. See [Kaniko Additional Flags](https://github.com/GoogleContainerTools/kaniko#additional-flags). Deprecated - instead the named, unique fields should be used, e.g. `buildArgs`, `cache`, `target`.", + "x-intellij-html-description": "additional flags to be passed to Kaniko command line. See Kaniko Additional Flags. Deprecated - instead the named, unique fields should be used, e.g. buildArgs, cache, target.", + "default": "[]" + }, + "image": { + "type": "string", + "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 gcr.io/kaniko-project/executor." + }, + "initImage": { + "type": "string", + "description": "image used to run init container which mounts kaniko context.", + "x-intellij-html-description": "image used to run init container which mounts kaniko context." + }, + "reproducible": { + "type": "boolean", + "description": "used to strip timestamps out of the built image.", + "x-intellij-html-description": "used to strip timestamps out of the built image.", + "default": "false" + }, + "skipTLS": { + "type": "boolean", + "description": "skips TLS verification when pulling and pushing the image.", + "x-intellij-html-description": "skips TLS verification when pulling and pushing the image.", + "default": "false" + }, + "target": { + "type": "string", + "description": "Dockerfile target name to build.", + "x-intellij-html-description": "Dockerfile target name to build." + }, + "volumeMounts": { + "items": {}, + "type": "array", + "description": "volume mounts passed to kaniko pod.", + "x-intellij-html-description": "volume mounts passed to kaniko pod.", + "default": "[]" + } + }, + "preferredOrder": [ + "flags", + "dockerfile", + "target", + "buildArgs", + "env", + "initImage", + "image", + "cache", + "reproducible", + "skipTLS", + "volumeMounts" + ], + "additionalProperties": false, + "description": "describes an artifact built from a Dockerfile, with kaniko.", + "x-intellij-html-description": "describes an artifact built from a Dockerfile, with kaniko." + }, + "KanikoCache": { + "properties": { + "hostPath": { + "type": "string", + "description": "specifies a path on the host that is mounted to each pod as read only cache volume containing base images. If set, must exist on each node and prepopulated with kaniko-warmer.", + "x-intellij-html-description": "specifies a path on the host that is mounted to each pod as read only cache volume containing base images. If set, must exist on each node and prepopulated with kaniko-warmer." + }, + "repo": { + "type": "string", + "description": "a remote repository to store cached layers. If none is specified, one will be inferred from the image name. See [Kaniko Caching](https://github.com/GoogleContainerTools/kaniko#caching).", + "x-intellij-html-description": "a remote repository to store cached layers. If none is specified, one will be inferred from the image name. See Kaniko Caching." + } + }, + "preferredOrder": [ + "repo", + "hostPath" + ], + "additionalProperties": false, + "description": "configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds.", + "x-intellij-html-description": "configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds." + }, + "KubectlDeploy": { + "properties": { + "flags": { + "$ref": "#/definitions/KubectlFlags", + "description": "additional flags passed to `kubectl`.", + "x-intellij-html-description": "additional flags passed to kubectl." + }, + "manifests": { + "items": { + "type": "string" + }, + "type": "array", + "description": "the Kubernetes yaml or json manifests.", + "x-intellij-html-description": "the Kubernetes yaml or json manifests.", + "default": "[\"k8s/*.yaml\"]" + }, + "remoteManifests": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Kubernetes manifests in remote clusters.", + "x-intellij-html-description": "Kubernetes manifests in remote clusters.", + "default": "[]" + } + }, + "preferredOrder": [ + "manifests", + "remoteManifests", + "flags" + ], + "additionalProperties": false, + "description": "*beta* uses a client side `kubectl apply` to deploy manifests. You'll need a `kubectl` CLI version installed that's compatible with your cluster.", + "x-intellij-html-description": "beta uses a client side kubectl apply to deploy manifests. You'll need a kubectl CLI version installed that's compatible with your cluster." + }, + "KubectlFlags": { + "properties": { + "apply": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed on creations (`kubectl apply`).", + "x-intellij-html-description": "additional flags passed on creations (kubectl apply).", + "default": "[]" + }, + "delete": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed on deletions (`kubectl delete`).", + "x-intellij-html-description": "additional flags passed on deletions (kubectl delete).", + "default": "[]" + }, + "disableValidation": { + "type": "boolean", + "description": "passes the `--validate=false` flag to supported `kubectl` commands when enabled.", + "x-intellij-html-description": "passes the --validate=false flag to supported kubectl commands when enabled.", + "default": "false" + }, + "global": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed on every command.", + "x-intellij-html-description": "additional flags passed on every command.", + "default": "[]" + } + }, + "preferredOrder": [ + "global", + "apply", + "delete", + "disableValidation" + ], + "additionalProperties": false, + "description": "additional flags passed on the command line to kubectl either on every command (Global), on creations (Apply) or deletions (Delete).", + "x-intellij-html-description": "additional flags passed on the command line to kubectl either on every command (Global), on creations (Apply) or deletions (Delete)." + }, + "KustomizeDeploy": { + "properties": { + "buildArgs": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional args passed to `kustomize build`.", + "x-intellij-html-description": "additional args passed to kustomize build.", + "default": "[]" + }, + "flags": { + "$ref": "#/definitions/KubectlFlags", + "description": "additional flags passed to `kubectl`.", + "x-intellij-html-description": "additional flags passed to kubectl." + }, + "paths": { + "items": { + "type": "string" + }, + "type": "array", + "description": "path to Kustomization files.", + "x-intellij-html-description": "path to Kustomization files.", + "default": "[\".\"]" + } + }, + "preferredOrder": [ + "paths", + "flags", + "buildArgs" + ], + "additionalProperties": false, + "description": "*beta* uses the `kustomize` CLI to \"patch\" a deployment for a target environment.", + "x-intellij-html-description": "beta uses the kustomize CLI to "patch" a deployment for a target environment." + }, + "LocalBuild": { + "properties": { + "concurrency": { + "type": "integer", + "description": "how many artifacts can be built concurrently. 0 means \"no-limit\".", + "x-intellij-html-description": "how many artifacts can be built concurrently. 0 means "no-limit".", + "default": "1" + }, + "push": { + "type": "boolean", + "description": "should images be pushed to a registry. If not specified, images are pushed only if the current Kubernetes context connects to a remote cluster.", + "x-intellij-html-description": "should images be pushed to a registry. If not specified, images are pushed only if the current Kubernetes context connects to a remote cluster." + }, + "useBuildkit": { + "type": "boolean", + "description": "use BuildKit to build Docker images.", + "x-intellij-html-description": "use BuildKit to build Docker images.", + "default": "false" + }, + "useDockerCLI": { + "type": "boolean", + "description": "use `docker` command-line interface instead of Docker Engine APIs.", + "x-intellij-html-description": "use docker command-line interface instead of Docker Engine APIs.", + "default": "false" + } + }, + "preferredOrder": [ + "push", + "useDockerCLI", + "useBuildkit", + "concurrency" + ], + "additionalProperties": false, + "description": "*beta* describes how to do a build on the local docker daemon and optionally push to a repository.", + "x-intellij-html-description": "beta describes how to do a build on the local docker daemon and optionally push to a repository." + }, + "Metadata": { + "properties": { + "name": { + "type": "string", + "description": "an identifier for the project.", + "x-intellij-html-description": "an identifier for the project." + } + }, + "preferredOrder": [ + "name" + ], + "additionalProperties": false, + "description": "holds an optional name of the project.", + "x-intellij-html-description": "holds an optional name of the project." + }, + "PortForwardResource": { + "properties": { + "address": { + "type": "string", + "description": "local address to bind to. Defaults to the loopback address 127.0.0.1.", + "x-intellij-html-description": "local address to bind to. Defaults to the loopback address 127.0.0.1." + }, + "localPort": { + "type": "integer", + "description": "local port to forward to. If the port is unavailable, Skaffold will choose a random open port to forward to. *Optional*.", + "x-intellij-html-description": "local port to forward to. If the port is unavailable, Skaffold will choose a random open port to forward to. Optional." + }, + "namespace": { + "type": "string", + "description": "namespace of the resource to port forward.", + "x-intellij-html-description": "namespace of the resource to port forward." + }, + "port": { + "type": "integer", + "description": "resource port that will be forwarded.", + "x-intellij-html-description": "resource port that will be forwarded." + }, + "resourceName": { + "type": "string", + "description": "name of the Kubernetes resource to port forward.", + "x-intellij-html-description": "name of the Kubernetes resource to port forward." + }, + "resourceType": { + "$ref": "#/definitions/ResourceType", + "description": "Kubernetes type that should be port forwarded. Acceptable resource types include: `Service`, `Pod` and Controller resource type that has a pod spec: `ReplicaSet`, `ReplicationController`, `Deployment`, `StatefulSet`, `DaemonSet`, `Job`, `CronJob`.", + "x-intellij-html-description": "Kubernetes type that should be port forwarded. Acceptable resource types include: Service, Pod and Controller resource type that has a pod spec: ReplicaSet, ReplicationController, Deployment, StatefulSet, DaemonSet, Job, CronJob." + } + }, + "preferredOrder": [ + "resourceType", + "resourceName", + "namespace", + "port", + "address", + "localPort" + ], + "additionalProperties": false, + "description": "describes a resource to port forward.", + "x-intellij-html-description": "describes a resource to port forward." + }, + "Profile": { + "required": [ + "name" + ], + "properties": { + "activation": { + "items": { + "$ref": "#/definitions/Activation" + }, + "type": "array", + "description": "criteria by which a profile can be auto-activated. The profile is auto-activated if any one of the activations are triggered. An activation is triggered if all of the criteria (env, kubeContext, command) are triggered.", + "x-intellij-html-description": "criteria by which a profile can be auto-activated. The profile is auto-activated if any one of the activations are triggered. An activation is triggered if all of the criteria (env, kubeContext, command) are triggered." + }, + "build": { + "$ref": "#/definitions/BuildConfig", + "description": "describes how images are built.", + "x-intellij-html-description": "describes how images are built." + }, + "deploy": { + "$ref": "#/definitions/DeployConfig", + "description": "describes how images are deployed.", + "x-intellij-html-description": "describes how images are deployed." + }, + "name": { + "type": "string", + "description": "a unique profile name.", + "x-intellij-html-description": "a unique profile name.", + "examples": [ + "profile-prod" + ] + }, + "patches": { + "items": { + "$ref": "#/definitions/JSONPatch" + }, + "type": "array", + "description": "patches applied to the configuration. Patches use the JSON patch notation.", + "x-intellij-html-description": "patches applied to the configuration. Patches use the JSON patch notation." + }, + "portForward": { + "items": { + "$ref": "#/definitions/PortForwardResource" + }, + "type": "array", + "description": "describes user defined resources to port-forward.", + "x-intellij-html-description": "describes user defined resources to port-forward." + }, + "test": { + "items": { + "$ref": "#/definitions/TestCase" + }, + "type": "array", + "description": "describes how images are tested.", + "x-intellij-html-description": "describes how images are tested." + } + }, + "preferredOrder": [ + "name", + "build", + "test", + "deploy", + "portForward", + "patches", + "activation" + ], + "additionalProperties": false, + "description": "used to override any `build`, `test` or `deploy` configuration.", + "x-intellij-html-description": "used to override any build, test or deploy configuration." + }, + "ResourceRequirement": { + "properties": { + "cpu": { + "type": "string", + "description": "the number cores to be used.", + "x-intellij-html-description": "the number cores to be used.", + "examples": [ + "2`, `2.0` or `200m" + ] + }, + "ephemeralStorage": { + "type": "string", + "description": "the amount of Ephemeral storage to allocate to the pod.", + "x-intellij-html-description": "the amount of Ephemeral storage to allocate to the pod.", + "examples": [ + "1Gi` or `1000Mi" + ] + }, + "memory": { + "type": "string", + "description": "the amount of memory to allocate to the pod.", + "x-intellij-html-description": "the amount of memory to allocate to the pod.", + "examples": [ + "1Gi` or `1000Mi" + ] + }, + "resourceStorage": { + "type": "string", + "description": "the amount of resource storage to allocate to the pod.", + "x-intellij-html-description": "the amount of resource storage to allocate to the pod.", + "examples": [ + "1Gi` or `1000Mi" + ] + } + }, + "preferredOrder": [ + "cpu", + "memory", + "ephemeralStorage", + "resourceStorage" + ], + "additionalProperties": false, + "description": "stores the CPU/Memory requirements for the pod.", + "x-intellij-html-description": "stores the CPU/Memory requirements for the pod." + }, + "ResourceRequirements": { + "properties": { + "limits": { + "$ref": "#/definitions/ResourceRequirement", + "description": "[resource limits](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the Kaniko pod.", + "x-intellij-html-description": "resource limits for the Kaniko pod." + }, + "requests": { + "$ref": "#/definitions/ResourceRequirement", + "description": "[resource requests](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the Kaniko pod.", + "x-intellij-html-description": "resource requests for the Kaniko pod." + } + }, + "preferredOrder": [ + "requests", + "limits" + ], + "additionalProperties": false, + "description": "describes the resource requirements for the kaniko pod.", + "x-intellij-html-description": "describes the resource requirements for the kaniko pod." + }, + "ResourceType": { + "type": "string", + "description": "describes the Kubernetes resource types used for port forwarding.", + "x-intellij-html-description": "describes the Kubernetes resource types used for port forwarding." + }, + "ShaTagger": { + "description": "*beta* tags images with their sha256 digest.", + "x-intellij-html-description": "beta tags images with their sha256 digest." + }, + "SkaffoldConfig": { + "required": [ + "apiVersion", + "kind" + ], + "properties": { + "apiVersion": { + "type": "string", + "description": "version of the configuration.", + "x-intellij-html-description": "version of the configuration." + }, + "build": { + "$ref": "#/definitions/BuildConfig", + "description": "describes how images are built.", + "x-intellij-html-description": "describes how images are built." + }, + "deploy": { + "$ref": "#/definitions/DeployConfig", + "description": "describes how images are deployed.", + "x-intellij-html-description": "describes how images are deployed." + }, + "kind": { + "type": "string", + "description": "always `Config`.", + "x-intellij-html-description": "always Config.", + "default": "Config" + }, + "metadata": { + "$ref": "#/definitions/Metadata", + "description": "holds additional information about the config.", + "x-intellij-html-description": "holds additional information about the config." + }, + "portForward": { + "items": { + "$ref": "#/definitions/PortForwardResource" + }, + "type": "array", + "description": "describes user defined resources to port-forward.", + "x-intellij-html-description": "describes user defined resources to port-forward." + }, + "profiles": { + "items": { + "$ref": "#/definitions/Profile" + }, + "type": "array", + "description": "*beta* can override be used to `build`, `test` or `deploy` configuration.", + "x-intellij-html-description": "beta can override be used to build, test or deploy configuration." + }, + "test": { + "items": { + "$ref": "#/definitions/TestCase" + }, + "type": "array", + "description": "describes how images are tested.", + "x-intellij-html-description": "describes how images are tested." + } + }, + "preferredOrder": [ + "apiVersion", + "kind", + "metadata", + "build", + "test", + "deploy", + "portForward", + "profiles" + ], + "additionalProperties": false, + "description": "holds the fields parsed from the Skaffold configuration file (skaffold.yaml).", + "x-intellij-html-description": "holds the fields parsed from the Skaffold configuration file (skaffold.yaml)." + }, + "Sync": { + "properties": { + "infer": { + "items": { + "type": "string" + }, + "type": "array", + "description": "file patterns which may be synced into the container. The container destination is inferred by the builder. Currently only available for docker artifacts.", + "x-intellij-html-description": "file patterns which may be synced into the container. The container destination is inferred by the builder. Currently only available for docker artifacts.", + "default": "[]" + }, + "manual": { + "items": { + "$ref": "#/definitions/SyncRule" + }, + "type": "array", + "description": "manual sync rules indicating the source and destination.", + "x-intellij-html-description": "manual sync rules indicating the source and destination." + } + }, + "preferredOrder": [ + "manual", + "infer" + ], + "additionalProperties": false, + "description": "*beta* specifies what files to sync into the container. This is a list of sync rules indicating the intent to sync for source files. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta specifies what files to sync into the container. This is a list of sync rules indicating the intent to sync for source files. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + }, + "SyncRule": { + "required": [ + "src", + "dest" + ], + "properties": { + "dest": { + "type": "string", + "description": "destination path in the container where the files should be synced to.", + "x-intellij-html-description": "destination path in the container where the files should be synced to.", + "examples": [ + "\"app/\"" + ] + }, + "src": { + "type": "string", + "description": "a glob pattern to match local paths against. Directories should be delimited by `/` on all platforms.", + "x-intellij-html-description": "a glob pattern to match local paths against. Directories should be delimited by / on all platforms.", + "examples": [ + "\"css/**/*.css\"" + ] + }, + "strip": { + "type": "string", + "description": "specifies the path prefix to remove from the source path when transplanting the files into the destination folder.", + "x-intellij-html-description": "specifies the path prefix to remove from the source path when transplanting the files into the destination folder.", + "examples": [ + "\"css/\"" + ] + } + }, + "preferredOrder": [ + "src", + "dest", + "strip" + ], + "additionalProperties": false, + "description": "specifies which local files to sync to remote folders.", + "x-intellij-html-description": "specifies which local files to sync to remote folders." + }, + "TagPolicy": { + "properties": { + "dateTime": { + "$ref": "#/definitions/DateTimeTagger", + "description": "*beta* tags images with the build timestamp.", + "x-intellij-html-description": "beta tags images with the build timestamp." + }, + "envTemplate": { + "$ref": "#/definitions/EnvTemplateTagger", + "description": "*beta* tags images with a configurable template string.", + "x-intellij-html-description": "beta tags images with a configurable template string." + }, + "gitCommit": { + "$ref": "#/definitions/GitTagger", + "description": "*beta* tags images with the git tag or commit of the artifact's workspace.", + "x-intellij-html-description": "beta tags images with the git tag or commit of the artifact's workspace." + }, + "sha256": { + "$ref": "#/definitions/ShaTagger", + "description": "*beta* tags images with their sha256 digest.", + "x-intellij-html-description": "beta tags images with their sha256 digest." + } + }, + "preferredOrder": [ + "gitCommit", + "sha256", + "envTemplate", + "dateTime" + ], + "additionalProperties": false, + "description": "contains all the configuration for the tagging step.", + "x-intellij-html-description": "contains all the configuration for the tagging step." + }, + "TestCase": { + "required": [ + "image" + ], + "properties": { + "image": { + "type": "string", + "description": "artifact on which to run those tests.", + "x-intellij-html-description": "artifact on which to run those tests.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "structureTests": { + "items": { + "type": "string" + }, + "type": "array", + "description": "the [Container Structure Tests](https://github.com/GoogleContainerTools/container-structure-test) to run on that artifact.", + "x-intellij-html-description": "the Container Structure Tests to run on that artifact.", + "default": "[]", + "examples": [ + "[\"./test/*\"]" + ] + } + }, + "preferredOrder": [ + "image", + "structureTests" + ], + "additionalProperties": false, + "description": "a list of structure tests to run on images that Skaffold builds.", + "x-intellij-html-description": "a list of structure tests to run on images that Skaffold builds." + } + } +} diff --git a/integration/examples/bazel/skaffold.yaml b/integration/examples/bazel/skaffold.yaml index bb825692c44..2bc25cbd1f1 100644 --- a/integration/examples/bazel/skaffold.yaml +++ b/integration/examples/bazel/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/buildpacks-node/skaffold.yaml b/integration/examples/buildpacks-node/skaffold.yaml index 3b446089233..b133fc0554e 100644 --- a/integration/examples/buildpacks-node/skaffold.yaml +++ b/integration/examples/buildpacks-node/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/buildpacks/skaffold.yaml b/integration/examples/buildpacks/skaffold.yaml index 6d827eeb53a..81b394ddacc 100644 --- a/integration/examples/buildpacks/skaffold.yaml +++ b/integration/examples/buildpacks/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/custom/skaffold.yaml b/integration/examples/custom/skaffold.yaml index e5033ce7e92..fdf1e0a60b8 100644 --- a/integration/examples/custom/skaffold.yaml +++ b/integration/examples/custom/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/gcb-kaniko/skaffold.yaml b/integration/examples/gcb-kaniko/skaffold.yaml index 8941794cbfd..02b0516e1f6 100644 --- a/integration/examples/gcb-kaniko/skaffold.yaml +++ b/integration/examples/gcb-kaniko/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: googleCloudBuild: diff --git a/integration/examples/generate-pipeline/skaffold.yaml b/integration/examples/generate-pipeline/skaffold.yaml index 5d1d67af63e..f31ccd5ba16 100644 --- a/integration/examples/generate-pipeline/skaffold.yaml +++ b/integration/examples/generate-pipeline/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/getting-started/skaffold.yaml b/integration/examples/getting-started/skaffold.yaml index 52b2e4483dd..12cba7c4790 100644 --- a/integration/examples/getting-started/skaffold.yaml +++ b/integration/examples/getting-started/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/google-cloud-build/skaffold.yaml b/integration/examples/google-cloud-build/skaffold.yaml index 1f9b66c56c1..19c7ad17344 100644 --- a/integration/examples/google-cloud-build/skaffold.yaml +++ b/integration/examples/google-cloud-build/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: googleCloudBuild: diff --git a/integration/examples/helm-deployment-dependencies/skaffold.yaml b/integration/examples/helm-deployment-dependencies/skaffold.yaml index 699fa834799..e2ff41eab9c 100644 --- a/integration/examples/helm-deployment-dependencies/skaffold.yaml +++ b/integration/examples/helm-deployment-dependencies/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: tagPolicy: diff --git a/integration/examples/helm-deployment/skaffold.yaml b/integration/examples/helm-deployment/skaffold.yaml index 4059fe2e671..7dd18b48fed 100644 --- a/integration/examples/helm-deployment/skaffold.yaml +++ b/integration/examples/helm-deployment/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: tagPolicy: diff --git a/integration/examples/hot-reload/skaffold.yaml b/integration/examples/hot-reload/skaffold.yaml index 172f670e09d..a154480440a 100644 --- a/integration/examples/hot-reload/skaffold.yaml +++ b/integration/examples/hot-reload/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/jib-gradle/skaffold.yaml b/integration/examples/jib-gradle/skaffold.yaml index 528a27899b2..2c234d5ada2 100644 --- a/integration/examples/jib-gradle/skaffold.yaml +++ b/integration/examples/jib-gradle/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/jib-multimodule/skaffold.yaml b/integration/examples/jib-multimodule/skaffold.yaml index bfe2493c94d..bb6183ed51e 100644 --- a/integration/examples/jib-multimodule/skaffold.yaml +++ b/integration/examples/jib-multimodule/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/jib/skaffold.yaml b/integration/examples/jib/skaffold.yaml index b87d7f765b4..89e781c9023 100644 --- a/integration/examples/jib/skaffold.yaml +++ b/integration/examples/jib/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/kaniko/skaffold.yaml b/integration/examples/kaniko/skaffold.yaml index 227a156930b..387aacc9ae1 100644 --- a/integration/examples/kaniko/skaffold.yaml +++ b/integration/examples/kaniko/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/kustomize/skaffold.yaml b/integration/examples/kustomize/skaffold.yaml index eca85be695b..101b72ce2b5 100644 --- a/integration/examples/kustomize/skaffold.yaml +++ b/integration/examples/kustomize/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config deploy: kustomize: {} diff --git a/integration/examples/microservices/skaffold.yaml b/integration/examples/microservices/skaffold.yaml index d03d1df1365..193351550bc 100644 --- a/integration/examples/microservices/skaffold.yaml +++ b/integration/examples/microservices/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/nodejs/skaffold.yaml b/integration/examples/nodejs/skaffold.yaml index ca8e4a2ba47..8bd42624dde 100644 --- a/integration/examples/nodejs/skaffold.yaml +++ b/integration/examples/nodejs/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: diff --git a/integration/examples/profile-patches/skaffold.yaml b/integration/examples/profile-patches/skaffold.yaml index e4edd5b6019..c088501fdc9 100644 --- a/integration/examples/profile-patches/skaffold.yaml +++ b/integration/examples/profile-patches/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: # only build and deploy "base-service" on main profile diff --git a/integration/examples/profiles/skaffold.yaml b/integration/examples/profiles/skaffold.yaml index 560355a65a7..d59f3ecef08 100644 --- a/integration/examples/profiles/skaffold.yaml +++ b/integration/examples/profiles/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: # only build and deploy "world-service" on main profile diff --git a/integration/examples/react-reload/skaffold.yaml b/integration/examples/react-reload/skaffold.yaml index 2101bade7c5..c35b209ba06 100644 --- a/integration/examples/react-reload/skaffold.yaml +++ b/integration/examples/react-reload/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/ruby/skaffold.yaml b/integration/examples/ruby/skaffold.yaml index 9f12397fe2b..42575386609 100644 --- a/integration/examples/ruby/skaffold.yaml +++ b/integration/examples/ruby/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/structure-tests/skaffold.yaml b/integration/examples/structure-tests/skaffold.yaml index 1b03ba4386c..db467a6c5ce 100644 --- a/integration/examples/structure-tests/skaffold.yaml +++ b/integration/examples/structure-tests/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/examples/tagging-with-environment-variables/skaffold.yaml b/integration/examples/tagging-with-environment-variables/skaffold.yaml index e8b9efa7502..719c127ec36 100644 --- a/integration/examples/tagging-with-environment-variables/skaffold.yaml +++ b/integration/examples/tagging-with-environment-variables/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/testdata/build/skaffold.yaml b/integration/testdata/build/skaffold.yaml index a356aebc270..ff2f9bdcdf5 100644 --- a/integration/testdata/build/skaffold.yaml +++ b/integration/testdata/build/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: local: diff --git a/integration/testdata/debug/skaffold.yaml b/integration/testdata/debug/skaffold.yaml index 294e095ad89..800aafdc893 100644 --- a/integration/testdata/debug/skaffold.yaml +++ b/integration/testdata/debug/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/testdata/deploy-multiple/skaffold.yaml b/integration/testdata/deploy-multiple/skaffold.yaml index 22fc9b29f5c..32ba39913e2 100644 --- a/integration/testdata/deploy-multiple/skaffold.yaml +++ b/integration/testdata/deploy-multiple/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/testdata/dev/skaffold.yaml b/integration/testdata/dev/skaffold.yaml index 4a39d0d55c9..410d05f5444 100644 --- a/integration/testdata/dev/skaffold.yaml +++ b/integration/testdata/dev/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/testdata/gke_loadbalancer/skaffold.yaml b/integration/testdata/gke_loadbalancer/skaffold.yaml index 75ae7bf318f..28198d95c00 100644 --- a/integration/testdata/gke_loadbalancer/skaffold.yaml +++ b/integration/testdata/gke_loadbalancer/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/testdata/init/compose/skaffold.yaml b/integration/testdata/init/compose/skaffold.yaml index 5281f882e59..6b5a4a18384 100644 --- a/integration/testdata/init/compose/skaffold.yaml +++ b/integration/testdata/init/compose/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config metadata: name: compose diff --git a/integration/testdata/jib/skaffold.yaml b/integration/testdata/jib/skaffold.yaml index c86899ffb1c..0cd3c406a38 100644 --- a/integration/testdata/jib/skaffold.yaml +++ b/integration/testdata/jib/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-explicit-repo/skaffold.yaml b/integration/testdata/kaniko-explicit-repo/skaffold.yaml index 043588b2d94..0dd42a10fb1 100644 --- a/integration/testdata/kaniko-explicit-repo/skaffold.yaml +++ b/integration/testdata/kaniko-explicit-repo/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml b/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml index 52b2e4483dd..12cba7c4790 100644 --- a/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml +++ b/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-insecure-registry/skaffold.yaml b/integration/testdata/kaniko-insecure-registry/skaffold.yaml index bfd6a3e6ad5..6852beab5c2 100644 --- a/integration/testdata/kaniko-insecure-registry/skaffold.yaml +++ b/integration/testdata/kaniko-insecure-registry/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config profiles: - name: build-artifact diff --git a/integration/testdata/kaniko-microservices/skaffold.yaml b/integration/testdata/kaniko-microservices/skaffold.yaml index 0cabf67af7e..d7d4654a3ee 100644 --- a/integration/testdata/kaniko-microservices/skaffold.yaml +++ b/integration/testdata/kaniko-microservices/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-sub-folder/skaffold.yaml b/integration/testdata/kaniko-sub-folder/skaffold.yaml index d2bbd7ebd97..7e395c45688 100644 --- a/integration/testdata/kaniko-sub-folder/skaffold.yaml +++ b/integration/testdata/kaniko-sub-folder/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-target/skaffold.yaml b/integration/testdata/kaniko-target/skaffold.yaml index 7b87f4fe83c..b234b795ac0 100644 --- a/integration/testdata/kaniko-target/skaffold.yaml +++ b/integration/testdata/kaniko-target/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/integration/testdata/tagPolicy/skaffold.yaml b/integration/testdata/tagPolicy/skaffold.yaml index 39b55612b63..da96fe584d9 100644 --- a/integration/testdata/tagPolicy/skaffold.yaml +++ b/integration/testdata/tagPolicy/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2alpha3 +apiVersion: skaffold/v2alpha4 kind: Config build: artifacts: diff --git a/pkg/skaffold/schema/latest/config.go b/pkg/skaffold/schema/latest/config.go index 7914a0579b0..ea46fbc1ab9 100644 --- a/pkg/skaffold/schema/latest/config.go +++ b/pkg/skaffold/schema/latest/config.go @@ -22,8 +22,8 @@ import ( "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/util" ) -// !!! WARNING !!! This config version is already released, please DO NOT MODIFY the structs in this file. -const Version string = "skaffold/v2alpha3" +// This config version is not yet released, it is SAFE TO MODIFY the structs in this file. +const Version string = "skaffold/v2alpha4" // NewSkaffoldConfig creates a SkaffoldConfig func NewSkaffoldConfig() util.VersionedConfig { diff --git a/pkg/skaffold/schema/v2alpha2/upgrade.go b/pkg/skaffold/schema/v2alpha2/upgrade.go index 6754c2e5999..858978aa293 100755 --- a/pkg/skaffold/schema/v2alpha2/upgrade.go +++ b/pkg/skaffold/schema/v2alpha2/upgrade.go @@ -17,8 +17,8 @@ limitations under the License. package v2alpha2 import ( - next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/util" + next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2alpha3" pkgutil "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" ) diff --git a/pkg/skaffold/schema/v2alpha2/upgrade_test.go b/pkg/skaffold/schema/v2alpha2/upgrade_test.go index 90d2cdff81a..5522a53343b 100755 --- a/pkg/skaffold/schema/v2alpha2/upgrade_test.go +++ b/pkg/skaffold/schema/v2alpha2/upgrade_test.go @@ -21,7 +21,7 @@ import ( yaml "gopkg.in/yaml.v2" - next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" + next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2alpha3" "github.com/GoogleContainerTools/skaffold/testutil" ) diff --git a/pkg/skaffold/schema/v2alpha3/config.go b/pkg/skaffold/schema/v2alpha3/config.go new file mode 100755 index 00000000000..2bcb7c179ac --- /dev/null +++ b/pkg/skaffold/schema/v2alpha3/config.go @@ -0,0 +1,861 @@ +/* +Copyright 2019 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v2alpha3 + +import ( + v1 "k8s.io/api/core/v1" + + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/util" +) + +// !!! WARNING !!! This config version is already released, please DO NOT MODIFY the structs in this file. +const Version string = "skaffold/v2alpha3" + +// NewSkaffoldConfig creates a SkaffoldConfig +func NewSkaffoldConfig() util.VersionedConfig { + return new(SkaffoldConfig) +} + +// SkaffoldConfig holds the fields parsed from the Skaffold configuration file (skaffold.yaml). +type SkaffoldConfig struct { + // APIVersion is the version of the configuration. + APIVersion string `yaml:"apiVersion" yamltags:"required"` + + // Kind is always `Config`. Defaults to `Config`. + Kind string `yaml:"kind" yamltags:"required"` + + // Metadata holds additional information about the config. + Metadata Metadata `yaml:"metadata,omitempty"` + + // Pipeline defines the Build/Test/Deploy phases. + Pipeline `yaml:",inline"` + + // Profiles *beta* can override be used to `build`, `test` or `deploy` configuration. + Profiles []Profile `yaml:"profiles,omitempty"` +} + +// Metadata holds an optional name of the project. +type Metadata struct { + // Name is an identifier for the project. + Name string `yaml:"name,omitempty"` +} + +// Pipeline describes a Skaffold pipeline. +type Pipeline struct { + // Build describes how images are built. + Build BuildConfig `yaml:"build,omitempty"` + + // Test describes how images are tested. + Test []*TestCase `yaml:"test,omitempty"` + + // Deploy describes how images are deployed. + Deploy DeployConfig `yaml:"deploy,omitempty"` + + // PortForward describes user defined resources to port-forward. + PortForward []*PortForwardResource `yaml:"portForward,omitempty"` +} + +func (c *SkaffoldConfig) GetVersion() string { + return c.APIVersion +} + +// ResourceType describes the Kubernetes resource types used for port forwarding. +type ResourceType string + +// PortForwardResource describes a resource to port forward. +type PortForwardResource struct { + // Type is the Kubernetes type that should be port forwarded. + // Acceptable resource types include: `Service`, `Pod` and Controller resource type that has a pod spec: `ReplicaSet`, `ReplicationController`, `Deployment`, `StatefulSet`, `DaemonSet`, `Job`, `CronJob`. + Type ResourceType `yaml:"resourceType,omitempty"` + + // Name is the name of the Kubernetes resource to port forward. + Name string `yaml:"resourceName,omitempty"` + + // Namespace is the namespace of the resource to port forward. + Namespace string `yaml:"namespace,omitempty"` + + // Port is the resource port that will be forwarded. + Port int `yaml:"port,omitempty"` + + // Address is the local address to bind to. Defaults to the loopback address 127.0.0.1. + Address string `yaml:"address,omitempty"` + + // LocalPort is the local port to forward to. If the port is unavailable, Skaffold will choose a random open port to forward to. *Optional*. + LocalPort int `yaml:"localPort,omitempty"` +} + +// BuildConfig contains all the configuration for the build steps. +type BuildConfig struct { + // Artifacts lists the images you're going to be building. + Artifacts []*Artifact `yaml:"artifacts,omitempty"` + + // InsecureRegistries is a list of registries declared by the user to be insecure. + // These registries will be connected to via HTTP instead of HTTPS. + InsecureRegistries []string `yaml:"insecureRegistries,omitempty"` + + // TagPolicy *beta* determines how images are tagged. + // A few strategies are provided here, although you most likely won't need to care! + // If not specified, it defaults to `gitCommit: {variant: Tags}`. + TagPolicy TagPolicy `yaml:"tagPolicy,omitempty"` + + BuildType `yaml:",inline"` +} + +// TagPolicy contains all the configuration for the tagging step. +type TagPolicy struct { + // GitTagger *beta* tags images with the git tag or commit of the artifact's workspace. + GitTagger *GitTagger `yaml:"gitCommit,omitempty" yamltags:"oneOf=tag"` + + // ShaTagger *beta* tags images with their sha256 digest. + ShaTagger *ShaTagger `yaml:"sha256,omitempty" yamltags:"oneOf=tag"` + + // EnvTemplateTagger *beta* tags images with a configurable template string. + EnvTemplateTagger *EnvTemplateTagger `yaml:"envTemplate,omitempty" yamltags:"oneOf=tag"` + + // DateTimeTagger *beta* tags images with the build timestamp. + DateTimeTagger *DateTimeTagger `yaml:"dateTime,omitempty" yamltags:"oneOf=tag"` +} + +// ShaTagger *beta* tags images with their sha256 digest. +type ShaTagger struct{} + +// GitTagger *beta* tags images with the git tag or commit of the artifact's workspace. +type GitTagger struct { + // Variant determines the behavior of the git tagger. Valid variants are + // `Tags` (default): use git tags or fall back to abbreviated commit hash. + // `CommitSha`: use the full git commit sha. + // `AbbrevCommitSha`: use the abbreviated git commit sha. + // `TreeSha`: use the full tree hash of the artifact workingdir. + // `AbbrevTreeSha`: use the abbreviated tree hash of the artifact workingdir. + Variant string `yaml:"variant,omitempty"` +} + +// EnvTemplateTagger *beta* tags images with a configurable template string. +type EnvTemplateTagger struct { + // Template used to produce the image name and tag. + // See golang [text/template](https://golang.org/pkg/text/template/). + // The template is executed against the current environment, + // with those variables injected: + // IMAGE_NAME | Name of the image being built, as supplied in the artifacts section. + // For example: `{{.RELEASE}}-{{.IMAGE_NAME}}`. + Template string `yaml:"template,omitempty" yamltags:"required"` +} + +// DateTimeTagger *beta* tags images with the build timestamp. +type DateTimeTagger struct { + // Format formats the date and time. + // See [#Time.Format](https://golang.org/pkg/time/#Time.Format). + // Defaults to `2006-01-02_15-04-05.999_MST`. + Format string `yaml:"format,omitempty"` + + // TimeZone sets the timezone for the date and time. + // See [Time.LoadLocation](https://golang.org/pkg/time/#Time.LoadLocation). + // Defaults to the local timezone. + TimeZone string `yaml:"timezone,omitempty"` +} + +// BuildType contains the specific implementation and parameters needed +// for the build step. Only one field should be populated. +type BuildType struct { + // LocalBuild *beta* describes how to do a build on the local docker daemon + // and optionally push to a repository. + LocalBuild *LocalBuild `yaml:"local,omitempty" yamltags:"oneOf=build"` + + // GoogleCloudBuild *beta* describes how to do a remote build on + // [Google Cloud Build](https://cloud.google.com/cloud-build/). + GoogleCloudBuild *GoogleCloudBuild `yaml:"googleCloudBuild,omitempty" yamltags:"oneOf=build"` + + // Cluster *beta* describes how to do an on-cluster build. + Cluster *ClusterDetails `yaml:"cluster,omitempty" yamltags:"oneOf=build"` +} + +// LocalBuild *beta* describes how to do a build on the local docker daemon +// and optionally push to a repository. +type LocalBuild struct { + // Push should images be pushed to a registry. + // If not specified, images are pushed only if the current Kubernetes context + // connects to a remote cluster. + Push *bool `yaml:"push,omitempty"` + + // UseDockerCLI use `docker` command-line interface instead of Docker Engine APIs. + UseDockerCLI bool `yaml:"useDockerCLI,omitempty"` + + // UseBuildkit use BuildKit to build Docker images. + UseBuildkit bool `yaml:"useBuildkit,omitempty"` + + // Concurrency is how many artifacts can be built concurrently. 0 means "no-limit". + // Defaults to `1`. + Concurrency *int `yaml:"concurrency,omitempty"` +} + +// GoogleCloudBuild *beta* describes how to do a remote build on +// [Google Cloud Build](https://cloud.google.com/cloud-build/docs/). +// Docker and Jib artifacts can be built on Cloud Build. The `projectId` needs +// to be provided and the currently logged in user should be given permissions to trigger +// new builds. +type GoogleCloudBuild struct { + // ProjectID is the ID of your Cloud Platform Project. + // If it is not provided, Skaffold will guess it from the image name. + // For example, given the artifact image name `gcr.io/myproject/image`, Skaffold + // will use the `myproject` GCP project. + ProjectID string `yaml:"projectId,omitempty"` + + // DiskSizeGb is the disk size of the VM that runs the build. + // See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions). + DiskSizeGb int64 `yaml:"diskSizeGb,omitempty"` + + // MachineType is the type of the VM that runs the build. + // See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions). + MachineType string `yaml:"machineType,omitempty"` + + // Timeout is the amount of time (in seconds) that this build should be allowed to run. + // See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#resource-build). + Timeout string `yaml:"timeout,omitempty"` + + // DockerImage is the image that runs a Docker build. + // See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders). + // Defaults to `gcr.io/cloud-builders/docker`. + DockerImage string `yaml:"dockerImage,omitempty"` + + // KanikoImage is the image that runs a Kaniko build. + // See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders). + // Defaults to `gcr.io/kaniko-project/executor`. + KanikoImage string `yaml:"kanikoImage,omitempty"` + + // MavenImage is the image that runs a Maven build. + // See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders). + // Defaults to `gcr.io/cloud-builders/mvn`. + MavenImage string `yaml:"mavenImage,omitempty"` + + // GradleImage is the image that runs a Gradle build. + // See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders). + // Defaults to `gcr.io/cloud-builders/gradle`. + GradleImage string `yaml:"gradleImage,omitempty"` + + // PackImage is the image that runs a Cloud Native Buildpacks build. + // See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders). + // Defaults to `gcr.io/k8s-skaffold/pack`. + PackImage string `yaml:"packImage,omitempty"` + + // Concurrency is how many artifacts can be built concurrently. 0 means "no-limit". + // Defaults to `0`. + Concurrency int `yaml:"concurrency,omitempty"` +} + +// KanikoCache configures Kaniko caching. If a cache is specified, Kaniko will +// use a remote cache which will speed up builds. +type KanikoCache struct { + // Repo is a remote repository to store cached layers. If none is specified, one will be + // inferred from the image name. See [Kaniko Caching](https://github.com/GoogleContainerTools/kaniko#caching). + Repo string `yaml:"repo,omitempty"` + // HostPath specifies a path on the host that is mounted to each pod as read only cache volume containing base images. + // If set, must exist on each node and prepopulated with kaniko-warmer. + HostPath string `yaml:"hostPath,omitempty"` +} + +// ClusterDetails *beta* describes how to do an on-cluster build. +type ClusterDetails struct { + // HTTPProxy for kaniko pod. + HTTPProxy string `yaml:"HTTP_PROXY,omitempty"` + + // HTTPSProxy for kaniko pod. + HTTPSProxy string `yaml:"HTTPS_PROXY,omitempty"` + + // PullSecret is the path to the Google Cloud service account secret key file. + PullSecret string `yaml:"pullSecret,omitempty"` + + // PullSecretName is the name of the Kubernetes secret for pulling base images + // and pushing the final image. If given, the secret needs to contain the Google Cloud + // service account secret key under the key `kaniko-secret`. + // Defaults to `kaniko-secret`. + PullSecretName string `yaml:"pullSecretName,omitempty"` + + // PullSecretMountPath is the path the pull secret will be mounted at within the running container. + PullSecretMountPath string `yaml:"pullSecretMountPath,omitempty"` + + // Namespace is the Kubernetes namespace. + // Defaults to current namespace in Kubernetes configuration. + Namespace string `yaml:"namespace,omitempty"` + + // Timeout is the amount of time (in seconds) that this build is allowed to run. + // Defaults to 20 minutes (`20m`). + Timeout string `yaml:"timeout,omitempty"` + + // DockerConfig describes how to mount the local Docker configuration into a pod. + DockerConfig *DockerConfig `yaml:"dockerConfig,omitempty"` + + // Resources define the resource requirements for the kaniko pod. + Resources *ResourceRequirements `yaml:"resources,omitempty"` + + // Concurrency is how many artifacts can be built concurrently. 0 means "no-limit". + // Defaults to `0`. + Concurrency int `yaml:"concurrency,omitempty"` + + // Volumes defines container mounts for ConfigMap and Secret resources. + Volumes []v1.Volume `yaml:"volumes,omitempty"` + + // RandomPullSecret adds a random UUID postfix to the default name of the pull secret to facilitate parallel builds, e.g. kaniko-secretdocker-cfgfd154022-c761-416f-8eb3-cf8258450b85. + RandomPullSecret bool `yaml:"randomPullSecret,omitempty"` + + // RandomDockerConfigSecret adds a random UUID postfix to the default name of the docker secret to facilitate parallel builds, e.g. docker-cfgfd154022-c761-416f-8eb3-cf8258450b85. + RandomDockerConfigSecret bool `yaml:"randomDockerConfigSecret,omitempty"` +} + +// DockerConfig contains information about the docker `config.json` to mount. +type DockerConfig struct { + // Path is the path to the docker `config.json`. + Path string `yaml:"path,omitempty"` + + // SecretName is the Kubernetes secret that contains the `config.json` Docker configuration. + // Note that the expected secret type is not 'kubernetes.io/dockerconfigjson' but 'Opaque'. + SecretName string `yaml:"secretName,omitempty"` +} + +// ResourceRequirements describes the resource requirements for the kaniko pod. +type ResourceRequirements struct { + // Requests [resource requests](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the Kaniko pod. + Requests *ResourceRequirement `yaml:"requests,omitempty"` + + // Limits [resource limits](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the Kaniko pod. + Limits *ResourceRequirement `yaml:"limits,omitempty"` +} + +// ResourceRequirement stores the CPU/Memory requirements for the pod. +type ResourceRequirement struct { + // CPU the number cores to be used. + // For example: `2`, `2.0` or `200m`. + CPU string `yaml:"cpu,omitempty"` + + // Memory the amount of memory to allocate to the pod. + // For example: `1Gi` or `1000Mi`. + Memory string `yaml:"memory,omitempty"` + + // EphemeralStorage the amount of Ephemeral storage to allocate to the pod. + // For example: `1Gi` or `1000Mi`. + EphemeralStorage string `yaml:"ephemeralStorage,omitempty"` + + // ResourceStorage the amount of resource storage to allocate to the pod. + // For example: `1Gi` or `1000Mi`. + ResourceStorage string `yaml:"resourceStorage,omitempty"` +} + +// TestCase is a list of structure tests to run on images that Skaffold builds. +type TestCase struct { + // ImageName is the artifact on which to run those tests. + // For example: `gcr.io/k8s-skaffold/example`. + ImageName string `yaml:"image" yamltags:"required"` + + // StructureTests lists the [Container Structure Tests](https://github.com/GoogleContainerTools/container-structure-test) + // to run on that artifact. + // For example: `["./test/*"]`. + StructureTests []string `yaml:"structureTests,omitempty"` +} + +// DeployConfig contains all the configuration needed by the deploy steps. +type DeployConfig struct { + DeployType `yaml:",inline"` + + // StatusCheckDeadlineSeconds *beta* is the deadline for deployments to stabilize in seconds. + StatusCheckDeadlineSeconds int `yaml:"statusCheckDeadlineSeconds,omitempty"` + + // KubeContext is the Kubernetes context that Skaffold should deploy to. + // For example: `minikube`. + KubeContext string `yaml:"kubeContext,omitempty"` +} + +// DeployType contains the specific implementation and parameters needed +// for the deploy step. All three deployer types can be used at the same +// time for hybrid workflows. +type DeployType struct { + // HelmDeploy *beta* uses the `helm` CLI to apply the charts to the cluster. + HelmDeploy *HelmDeploy `yaml:"helm,omitempty"` + + // KubectlDeploy *beta* uses a client side `kubectl apply` to deploy manifests. + // You'll need a `kubectl` CLI version installed that's compatible with your cluster. + KubectlDeploy *KubectlDeploy `yaml:"kubectl,omitempty"` + + // KustomizeDeploy *beta* uses the `kustomize` CLI to "patch" a deployment for a target environment. + KustomizeDeploy *KustomizeDeploy `yaml:"kustomize,omitempty"` +} + +// KubectlDeploy *beta* uses a client side `kubectl apply` to deploy manifests. +// You'll need a `kubectl` CLI version installed that's compatible with your cluster. +type KubectlDeploy struct { + // Manifests lists the Kubernetes yaml or json manifests. + // Defaults to `["k8s/*.yaml"]`. + Manifests []string `yaml:"manifests,omitempty"` + + // RemoteManifests lists Kubernetes manifests in remote clusters. + RemoteManifests []string `yaml:"remoteManifests,omitempty"` + + // Flags are additional flags passed to `kubectl`. + Flags KubectlFlags `yaml:"flags,omitempty"` +} + +// KubectlFlags are additional flags passed on the command +// line to kubectl either on every command (Global), on creations (Apply) +// or deletions (Delete). +type KubectlFlags struct { + // Global are additional flags passed on every command. + Global []string `yaml:"global,omitempty"` + + // Apply are additional flags passed on creations (`kubectl apply`). + Apply []string `yaml:"apply,omitempty"` + + // Delete are additional flags passed on deletions (`kubectl delete`). + Delete []string `yaml:"delete,omitempty"` + + // DisableValidation passes the `--validate=false` flag to supported + // `kubectl` commands when enabled. + DisableValidation bool `yaml:"disableValidation,omitempty"` +} + +// HelmDeploy *beta* uses the `helm` CLI to apply the charts to the cluster. +type HelmDeploy struct { + // Releases is a list of Helm releases. + Releases []HelmRelease `yaml:"releases,omitempty" yamltags:"required"` + + // Flags are additional option flags that are passed on the command + // line to `helm`. + Flags HelmDeployFlags `yaml:"flags,omitempty"` +} + +// HelmDeployFlags are additional option flags that are passed on the command +// line to `helm`. +type HelmDeployFlags struct { + // Global are additional flags passed on every command. + Global []string `yaml:"global,omitempty"` + + // Install are additional flags passed to (`helm install`). + Install []string `yaml:"install,omitempty"` + + // Upgrade are additional flags passed to (`helm upgrade`). + Upgrade []string `yaml:"upgrade,omitempty"` +} + +// KustomizeDeploy *beta* uses the `kustomize` CLI to "patch" a deployment for a target environment. +type KustomizeDeploy struct { + // KustomizePaths is the path to Kustomization files. + // Defaults to `["."]`. + KustomizePaths []string `yaml:"paths,omitempty"` + + // Flags are additional flags passed to `kubectl`. + Flags KubectlFlags `yaml:"flags,omitempty"` + + // BuildArgs are additional args passed to `kustomize build`. + BuildArgs []string `yaml:"buildArgs,omitempty"` +} + +// HelmRelease describes a helm release to be deployed. +type HelmRelease struct { + // Name is the name of the Helm release. + Name string `yaml:"name,omitempty" yamltags:"required"` + + // ChartPath is the path to the Helm chart. + ChartPath string `yaml:"chartPath,omitempty" yamltags:"required"` + + // ValuesFiles are the paths to the Helm `values` files. + ValuesFiles []string `yaml:"valuesFiles,omitempty"` + + // Values are key-value pairs supplementing the Helm `values` file. + Values map[string]string `yaml:"values,omitempty,omitempty"` + + // Namespace is the Kubernetes namespace. + Namespace string `yaml:"namespace,omitempty"` + + // Version is the version of the chart. + Version string `yaml:"version,omitempty"` + + // SetValues are key-value pairs. + // If present, Skaffold will send `--set` flag to Helm CLI and append all pairs after the flag. + SetValues map[string]string `yaml:"setValues,omitempty"` + + // SetValueTemplates are key-value pairs. + // If present, Skaffold will try to parse the value part of each key-value pair using + // environment variables in the system, then send `--set` flag to Helm CLI and append + // all parsed pairs after the flag. + SetValueTemplates map[string]string `yaml:"setValueTemplates,omitempty"` + + // SetFiles are key-value pairs. + // If present, Skaffold will send `--set-file` flag to Helm CLI and append all pairs after the flag. + SetFiles map[string]string `yaml:"setFiles,omitempty"` + + // Wait if `true`, Skaffold will send `--wait` flag to Helm CLI. + // Defaults to `false`. + Wait bool `yaml:"wait,omitempty"` + + // RecreatePods if `true`, Skaffold will send `--recreate-pods` flag to Helm CLI + // when upgrading a new version of a chart in subsequent dev loop deploy. + // Defaults to `false`. + RecreatePods bool `yaml:"recreatePods,omitempty"` + + // SkipBuildDependencies should build dependencies be skipped. + SkipBuildDependencies bool `yaml:"skipBuildDependencies,omitempty"` + + // UseHelmSecrets instructs skaffold to use secrets plugin on deployment. + UseHelmSecrets bool `yaml:"useHelmSecrets,omitempty"` + + // Remote specifies whether the chart path is remote, or exists on the host filesystem. + // `remote: true` implies `skipBuildDependencies: true`. + Remote bool `yaml:"remote,omitempty"` + + // Overrides are key-value pairs. + // If present, Skaffold will build a Helm `values` file that overrides + // the original and use it to call Helm CLI (`--f` flag). + Overrides util.HelmOverrides `yaml:"overrides,omitempty"` + + // Packaged parameters for packaging helm chart (`helm package`). + Packaged *HelmPackaged `yaml:"packaged,omitempty"` + + // ImageStrategy adds image configurations to the Helm `values` file. + ImageStrategy HelmImageStrategy `yaml:"imageStrategy,omitempty"` +} + +// HelmPackaged parameters for packaging helm chart (`helm package`). +type HelmPackaged struct { + // Version sets the `version` on the chart to this semver version. + Version string `yaml:"version,omitempty"` + + // AppVersion sets the `appVersion` on the chart to this version. + AppVersion string `yaml:"appVersion,omitempty"` +} + +// HelmImageStrategy adds image configurations to the Helm `values` file. +type HelmImageStrategy struct { + HelmImageConfig `yaml:",inline"` +} + +// HelmImageConfig describes an image configuration. +type HelmImageConfig struct { + // HelmFQNConfig is the image configuration uses the syntax `IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG`. + HelmFQNConfig *HelmFQNConfig `yaml:"fqn,omitempty" yamltags:"oneOf=helmImageStrategy"` + + // HelmConventionConfig is the image configuration uses the syntax `IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG`. + HelmConventionConfig *HelmConventionConfig `yaml:"helm,omitempty" yamltags:"oneOf=helmImageStrategy"` +} + +// HelmFQNConfig is the image config to use the FullyQualifiedImageName as param to set. +type HelmFQNConfig struct { + // Property defines the image config. + Property string `yaml:"property,omitempty"` +} + +// HelmConventionConfig is the image config in the syntax of image.repository and image.tag. +type HelmConventionConfig struct { + // ExplicitRegistry separates `image.registry` to the image config syntax. Useful for some charts e.g. `postgresql`. + ExplicitRegistry bool `yaml:"explicitRegistry,omitempty"` +} + +// Artifact are the items that need to be built, along with the context in which +// they should be built. +type Artifact struct { + // ImageName is the name of the image to be built. + // For example: `gcr.io/k8s-skaffold/example`. + ImageName string `yaml:"image,omitempty" yamltags:"required"` + + // Workspace is the directory containing the artifact's sources. + // Defaults to `.`. + Workspace string `yaml:"context,omitempty"` + + // Sync *beta* lists local files synced to pods instead + // of triggering an image build when modified. + // If no files are listed, sync all the files and infer the destination. + // Defaults to `infer: ["**/*"]`. + Sync *Sync `yaml:"sync,omitempty"` + + // ArtifactType describes how to build an artifact. + ArtifactType `yaml:",inline"` +} + +// Sync *beta* specifies what files to sync into the container. +// This is a list of sync rules indicating the intent to sync for source files. +// If no files are listed, sync all the files and infer the destination. +// Defaults to `infer: ["**/*"]`. +type Sync struct { + // Manual lists manual sync rules indicating the source and destination. + Manual []*SyncRule `yaml:"manual,omitempty" yamltags:"oneOf=sync"` + + // Infer lists file patterns which may be synced into the container. + // The container destination is inferred by the builder. + // Currently only available for docker artifacts. + Infer []string `yaml:"infer,omitempty" yamltags:"oneOf=sync"` +} + +// SyncRule specifies which local files to sync to remote folders. +type SyncRule struct { + // Src is a glob pattern to match local paths against. + // Directories should be delimited by `/` on all platforms. + // For example: `"css/**/*.css"`. + Src string `yaml:"src,omitempty" yamltags:"required"` + + // Dest is the destination path in the container where the files should be synced to. + // For example: `"app/"` + Dest string `yaml:"dest,omitempty" yamltags:"required"` + + // Strip specifies the path prefix to remove from the source path when + // transplanting the files into the destination folder. + // For example: `"css/"` + Strip string `yaml:"strip,omitempty"` +} + +// Profile is used to override any `build`, `test` or `deploy` configuration. +type Profile struct { + // Name is a unique profile name. + // For example: `profile-prod`. + Name string `yaml:"name,omitempty" yamltags:"required"` + + // Pipeline contains the definitions to replace the default skaffold pipeline. + Pipeline `yaml:",inline"` + + // Patches lists patches applied to the configuration. + // Patches use the JSON patch notation. + Patches []JSONPatch `yaml:"patches,omitempty"` + + // Activation criteria by which a profile can be auto-activated. + // The profile is auto-activated if any one of the activations are triggered. + // An activation is triggered if all of the criteria (env, kubeContext, command) are triggered. + Activation []Activation `yaml:"activation,omitempty"` +} + +// JSONPatch patch to be applied by a profile. +type JSONPatch struct { + // Op is the operation carried by the patch: `add`, `remove`, `replace`, `move`, `copy` or `test`. + // Defaults to `replace`. + Op string `yaml:"op,omitempty"` + + // Path is the position in the yaml where the operation takes place. + // For example, this targets the `dockerfile` of the first artifact built. + // For example: `/build/artifacts/0/docker/dockerfile`. + Path string `yaml:"path,omitempty" yamltags:"required"` + + // From is the source position in the yaml, used for `copy` or `move` operations. + From string `yaml:"from,omitempty"` + + // Value is the value to apply. Can be any portion of yaml. + Value *util.YamlpatchNode `yaml:"value,omitempty"` +} + +// Activation criteria by which a profile is auto-activated. +type Activation struct { + // Env is a `key=pattern` pair. The profile is auto-activated if an Environment + // Variable `key` matches the pattern. If the pattern starts with `!`, activation + // happens if the remaining pattern is _not_ matched. The pattern matches if the + // Environment Variable value is exactly `pattern`, or the regex `pattern` is + // found in it. An empty `pattern` (e.g. `env: "key="`) always only matches if + // the Environment Variable is undefined or empty. + // For example: `ENV=production` + Env string `yaml:"env,omitempty"` + + // KubeContext is a Kubernetes context for which the profile is auto-activated. + // For example: `minikube`. + KubeContext string `yaml:"kubeContext,omitempty"` + + // Command is a Skaffold command for which the profile is auto-activated. + // For example: `dev`. + Command string `yaml:"command,omitempty"` +} + +// ArtifactType describes how to build an artifact. +type ArtifactType struct { + // DockerArtifact *beta* describes an artifact built from a Dockerfile. + DockerArtifact *DockerArtifact `yaml:"docker,omitempty" yamltags:"oneOf=artifact"` + + // BazelArtifact *beta* requires bazel CLI to be installed and the sources to + // contain [Bazel](https://bazel.build/) configuration files. + BazelArtifact *BazelArtifact `yaml:"bazel,omitempty" yamltags:"oneOf=artifact"` + + // JibArtifact builds images using the + // [Jib plugins for Maven or Gradle](https://github.com/GoogleContainerTools/jib/). + JibArtifact *JibArtifact `yaml:"jib,omitempty" yamltags:"oneOf=artifact"` + + // KanikoArtifact builds images using [kaniko](https://github.com/GoogleContainerTools/kaniko). + KanikoArtifact *KanikoArtifact `yaml:"kaniko,omitempty" yamltags:"oneOf=artifact"` + + // BuildpackArtifact builds images using [Cloud Native Buildpacks](https://buildpacks.io/). + BuildpackArtifact *BuildpackArtifact `yaml:"buildpack,omitempty" yamltags:"oneOf=artifact"` + + // CustomArtifact *beta* builds images using a custom build script written by the user. + CustomArtifact *CustomArtifact `yaml:"custom,omitempty" yamltags:"oneOf=artifact"` +} + +// BuildpackArtifact *alpha* describes an artifact built using [Cloud Native Buildpacks](https://buildpacks.io/). +// It can be used to build images out of project's sources without any additional configuration. +type BuildpackArtifact struct { + // Builder is the builder image used. + Builder string `yaml:"builder" yamltags:"required"` + + // RunImage overrides the stack's default run image. + RunImage string `yaml:"runImage,omitempty"` + + // Env are environment variables, in the `key=value` form, passed to the build. + // Values can use the go template syntax. + // For example: `["key1=value1", "key2=value2", "key3={{.ENV_VARIABLE}}"]`. + Env []string `yaml:"env,omitempty"` + + // Buildpacks is a list of strings, where each string is a specific buildpack to use with the builder. + // If you specify buildpacks the builder image automatic detection will be ignored. These buildpacks will be used to build the Image from your source code. + // Order matters. + Buildpacks []string `yaml:"buildpacks,omitempty"` + + // Dependencies are the file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact. + Dependencies *BuildpackDependencies `yaml:"dependencies,omitempty"` +} + +// BuildpackDependencies *alpha* is used to specify dependencies for an artifact built by a buildpack. +type BuildpackDependencies struct { + // Paths should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization. + Paths []string `yaml:"paths,omitempty" yamltags:"oneOf=dependency"` + + // Ignore specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both `paths` and in `ignore`, it will be ignored, and will be excluded from both rebuilds and file synchronization. + // Will only work in conjunction with `paths`. + Ignore []string `yaml:"ignore,omitempty"` +} + +// CustomArtifact *beta* describes an artifact built from a custom build script +// written by the user. It can be used to build images with builders that aren't directly integrated with skaffold. +type CustomArtifact struct { + // BuildCommand is the command executed to build the image. + BuildCommand string `yaml:"buildCommand,omitempty"` + // Dependencies are the file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact. + Dependencies *CustomDependencies `yaml:"dependencies,omitempty"` +} + +// CustomDependencies *beta* is used to specify dependencies for an artifact built by a custom build script. +// Either `dockerfile` or `paths` should be specified for file watching to work as expected. +type CustomDependencies struct { + // Dockerfile should be set if the artifact is built from a Dockerfile, from which skaffold can determine dependencies. + Dockerfile *DockerfileDependency `yaml:"dockerfile,omitempty" yamltags:"oneOf=dependency"` + // Command represents a custom command that skaffold executes to obtain dependencies. The output of this command *must* be a valid JSON array. + Command string `yaml:"command,omitempty" yamltags:"oneOf=dependency"` + // Paths should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization. + Paths []string `yaml:"paths,omitempty" yamltags:"oneOf=dependency"` + // Ignore specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both `paths` and in `ignore`, it will be ignored, and will be excluded from both rebuilds and file synchronization. + // Will only work in conjunction with `paths`. + Ignore []string `yaml:"ignore,omitempty"` +} + +// DockerfileDependency *beta* is used to specify a custom build artifact that is built from a Dockerfile. This allows skaffold to determine dependencies from the Dockerfile. +type DockerfileDependency struct { + // Path locates the Dockerfile relative to workspace. + Path string `yaml:"path,omitempty"` + + // BuildArgs are arguments passed to the docker build. + // It also accepts environment variables via the go template syntax. + // For example: `{"key1": "value1", "key2": "value2", "key3": "'{{.ENV_VARIABLE}}'"}`. + BuildArgs map[string]*string `yaml:"buildArgs,omitempty"` +} + +// KanikoArtifact describes an artifact built from a Dockerfile, +// with kaniko. +type KanikoArtifact struct { + // AdditionalFlags are additional flags to be passed to Kaniko command line. + // See [Kaniko Additional Flags](https://github.com/GoogleContainerTools/kaniko#additional-flags). + // Deprecated - instead the named, unique fields should be used, e.g. `buildArgs`, `cache`, `target`. + AdditionalFlags []string `yaml:"flags,omitempty"` + + // DockerfilePath locates the Dockerfile relative to workspace. + // Defaults to `Dockerfile`. + DockerfilePath string `yaml:"dockerfile,omitempty"` + + // Target is the Dockerfile target name to build. + Target string `yaml:"target,omitempty"` + + // BuildArgs are arguments passed to the docker build. + // It also accepts environment variables via the go template syntax. + // For example: `{"key1": "value1", "key2": "value2", "key3": "'{{.ENV_VARIABLE}}'"}`. + BuildArgs map[string]*string `yaml:"buildArgs,omitempty"` + + // Env are environment variables passed to the kaniko pod. + Env []v1.EnvVar `yaml:"env,omitempty"` + + // InitImage is the image used to run init container which mounts kaniko context. + InitImage string `yaml:"initImage,omitempty"` + + // Image is the Docker image used by the Kaniko pod. + // Defaults to the latest released version of `gcr.io/kaniko-project/executor`. + Image string `yaml:"image,omitempty"` + + // Cache configures Kaniko caching. If a cache is specified, Kaniko will + // use a remote cache which will speed up builds. + Cache *KanikoCache `yaml:"cache,omitempty"` + + // Reproducible is used to strip timestamps out of the built image. + Reproducible bool `yaml:"reproducible,omitempty"` + + // SkipTLS skips TLS verification when pulling and pushing the image. + SkipTLS bool `yaml:"skipTLS,omitempty"` + + // VolumeMounts are volume mounts passed to kaniko pod. + VolumeMounts []v1.VolumeMount `yaml:"volumeMounts,omitempty"` +} + +// DockerArtifact describes an artifact built from a Dockerfile, +// usually using `docker build`. +type DockerArtifact struct { + // DockerfilePath locates the Dockerfile relative to workspace. + // Defaults to `Dockerfile`. + DockerfilePath string `yaml:"dockerfile,omitempty"` + + // Target is the Dockerfile target name to build. + Target string `yaml:"target,omitempty"` + + // BuildArgs are arguments passed to the docker build. + // For example: `{"key1": "value1", "key2": "value2"}`. + BuildArgs map[string]*string `yaml:"buildArgs,omitempty"` + + // NetworkMode is passed through to docker and overrides the + // network configuration of docker builder. If unset, use whatever + // is configured in the underlying docker daemon. Valid modes are + // `host`: use the host's networking stack. + // `bridge`: use the bridged network configuration. + // `none`: no networking in the container. + NetworkMode string `yaml:"network,omitempty"` + + // CacheFrom lists the Docker images used as cache sources. + // For example: `["golang:1.10.1-alpine3.7", "alpine:3.7"]`. + CacheFrom []string `yaml:"cacheFrom,omitempty"` + + // NoCache used to pass in --no-cache to docker build to prevent caching. + NoCache bool `yaml:"noCache,omitempty"` +} + +// BazelArtifact describes an artifact built with [Bazel](https://bazel.build/). +type BazelArtifact struct { + // BuildTarget is the `bazel build` target to run. + // For example: `//:skaffold_example.tar`. + BuildTarget string `yaml:"target,omitempty" yamltags:"required"` + + // BuildArgs are additional args to pass to `bazel build`. + // For example: `["-flag", "--otherflag"]`. + BuildArgs []string `yaml:"args,omitempty"` +} + +// JibArtifact builds images using the +// [Jib plugins for Maven and Gradle](https://github.com/GoogleContainerTools/jib/). +type JibArtifact struct { + // Project selects which sub-project to build for multi-module builds. + Project string `yaml:"project,omitempty"` + + // Flags are additional build flags passed to the builder. + // For example: `["--no-build-cache"]`. + Flags []string `yaml:"args,omitempty"` + + // Type the Jib builder type; normally determined automatically. Valid types are + // `maven`: for Maven. + // `gradle`: for Gradle. + Type string `yaml:"type,omitempty"` +} diff --git a/pkg/skaffold/schema/v2alpha3/upgrade.go b/pkg/skaffold/schema/v2alpha3/upgrade.go new file mode 100755 index 00000000000..f8bb7e9dd5c --- /dev/null +++ b/pkg/skaffold/schema/v2alpha3/upgrade.go @@ -0,0 +1,45 @@ +/* +Copyright 2019 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v2alpha3 + +import ( + next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/util" + pkgutil "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" +) + +// Upgrade upgrades a configuration to the next version. +// Config changes from v2alpha3 to v2alpha4 +// 1. Additions: +// 2. Removals: +// 3. Updates: +// - kustomize deployer supports multiple paths +func (c *SkaffoldConfig) Upgrade() (util.VersionedConfig, error) { + var newConfig next.SkaffoldConfig + + pkgutil.CloneThroughJSON(c, &newConfig) + if err := util.UpgradePipelines(c, &newConfig, upgradeOnePipeline); err != nil { + return nil, err + } + newConfig.APIVersion = next.Version + + return &newConfig, nil +} + +func upgradeOnePipeline(_, _ interface{}) error { + return nil +} diff --git a/pkg/skaffold/schema/v2alpha3/upgrade_test.go b/pkg/skaffold/schema/v2alpha3/upgrade_test.go new file mode 100755 index 00000000000..88c73a9309d --- /dev/null +++ b/pkg/skaffold/schema/v2alpha3/upgrade_test.go @@ -0,0 +1,172 @@ +/* +Copyright 2019 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v2alpha3 + +import ( + "testing" + + yaml "gopkg.in/yaml.v2" + + next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" + "github.com/GoogleContainerTools/skaffold/testutil" +) + +func TestUpgrade(t *testing.T) { + yaml := `apiVersion: skaffold/v2alpha3 +kind: Config +build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + docker: + dockerfile: path/to/Dockerfile + - image: gcr.io/k8s-skaffold/bazel + bazel: + target: //mytarget + - image: gcr.io/k8s-skaffold/jib-maven + jib: + args: ['-v', '--activate-profiles', 'prof'] + project: dir + - image: gcr.io/k8s-skaffold/jib-gradle + jib: + args: ['-v'] + googleCloudBuild: + projectId: test-project +test: + - image: gcr.io/k8s-skaffold/skaffold-example + structureTests: + - ./test/* +deploy: + kubectl: + manifests: + - k8s-* + kustomize: + path: kustomization-main +profiles: + - name: test profile + build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + kaniko: + cache: {} + cluster: + pullSecretName: e2esecret + namespace: default + test: + - image: gcr.io/k8s-skaffold/skaffold-example + structureTests: + - ./test/* + deploy: + kubectl: + manifests: + - k8s-* + kustomize: + path: kustomization-test + - name: test local + build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + docker: + dockerfile: path/to/Dockerfile + local: + push: false + deploy: + kubectl: + manifests: + - k8s-* + kustomize: {} +` + expected := `apiVersion: skaffold/v2alpha4 +kind: Config +build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + docker: + dockerfile: path/to/Dockerfile + - image: gcr.io/k8s-skaffold/bazel + bazel: + target: //mytarget + - image: gcr.io/k8s-skaffold/jib-maven + jib: + args: ['-v', '--activate-profiles', 'prof'] + project: dir + - image: gcr.io/k8s-skaffold/jib-gradle + jib: + args: ['-v'] + googleCloudBuild: + projectId: test-project +test: + - image: gcr.io/k8s-skaffold/skaffold-example + structureTests: + - ./test/* +deploy: + kubectl: + manifests: + - k8s-* + kustomize: + paths: + - kustomization-main +profiles: + - name: test profile + build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + kaniko: + cache: {} + cluster: + pullSecretName: e2esecret + namespace: default + test: + - image: gcr.io/k8s-skaffold/skaffold-example + structureTests: + - ./test/* + deploy: + kubectl: + manifests: + - k8s-* + kustomize: + paths: + - kustomization-test + - name: test local + build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + docker: + dockerfile: path/to/Dockerfile + local: + push: false + deploy: + kubectl: + manifests: + - k8s-* + kustomize: {} +` + verifyUpgrade(t, yaml, expected) +} + +func verifyUpgrade(t *testing.T, input, output string) { + config := NewSkaffoldConfig() + err := yaml.UnmarshalStrict([]byte(input), config) + testutil.CheckErrorAndDeepEqual(t, false, err, Version, config.GetVersion()) + + upgraded, err := config.Upgrade() + testutil.CheckError(t, false, err) + + expected := next.NewSkaffoldConfig() + err = yaml.UnmarshalStrict([]byte(output), expected) + + testutil.CheckErrorAndDeepEqual(t, false, err, expected, upgraded) +} diff --git a/pkg/skaffold/schema/versions.go b/pkg/skaffold/schema/versions.go index 1eb0e99f7f1..2de909e774c 100644 --- a/pkg/skaffold/schema/versions.go +++ b/pkg/skaffold/schema/versions.go @@ -52,6 +52,7 @@ import ( "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v1beta9" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2alpha1" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2alpha2" + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2alpha3" misc "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" ) @@ -85,6 +86,7 @@ var SchemaVersions = Versions{ {v1.Version, v1.NewSkaffoldConfig}, {v2alpha1.Version, v2alpha1.NewSkaffoldConfig}, {v2alpha2.Version, v2alpha2.NewSkaffoldConfig}, + {v2alpha3.Version, v2alpha3.NewSkaffoldConfig}, {latest.Version, latest.NewSkaffoldConfig}, } From b2f3b600d3b69e05ed2d8d12654da130964afffc Mon Sep 17 00:00:00 2001 From: David Hovey Date: Thu, 20 Feb 2020 08:42:54 -0700 Subject: [PATCH 05/11] Added missing merge resolution --- pkg/skaffold/schema/v2alpha3/upgrade_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/skaffold/schema/v2alpha3/upgrade_test.go b/pkg/skaffold/schema/v2alpha3/upgrade_test.go index 5335f1ad884..cd1bc2697ce 100755 --- a/pkg/skaffold/schema/v2alpha3/upgrade_test.go +++ b/pkg/skaffold/schema/v2alpha3/upgrade_test.go @@ -79,12 +79,8 @@ profiles: manifests: - k8s-* kustomize: -<<<<<<< HEAD - path: kustomization-test -======= paths: - kustomization-test ->>>>>>> master - name: test local build: artifacts: From fa592cb7d3cb9fa6c58d9ee4f989946821fd74a8 Mon Sep 17 00:00:00 2001 From: David Hovey Date: Thu, 20 Feb 2020 09:10:22 -0700 Subject: [PATCH 06/11] Simplified helm deployment logic, Re-arranged helm release schema descriptions --- docs/content/en/schemas/v2alpha4.json | 14 +++++--- go.sum | 2 ++ pkg/skaffold/deploy/helm.go | 38 +++++++------------- pkg/skaffold/deploy/helm_test.go | 1 - pkg/skaffold/schema/latest/config.go | 5 +-- pkg/skaffold/schema/v2alpha3/upgrade_test.go | 4 --- 6 files changed, 27 insertions(+), 37 deletions(-) diff --git a/docs/content/en/schemas/v2alpha4.json b/docs/content/en/schemas/v2alpha4.json index 433ac93fa92..82091ea3a8f 100755 --- a/docs/content/en/schemas/v2alpha4.json +++ b/docs/content/en/schemas/v2alpha4.json @@ -1214,8 +1214,8 @@ }, "remote": { "type": "boolean", - "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true`.", - "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true.", + "description": "specifies whether the chart path is remote, or exists on the host filesystem.", + "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem.", "default": "false" }, "setFiles": { @@ -1247,10 +1247,15 @@ }, "skipBuildDependencies": { "type": "boolean", - "description": "should build dependencies be skipped.", - "x-intellij-html-description": "should build dependencies be skipped.", + "description": "should build dependencies be skipped. Ignored when `remote: true`.", + "x-intellij-html-description": "should build dependencies be skipped. Ignored when remote: true.", "default": "false" }, + "upgradeOnChange": { + "type": "boolean", + "description": "specifies whether to upgrade helm chart on code changes. Default is `true` when helm chart is local (`remote: false`). Default is `false` if `remote: true`.", + "x-intellij-html-description": "specifies whether to upgrade helm chart on code changes. Default is true when helm chart is local (remote: false). Default is false if remote: true." + }, "useHelmSecrets": { "type": "boolean", "description": "instructs skaffold to use secrets plugin on deployment.", @@ -1302,6 +1307,7 @@ "skipBuildDependencies", "useHelmSecrets", "remote", + "upgradeOnChange", "overrides", "packaged", "imageStrategy" diff --git a/go.sum b/go.sum index 050487a04e4..50f82489dce 100644 --- a/go.sum +++ b/go.sum @@ -271,6 +271,7 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-containerregistry v0.0.0-20191018211754-b77a90c667af/go.mod h1:9kIomAeXUmwhqeYS2zoEuQ0sc2GOVmNW7t3y9aNQL1o= github.com/google/go-containerregistry v0.0.0-20191218175032-34fb8ff33bed h1:0AwV9UBwwKPKrfpTYLOKr8ymevanUxrsSEkAo0uU9aA= @@ -735,6 +736,7 @@ golang.org/x/tools v0.0.0-20191213032237-7093a17b0467/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= diff --git a/pkg/skaffold/deploy/helm.go b/pkg/skaffold/deploy/helm.go index 728989b5037..e1ed9c8d52d 100644 --- a/pkg/skaffold/deploy/helm.go +++ b/pkg/skaffold/deploy/helm.go @@ -217,34 +217,20 @@ func (h *HelmDeployer) deployRelease(ctx context.Context, out io.Writer, r lates if !isInstalled { args = append(args, "install", "--name", releaseName) args = append(args, h.Flags.Install...) + } else if r.UpgradeOnChange != nil && !*r.UpgradeOnChange { + logrus.Infof("Release %s already installed...", releaseName) + return []Artifact{}, nil + } else if r.UpgradeOnChange == nil && r.Remote { + logrus.Infof("Release %s not upgraded as it is remote...", releaseName) + return []Artifact{}, nil } else { - - var shouldUpgrade bool - if r.UpgradeOnChange != nil { - shouldUpgrade = *r.UpgradeOnChange - - if !shouldUpgrade { - logrus.Infof("Release %s already installed...\n", releaseName) - } - } else { - shouldUpgrade = !r.Remote - - if !shouldUpgrade { - logrus.Infof("Release %s not upgraded since remote (see `upgradeOnChange`)...\n", releaseName) - } + args = append(args, "upgrade", releaseName) + args = append(args, h.Flags.Upgrade...) + if h.forceDeploy { + args = append(args, "--force") } - - if shouldUpgrade { - args = append(args, "upgrade", releaseName) - args = append(args, h.Flags.Upgrade...) - if h.forceDeploy { - args = append(args, "--force") - } - if r.RecreatePods { - args = append(args, "--recreate-pods") - } - } else { - return []Artifact{}, nil + if r.RecreatePods { + args = append(args, "--recreate-pods") } } diff --git a/pkg/skaffold/deploy/helm_test.go b/pkg/skaffold/deploy/helm_test.go index 285ac1f085c..f3b07d28161 100644 --- a/pkg/skaffold/deploy/helm_test.go +++ b/pkg/skaffold/deploy/helm_test.go @@ -385,7 +385,6 @@ func TestHelmDeploy(t *testing.T) { upgradeResult: fmt.Errorf("should not have called upgrade"), }, runContext: makeRunContext(testDeployUpgradeOnChange, false), - builds: testBuilds, }, { description: "deploy error remote chart without skipBuildDependencies", diff --git a/pkg/skaffold/schema/latest/config.go b/pkg/skaffold/schema/latest/config.go index ea46fbc1ab9..e4584d62e0b 100644 --- a/pkg/skaffold/schema/latest/config.go +++ b/pkg/skaffold/schema/latest/config.go @@ -504,17 +504,18 @@ type HelmRelease struct { RecreatePods bool `yaml:"recreatePods,omitempty"` // SkipBuildDependencies should build dependencies be skipped. + // Ignored when `remote: true`. SkipBuildDependencies bool `yaml:"skipBuildDependencies,omitempty"` // UseHelmSecrets instructs skaffold to use secrets plugin on deployment. UseHelmSecrets bool `yaml:"useHelmSecrets,omitempty"` // Remote specifies whether the chart path is remote, or exists on the host filesystem. - // `remote: true` implies `skipBuildDependencies: true` and `upgradeOnChange: false`. - // `remote: false` implies `upgradeOnChange: true`. Remote bool `yaml:"remote,omitempty"` // UpgradeOnChange specifies whether to upgrade helm chart on code changes. + // Default is `true` when helm chart is local (`remote: false`). + // Default is `false` if `remote: true`. UpgradeOnChange *bool `yaml:"upgradeOnChange,omitempty"` // Overrides are key-value pairs. diff --git a/pkg/skaffold/schema/v2alpha3/upgrade_test.go b/pkg/skaffold/schema/v2alpha3/upgrade_test.go index cd1bc2697ce..d9d9ea727ad 100755 --- a/pkg/skaffold/schema/v2alpha3/upgrade_test.go +++ b/pkg/skaffold/schema/v2alpha3/upgrade_test.go @@ -54,12 +54,8 @@ deploy: manifests: - k8s-* kustomize: -<<<<<<< HEAD - path: kustomization-main -======= paths: - kustomization-main ->>>>>>> master profiles: - name: test profile build: From 177d3765a78a8364b606450fa3230f2877f38834 Mon Sep 17 00:00:00 2001 From: David Hovey Date: Thu, 20 Feb 2020 09:26:41 -0700 Subject: [PATCH 07/11] Fixed linting error (ifelse to switch) --- pkg/skaffold/deploy/helm.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/skaffold/deploy/helm.go b/pkg/skaffold/deploy/helm.go index e1ed9c8d52d..8e6fa48d523 100644 --- a/pkg/skaffold/deploy/helm.go +++ b/pkg/skaffold/deploy/helm.go @@ -214,16 +214,18 @@ func (h *HelmDeployer) deployRelease(ctx context.Context, out io.Writer, r lates } var args []string - if !isInstalled { + + switch { + case !isInstalled: args = append(args, "install", "--name", releaseName) args = append(args, h.Flags.Install...) - } else if r.UpgradeOnChange != nil && !*r.UpgradeOnChange { + case r.UpgradeOnChange != nil && !*r.UpgradeOnChange: logrus.Infof("Release %s already installed...", releaseName) return []Artifact{}, nil - } else if r.UpgradeOnChange == nil && r.Remote { + case r.UpgradeOnChange == nil && r.Remote: logrus.Infof("Release %s not upgraded as it is remote...", releaseName) return []Artifact{}, nil - } else { + default: args = append(args, "upgrade", releaseName) args = append(args, h.Flags.Upgrade...) if h.forceDeploy { From 6ff6b6e64de2251565bff6d1c950ccda3c291a6d Mon Sep 17 00:00:00 2001 From: David Hovey Date: Fri, 8 May 2020 12:27:42 -0700 Subject: [PATCH 08/11] Fix for helm_test not building --- docs/content/en/schemas/v2alpha4.json | 14 ++++---------- docs/content/en/schemas/v2beta3.json | 14 ++++++++++---- pkg/skaffold/deploy/helm_test.go | 7 +++---- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/docs/content/en/schemas/v2alpha4.json b/docs/content/en/schemas/v2alpha4.json index 8de71420653..da70414dd3e 100755 --- a/docs/content/en/schemas/v2alpha4.json +++ b/docs/content/en/schemas/v2alpha4.json @@ -1214,8 +1214,8 @@ }, "remote": { "type": "boolean", - "description": "specifies whether the chart path is remote, or exists on the host filesystem.", - "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem.", + "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true`.", + "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true.", "default": "false" }, "setFiles": { @@ -1247,15 +1247,10 @@ }, "skipBuildDependencies": { "type": "boolean", - "description": "should build dependencies be skipped. Ignored when `remote: true`.", - "x-intellij-html-description": "should build dependencies be skipped. Ignored when remote: true.", + "description": "should build dependencies be skipped.", + "x-intellij-html-description": "should build dependencies be skipped.", "default": "false" }, - "upgradeOnChange": { - "type": "boolean", - "description": "specifies whether to upgrade helm chart on code changes. Default is `true` when helm chart is local (`remote: false`). Default is `false` if `remote: true`.", - "x-intellij-html-description": "specifies whether to upgrade helm chart on code changes. Default is true when helm chart is local (remote: false). Default is false if remote: true." - }, "useHelmSecrets": { "type": "boolean", "description": "instructs skaffold to use secrets plugin on deployment.", @@ -1307,7 +1302,6 @@ "skipBuildDependencies", "useHelmSecrets", "remote", - "upgradeOnChange", "overrides", "packaged", "imageStrategy" diff --git a/docs/content/en/schemas/v2beta3.json b/docs/content/en/schemas/v2beta3.json index de13d941b66..c80a6e17191 100755 --- a/docs/content/en/schemas/v2beta3.json +++ b/docs/content/en/schemas/v2beta3.json @@ -1241,8 +1241,8 @@ }, "remote": { "type": "boolean", - "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true`.", - "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true.", + "description": "specifies whether the chart path is remote, or exists on the host filesystem.", + "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem.", "default": "false" }, "setFiles": { @@ -1274,10 +1274,15 @@ }, "skipBuildDependencies": { "type": "boolean", - "description": "should build dependencies be skipped.", - "x-intellij-html-description": "should build dependencies be skipped.", + "description": "should build dependencies be skipped. Ignored when `remote: true`.", + "x-intellij-html-description": "should build dependencies be skipped. Ignored when remote: true.", "default": "false" }, + "upgradeOnChange": { + "type": "boolean", + "description": "specifies whether to upgrade helm chart on code changes. Default is `true` when helm chart is local (`remote: false`). Default is `false` if `remote: true`.", + "x-intellij-html-description": "specifies whether to upgrade helm chart on code changes. Default is true when helm chart is local (remote: false). Default is false if remote: true." + }, "useHelmSecrets": { "type": "boolean", "description": "instructs skaffold to use secrets plugin on deployment.", @@ -1329,6 +1334,7 @@ "skipBuildDependencies", "useHelmSecrets", "remote", + "upgradeOnChange", "overrides", "packaged", "imageStrategy" diff --git a/pkg/skaffold/deploy/helm_test.go b/pkg/skaffold/deploy/helm_test.go index 336a75e0959..b2c4b37c68a 100644 --- a/pkg/skaffold/deploy/helm_test.go +++ b/pkg/skaffold/deploy/helm_test.go @@ -518,10 +518,9 @@ func TestHelmDeploy(t *testing.T) { }, { description: "deploy success when `upgradeOnChange: false` and does not upgrade", - commands: &MockHelm{ - installResult: fmt.Errorf("should not have called install"), - upgradeResult: fmt.Errorf("should not have called upgrade"), - }, + commands: testutil. + CmdRunWithOutput("helm version", version21). + AndRun("helm --kube-context kubecontext get skaffold-helm-upgradeOnChange --kubeconfig kubeconfig"), runContext: makeRunContext(testDeployUpgradeOnChange, false), }, { From d43417a8588f9c52cf717199deb05ae72757d941 Mon Sep 17 00:00:00 2001 From: David Hovey Date: Fri, 8 May 2020 13:58:13 -0700 Subject: [PATCH 09/11] bumped schema version to v2beta4 --- docs/config.toml | 2 +- docs/content/en/docs/references/cli/_index.md | 2 +- docs/content/en/schemas/v2beta3.json | 14 +- docs/content/en/schemas/v2beta4.json | 2107 +++++++++++++++++ integration/examples/bazel/skaffold.yaml | 2 +- .../examples/buildpacks-node/skaffold.yaml | 2 +- integration/examples/buildpacks/skaffold.yaml | 2 +- integration/examples/custom/skaffold.yaml | 2 +- integration/examples/gcb-kaniko/skaffold.yaml | 2 +- .../examples/generate-pipeline/skaffold.yaml | 2 +- .../getting-started-kustomize/skaffold.yaml | 2 +- .../examples/getting-started/skaffold.yaml | 2 +- .../examples/google-cloud-build/skaffold.yaml | 2 +- .../skaffold.yaml | 2 +- .../examples/helm-deployment/skaffold.yaml | 2 +- integration/examples/hot-reload/skaffold.yaml | 2 +- integration/examples/jib-gradle/skaffold.yaml | 2 +- .../examples/jib-multimodule/skaffold.yaml | 2 +- integration/examples/jib/skaffold.yaml | 2 +- integration/examples/kaniko/skaffold.yaml | 2 +- integration/examples/kustomize/skaffold.yaml | 2 +- .../examples/microservices/skaffold.yaml | 2 +- integration/examples/nodejs/skaffold.yaml | 2 +- .../examples/profile-patches/skaffold.yaml | 2 +- integration/examples/profiles/skaffold.yaml | 2 +- .../examples/react-reload/skaffold.yaml | 2 +- integration/examples/ruby/skaffold.yaml | 2 +- .../examples/structure-tests/skaffold.yaml | 2 +- .../skaffold.yaml | 2 +- integration/testdata/build/skaffold.yaml | 2 +- integration/testdata/debug/skaffold.yaml | 2 +- .../testdata/deploy-multiple/skaffold.yaml | 2 +- integration/testdata/dev/skaffold.yaml | 2 +- .../testdata/gke_loadbalancer/skaffold.yaml | 2 +- integration/testdata/hello/skaffold.yaml | 2 +- .../testdata/init/compose/skaffold.yaml | 2 +- integration/testdata/jib-sync/skaffold.yaml | 2 +- integration/testdata/jib/skaffold.yaml | 2 +- .../kaniko-explicit-repo/skaffold.yaml | 2 +- .../app/skaffold.yaml | 2 +- .../kaniko-insecure-registry/skaffold.yaml | 2 +- .../kaniko-microservices/skaffold.yaml | 2 +- .../testdata/kaniko-sub-folder/skaffold.yaml | 2 +- .../testdata/kaniko-target/skaffold.yaml | 2 +- integration/testdata/tagPolicy/skaffold.yaml | 2 +- .../testdata/init/allcli/skaffold.yaml | 2 +- .../getting-started-kustomize/skaffold.yaml | 2 +- .../init/hello-no-manifest/skaffold.yaml | 2 +- .../testdata/init/hello/skaffold.yaml | 2 +- .../testdata/init/ignore-tags/skaffold.yaml | 2 +- .../testdata/init/microservices/skaffold.yaml | 2 +- pkg/skaffold/schema/latest/config.go | 4 +- pkg/skaffold/schema/v2beta2/upgrade.go | 2 +- pkg/skaffold/schema/v2beta2/upgrade_test.go | 2 +- pkg/skaffold/schema/v2beta3/config.go | 901 +++++++ pkg/skaffold/schema/v2beta3/upgrade.go | 41 + pkg/skaffold/schema/v2beta3/upgrade_test.go | 174 ++ pkg/skaffold/schema/versions.go | 2 + 58 files changed, 3282 insertions(+), 63 deletions(-) create mode 100755 docs/content/en/schemas/v2beta4.json create mode 100755 pkg/skaffold/schema/v2beta3/config.go create mode 100755 pkg/skaffold/schema/v2beta3/upgrade.go create mode 100755 pkg/skaffold/schema/v2beta3/upgrade_test.go diff --git a/docs/config.toml b/docs/config.toml index 3e2662c34dd..0e23914957a 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -82,7 +82,7 @@ weight = 1 copyright = "Skaffold Authors" privacy_policy = "https://policies.google.com/privacy" github_repo = "https://github.com/GoogleContainerTools/skaffold" -skaffold_version = "skaffold/v2beta3" +skaffold_version = "skaffold/v2beta4" # Google Custom Search Engine ID. Remove or comment out to disable search. gcs_engine_id = "013756393218025596041:3nojel67sum" diff --git a/docs/content/en/docs/references/cli/_index.md b/docs/content/en/docs/references/cli/_index.md index 36f123b496c..406a04f83e5 100644 --- a/docs/content/en/docs/references/cli/_index.md +++ b/docs/content/en/docs/references/cli/_index.md @@ -626,7 +626,7 @@ Examples: Options: -f, --filename='skaffold.yaml': Path or URL to the Skaffold config file --overwrite=false: Overwrite original config with fixed config - --version='skaffold/v2beta3': Target schema version to upgrade to + --version='skaffold/v2beta4': Target schema version to upgrade to Usage: skaffold fix [options] diff --git a/docs/content/en/schemas/v2beta3.json b/docs/content/en/schemas/v2beta3.json index c80a6e17191..de13d941b66 100755 --- a/docs/content/en/schemas/v2beta3.json +++ b/docs/content/en/schemas/v2beta3.json @@ -1241,8 +1241,8 @@ }, "remote": { "type": "boolean", - "description": "specifies whether the chart path is remote, or exists on the host filesystem.", - "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem.", + "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true`.", + "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true.", "default": "false" }, "setFiles": { @@ -1274,15 +1274,10 @@ }, "skipBuildDependencies": { "type": "boolean", - "description": "should build dependencies be skipped. Ignored when `remote: true`.", - "x-intellij-html-description": "should build dependencies be skipped. Ignored when remote: true.", + "description": "should build dependencies be skipped.", + "x-intellij-html-description": "should build dependencies be skipped.", "default": "false" }, - "upgradeOnChange": { - "type": "boolean", - "description": "specifies whether to upgrade helm chart on code changes. Default is `true` when helm chart is local (`remote: false`). Default is `false` if `remote: true`.", - "x-intellij-html-description": "specifies whether to upgrade helm chart on code changes. Default is true when helm chart is local (remote: false). Default is false if remote: true." - }, "useHelmSecrets": { "type": "boolean", "description": "instructs skaffold to use secrets plugin on deployment.", @@ -1334,7 +1329,6 @@ "skipBuildDependencies", "useHelmSecrets", "remote", - "upgradeOnChange", "overrides", "packaged", "imageStrategy" diff --git a/docs/content/en/schemas/v2beta4.json b/docs/content/en/schemas/v2beta4.json new file mode 100755 index 00000000000..c80a6e17191 --- /dev/null +++ b/docs/content/en/schemas/v2beta4.json @@ -0,0 +1,2107 @@ +{ + "type": "object", + "anyOf": [ + { + "$ref": "#/definitions/SkaffoldConfig" + } + ], + "$schema": "http://json-schema-org/draft-07/schema#", + "definitions": { + "Activation": { + "properties": { + "command": { + "type": "string", + "description": "a Skaffold command for which the profile is auto-activated.", + "x-intellij-html-description": "a Skaffold command for which the profile is auto-activated.", + "examples": [ + "dev" + ] + }, + "env": { + "type": "string", + "description": "a `key=pattern` pair. The profile is auto-activated if an Environment Variable `key` matches the pattern. If the pattern starts with `!`, activation happens if the remaining pattern is _not_ matched. The pattern matches if the Environment Variable value is exactly `pattern`, or the regex `pattern` is found in it. An empty `pattern` (e.g. `env: \"key=\"`) always only matches if the Environment Variable is undefined or empty.", + "x-intellij-html-description": "a key=pattern pair. The profile is auto-activated if an Environment Variable key matches the pattern. If the pattern starts with !, activation happens if the remaining pattern is not matched. The pattern matches if the Environment Variable value is exactly pattern, or the regex pattern is found in it. An empty pattern (e.g. env: "key=") always only matches if the Environment Variable is undefined or empty.", + "examples": [ + "ENV=production" + ] + }, + "kubeContext": { + "type": "string", + "description": "a Kubernetes context for which the profile is auto-activated.", + "x-intellij-html-description": "a Kubernetes context for which the profile is auto-activated.", + "examples": [ + "minikube" + ] + } + }, + "preferredOrder": [ + "env", + "kubeContext", + "command" + ], + "additionalProperties": false, + "description": "criteria by which a profile is auto-activated.", + "x-intellij-html-description": "criteria by which a profile is auto-activated." + }, + "Artifact": { + "required": [ + "image" + ], + "anyOf": [ + { + "properties": { + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync" + ], + "additionalProperties": false + }, + { + "properties": { + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "docker": { + "$ref": "#/definitions/DockerArtifact", + "description": "*beta* describes an artifact built from a Dockerfile.", + "x-intellij-html-description": "beta describes an artifact built from a Dockerfile." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "docker" + ], + "additionalProperties": false + }, + { + "properties": { + "bazel": { + "$ref": "#/definitions/BazelArtifact", + "description": "*beta* requires bazel CLI to be installed and the sources to contain [Bazel](https://bazel.build/) configuration files.", + "x-intellij-html-description": "beta requires bazel CLI to be installed and the sources to contain Bazel configuration files." + }, + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "bazel" + ], + "additionalProperties": false + }, + { + "properties": { + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "jib": { + "$ref": "#/definitions/JibArtifact", + "description": "builds images using the [Jib plugins for Maven or Gradle](https://github.com/GoogleContainerTools/jib/).", + "x-intellij-html-description": "builds images using the Jib plugins for Maven or Gradle." + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "jib" + ], + "additionalProperties": false + }, + { + "properties": { + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "kaniko": { + "$ref": "#/definitions/KanikoArtifact", + "description": "builds images using [kaniko](https://github.com/GoogleContainerTools/kaniko).", + "x-intellij-html-description": "builds images using kaniko." + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "kaniko" + ], + "additionalProperties": false + }, + { + "properties": { + "buildpack": { + "$ref": "#/definitions/BuildpackArtifact", + "description": "builds images using [Cloud Native Buildpacks](https://buildpacks.io/).", + "x-intellij-html-description": "builds images using Cloud Native Buildpacks." + }, + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "buildpack" + ], + "additionalProperties": false + }, + { + "properties": { + "context": { + "type": "string", + "description": "directory containing the artifact's sources.", + "x-intellij-html-description": "directory containing the artifact's sources.", + "default": "." + }, + "custom": { + "$ref": "#/definitions/CustomArtifact", + "description": "*beta* builds images using a custom build script written by the user.", + "x-intellij-html-description": "beta builds images using a custom build script written by the user." + }, + "image": { + "type": "string", + "description": "name of the image to be built.", + "x-intellij-html-description": "name of the image to be built.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "sync": { + "$ref": "#/definitions/Sync", + "description": "*beta* local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta local files synced to pods instead of triggering an image build when modified. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + } + }, + "preferredOrder": [ + "image", + "context", + "sync", + "custom" + ], + "additionalProperties": false + } + ], + "description": "items that need to be built, along with the context in which they should be built.", + "x-intellij-html-description": "items that need to be built, along with the context in which they should be built." + }, + "Auto": { + "description": "cannot be customized.", + "x-intellij-html-description": "cannot be customized." + }, + "BazelArtifact": { + "required": [ + "target" + ], + "properties": { + "args": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional args to pass to `bazel build`.", + "x-intellij-html-description": "additional args to pass to bazel build.", + "default": "[]", + "examples": [ + "[\"-flag\", \"--otherflag\"]" + ] + }, + "target": { + "type": "string", + "description": "`bazel build` target to run.", + "x-intellij-html-description": "bazel build target to run.", + "examples": [ + "//:skaffold_example.tar" + ] + } + }, + "preferredOrder": [ + "target", + "args" + ], + "additionalProperties": false, + "description": "describes an artifact built with [Bazel](https://bazel.build/).", + "x-intellij-html-description": "describes an artifact built with Bazel." + }, + "BuildConfig": { + "anyOf": [ + { + "properties": { + "artifacts": { + "items": { + "$ref": "#/definitions/Artifact" + }, + "type": "array", + "description": "the images you're going to be building.", + "x-intellij-html-description": "the images you're going to be building." + }, + "insecureRegistries": { + "items": { + "type": "string" + }, + "type": "array", + "description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "x-intellij-html-description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "default": "[]" + }, + "tagPolicy": { + "$ref": "#/definitions/TagPolicy", + "description": "*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.", + "x-intellij-html-description": "beta determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to gitCommit: {variant: Tags}." + } + }, + "preferredOrder": [ + "artifacts", + "insecureRegistries", + "tagPolicy" + ], + "additionalProperties": false + }, + { + "properties": { + "artifacts": { + "items": { + "$ref": "#/definitions/Artifact" + }, + "type": "array", + "description": "the images you're going to be building.", + "x-intellij-html-description": "the images you're going to be building." + }, + "insecureRegistries": { + "items": { + "type": "string" + }, + "type": "array", + "description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "x-intellij-html-description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "default": "[]" + }, + "local": { + "$ref": "#/definitions/LocalBuild", + "description": "*beta* describes how to do a build on the local docker daemon and optionally push to a repository.", + "x-intellij-html-description": "beta describes how to do a build on the local docker daemon and optionally push to a repository." + }, + "tagPolicy": { + "$ref": "#/definitions/TagPolicy", + "description": "*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.", + "x-intellij-html-description": "beta determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to gitCommit: {variant: Tags}." + } + }, + "preferredOrder": [ + "artifacts", + "insecureRegistries", + "tagPolicy", + "local" + ], + "additionalProperties": false + }, + { + "properties": { + "artifacts": { + "items": { + "$ref": "#/definitions/Artifact" + }, + "type": "array", + "description": "the images you're going to be building.", + "x-intellij-html-description": "the images you're going to be building." + }, + "googleCloudBuild": { + "$ref": "#/definitions/GoogleCloudBuild", + "description": "*beta* describes how to do a remote build on [Google Cloud Build](https://cloud.google.com/cloud-build/).", + "x-intellij-html-description": "beta describes how to do a remote build on Google Cloud Build." + }, + "insecureRegistries": { + "items": { + "type": "string" + }, + "type": "array", + "description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "x-intellij-html-description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "default": "[]" + }, + "tagPolicy": { + "$ref": "#/definitions/TagPolicy", + "description": "*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.", + "x-intellij-html-description": "beta determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to gitCommit: {variant: Tags}." + } + }, + "preferredOrder": [ + "artifacts", + "insecureRegistries", + "tagPolicy", + "googleCloudBuild" + ], + "additionalProperties": false + }, + { + "properties": { + "artifacts": { + "items": { + "$ref": "#/definitions/Artifact" + }, + "type": "array", + "description": "the images you're going to be building.", + "x-intellij-html-description": "the images you're going to be building." + }, + "cluster": { + "$ref": "#/definitions/ClusterDetails", + "description": "*beta* describes how to do an on-cluster build.", + "x-intellij-html-description": "beta describes how to do an on-cluster build." + }, + "insecureRegistries": { + "items": { + "type": "string" + }, + "type": "array", + "description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "x-intellij-html-description": "a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.", + "default": "[]" + }, + "tagPolicy": { + "$ref": "#/definitions/TagPolicy", + "description": "*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.", + "x-intellij-html-description": "beta determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to gitCommit: {variant: Tags}." + } + }, + "preferredOrder": [ + "artifacts", + "insecureRegistries", + "tagPolicy", + "cluster" + ], + "additionalProperties": false + } + ], + "description": "contains all the configuration for the build steps.", + "x-intellij-html-description": "contains all the configuration for the build steps." + }, + "BuildpackArtifact": { + "required": [ + "builder" + ], + "properties": { + "builder": { + "type": "string", + "description": "builder image used.", + "x-intellij-html-description": "builder image used." + }, + "buildpacks": { + "items": { + "type": "string" + }, + "type": "array", + "description": "a list of strings, where each string is a specific buildpack to use with the builder. If you specify buildpacks the builder image automatic detection will be ignored. These buildpacks will be used to build the Image from your source code. Order matters.", + "x-intellij-html-description": "a list of strings, where each string is a specific buildpack to use with the builder. If you specify buildpacks the builder image automatic detection will be ignored. These buildpacks will be used to build the Image from your source code. Order matters.", + "default": "[]" + }, + "dependencies": { + "$ref": "#/definitions/BuildpackDependencies", + "description": "file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact.", + "x-intellij-html-description": "file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact." + }, + "env": { + "items": { + "type": "string" + }, + "type": "array", + "description": "environment variables, in the `key=value` form, passed to the build. Values can use the go template syntax.", + "x-intellij-html-description": "environment variables, in the key=value form, passed to the build. Values can use the go template syntax.", + "default": "[]", + "examples": [ + "[\"key1=value1\", \"key2=value2\", \"key3={{.ENV_VARIABLE}}\"]" + ] + }, + "runImage": { + "type": "string", + "description": "overrides the stack's default run image.", + "x-intellij-html-description": "overrides the stack's default run image." + } + }, + "preferredOrder": [ + "builder", + "runImage", + "env", + "buildpacks", + "dependencies" + ], + "additionalProperties": false, + "description": "*alpha* describes an artifact built using [Cloud Native Buildpacks](https://buildpacks.io/). It can be used to build images out of project's sources without any additional configuration.", + "x-intellij-html-description": "alpha describes an artifact built using Cloud Native Buildpacks. It can be used to build images out of project's sources without any additional configuration." + }, + "BuildpackDependencies": { + "properties": { + "ignore": { + "items": { + "type": "string" + }, + "type": "array", + "description": "specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both `paths` and in `ignore`, it will be ignored, and will be excluded from both rebuilds and file synchronization. Will only work in conjunction with `paths`.", + "x-intellij-html-description": "specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both paths and in ignore, it will be ignored, and will be excluded from both rebuilds and file synchronization. Will only work in conjunction with paths.", + "default": "[]" + }, + "paths": { + "items": { + "type": "string" + }, + "type": "array", + "description": "should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization.", + "x-intellij-html-description": "should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization.", + "default": "[]" + } + }, + "preferredOrder": [ + "paths", + "ignore" + ], + "additionalProperties": false, + "description": "*alpha* used to specify dependencies for an artifact built by a buildpack.", + "x-intellij-html-description": "alpha used to specify dependencies for an artifact built by a buildpack." + }, + "ClusterDetails": { + "properties": { + "HTTPS_PROXY": { + "type": "string", + "description": "for kaniko pod.", + "x-intellij-html-description": "for kaniko pod." + }, + "HTTP_PROXY": { + "type": "string", + "description": "for kaniko pod.", + "x-intellij-html-description": "for kaniko pod." + }, + "concurrency": { + "type": "integer", + "description": "how many artifacts can be built concurrently. 0 means \"no-limit\".", + "x-intellij-html-description": "how many artifacts can be built concurrently. 0 means "no-limit".", + "default": "0" + }, + "dockerConfig": { + "$ref": "#/definitions/DockerConfig", + "description": "describes how to mount the local Docker configuration into a pod.", + "x-intellij-html-description": "describes how to mount the local Docker configuration into a pod." + }, + "namespace": { + "type": "string", + "description": "Kubernetes namespace. Defaults to current namespace in Kubernetes configuration.", + "x-intellij-html-description": "Kubernetes namespace. Defaults to current namespace in Kubernetes configuration." + }, + "pullSecret": { + "type": "string", + "description": "path to the Google Cloud service account secret key file.", + "x-intellij-html-description": "path to the Google Cloud service account secret key file." + }, + "pullSecretMountPath": { + "type": "string", + "description": "path the pull secret will be mounted at within the running container.", + "x-intellij-html-description": "path the pull secret will be mounted at within the running container." + }, + "pullSecretName": { + "type": "string", + "description": "name of the Kubernetes secret for pulling base images and pushing the final image. If given, the secret needs to contain the Google Cloud service account secret key under the key `kaniko-secret`.", + "x-intellij-html-description": "name of the Kubernetes secret for pulling base images and pushing the final image. If given, the secret needs to contain the Google Cloud service account secret key under the key kaniko-secret.", + "default": "kaniko-secret" + }, + "randomDockerConfigSecret": { + "type": "boolean", + "description": "adds a random UUID postfix to the default name of the docker secret to facilitate parallel builds, e.g. docker-cfgfd154022-c761-416f-8eb3-cf8258450b85.", + "x-intellij-html-description": "adds a random UUID postfix to the default name of the docker secret to facilitate parallel builds, e.g. docker-cfgfd154022-c761-416f-8eb3-cf8258450b85.", + "default": "false" + }, + "randomPullSecret": { + "type": "boolean", + "description": "adds a random UUID postfix to the default name of the pull secret to facilitate parallel builds, e.g. kaniko-secretdocker-cfgfd154022-c761-416f-8eb3-cf8258450b85.", + "x-intellij-html-description": "adds a random UUID postfix to the default name of the pull secret to facilitate parallel builds, e.g. kaniko-secretdocker-cfgfd154022-c761-416f-8eb3-cf8258450b85.", + "default": "false" + }, + "resources": { + "$ref": "#/definitions/ResourceRequirements", + "description": "define the resource requirements for the kaniko pod.", + "x-intellij-html-description": "define the resource requirements for the kaniko pod." + }, + "runAsUser": { + "type": "integer", + "description": "defines the UID to request for running the container. If omitted, no SeurityContext will be specified for the pod and will therefore be inherited from the service account.", + "x-intellij-html-description": "defines the UID to request for running the container. If omitted, no SeurityContext will be specified for the pod and will therefore be inherited from the service account." + }, + "serviceAccount": { + "type": "string", + "description": "describes the Kubernetes service account to use for the pod. Defaults to 'default'.", + "x-intellij-html-description": "describes the Kubernetes service account to use for the pod. Defaults to 'default'." + }, + "timeout": { + "type": "string", + "description": "amount of time (in seconds) that this build is allowed to run. Defaults to 20 minutes (`20m`).", + "x-intellij-html-description": "amount of time (in seconds) that this build is allowed to run. Defaults to 20 minutes (20m)." + }, + "volumes": { + "items": {}, + "type": "array", + "description": "defines container mounts for ConfigMap and Secret resources.", + "x-intellij-html-description": "defines container mounts for ConfigMap and Secret resources.", + "default": "[]" + } + }, + "preferredOrder": [ + "HTTP_PROXY", + "HTTPS_PROXY", + "pullSecret", + "pullSecretName", + "pullSecretMountPath", + "namespace", + "timeout", + "dockerConfig", + "serviceAccount", + "runAsUser", + "resources", + "concurrency", + "volumes", + "randomPullSecret", + "randomDockerConfigSecret" + ], + "additionalProperties": false, + "description": "*beta* describes how to do an on-cluster build.", + "x-intellij-html-description": "beta describes how to do an on-cluster build." + }, + "CustomArtifact": { + "properties": { + "buildCommand": { + "type": "string", + "description": "command executed to build the image.", + "x-intellij-html-description": "command executed to build the image." + }, + "dependencies": { + "$ref": "#/definitions/CustomDependencies", + "description": "file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact.", + "x-intellij-html-description": "file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact." + } + }, + "preferredOrder": [ + "buildCommand", + "dependencies" + ], + "additionalProperties": false, + "description": "*beta* describes an artifact built from a custom build script written by the user. It can be used to build images with builders that aren't directly integrated with skaffold.", + "x-intellij-html-description": "beta describes an artifact built from a custom build script written by the user. It can be used to build images with builders that aren't directly integrated with skaffold." + }, + "CustomDependencies": { + "properties": { + "command": { + "type": "string", + "description": "represents a custom command that skaffold executes to obtain dependencies. The output of this command *must* be a valid JSON array.", + "x-intellij-html-description": "represents a custom command that skaffold executes to obtain dependencies. The output of this command must be a valid JSON array." + }, + "dockerfile": { + "$ref": "#/definitions/DockerfileDependency", + "description": "should be set if the artifact is built from a Dockerfile, from which skaffold can determine dependencies.", + "x-intellij-html-description": "should be set if the artifact is built from a Dockerfile, from which skaffold can determine dependencies." + }, + "ignore": { + "items": { + "type": "string" + }, + "type": "array", + "description": "specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both `paths` and in `ignore`, it will be ignored, and will be excluded from both rebuilds and file synchronization. Will only work in conjunction with `paths`.", + "x-intellij-html-description": "specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both paths and in ignore, it will be ignored, and will be excluded from both rebuilds and file synchronization. Will only work in conjunction with paths.", + "default": "[]" + }, + "paths": { + "items": { + "type": "string" + }, + "type": "array", + "description": "should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization.", + "x-intellij-html-description": "should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization.", + "default": "[]" + } + }, + "preferredOrder": [ + "dockerfile", + "command", + "paths", + "ignore" + ], + "additionalProperties": false, + "description": "*beta* used to specify dependencies for an artifact built by a custom build script. Either `dockerfile` or `paths` should be specified for file watching to work as expected.", + "x-intellij-html-description": "beta used to specify dependencies for an artifact built by a custom build script. Either dockerfile or paths should be specified for file watching to work as expected." + }, + "DateTimeTagger": { + "properties": { + "format": { + "type": "string", + "description": "formats the date and time. See [#Time.Format](https://golang.org/pkg/time/#Time.Format).", + "x-intellij-html-description": "formats the date and time. See #Time.Format.", + "default": "2006-01-02_15-04-05.999_MST" + }, + "timezone": { + "type": "string", + "description": "sets the timezone for the date and time. See [Time.LoadLocation](https://golang.org/pkg/time/#Time.LoadLocation). Defaults to the local timezone.", + "x-intellij-html-description": "sets the timezone for the date and time. See Time.LoadLocation. Defaults to the local timezone." + } + }, + "preferredOrder": [ + "format", + "timezone" + ], + "additionalProperties": false, + "description": "*beta* tags images with the build timestamp.", + "x-intellij-html-description": "beta tags images with the build timestamp." + }, + "DeployConfig": { + "properties": { + "helm": { + "$ref": "#/definitions/HelmDeploy", + "description": "*beta* uses the `helm` CLI to apply the charts to the cluster.", + "x-intellij-html-description": "beta uses the helm CLI to apply the charts to the cluster." + }, + "kubeContext": { + "type": "string", + "description": "Kubernetes context that Skaffold should deploy to.", + "x-intellij-html-description": "Kubernetes context that Skaffold should deploy to.", + "examples": [ + "minikube" + ] + }, + "kubectl": { + "$ref": "#/definitions/KubectlDeploy", + "description": "*beta* uses a client side `kubectl apply` to deploy manifests. You'll need a `kubectl` CLI version installed that's compatible with your cluster.", + "x-intellij-html-description": "beta uses a client side kubectl apply to deploy manifests. You'll need a kubectl CLI version installed that's compatible with your cluster." + }, + "kustomize": { + "$ref": "#/definitions/KustomizeDeploy", + "description": "*beta* uses the `kustomize` CLI to \"patch\" a deployment for a target environment.", + "x-intellij-html-description": "beta uses the kustomize CLI to "patch" a deployment for a target environment." + }, + "statusCheckDeadlineSeconds": { + "type": "integer", + "description": "*beta* deadline for deployments to stabilize in seconds.", + "x-intellij-html-description": "beta deadline for deployments to stabilize in seconds." + } + }, + "preferredOrder": [ + "helm", + "kubectl", + "kustomize", + "statusCheckDeadlineSeconds", + "kubeContext" + ], + "additionalProperties": false, + "description": "contains all the configuration needed by the deploy steps.", + "x-intellij-html-description": "contains all the configuration needed by the deploy steps." + }, + "DockerArtifact": { + "properties": { + "buildArgs": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "arguments passed to the docker build.", + "x-intellij-html-description": "arguments passed to the docker build.", + "default": "{}", + "examples": [ + "{\"key1\": \"value1\", \"key2\": \"value2\"}" + ] + }, + "cacheFrom": { + "items": { + "type": "string" + }, + "type": "array", + "description": "the Docker images used as cache sources.", + "x-intellij-html-description": "the Docker images used as cache sources.", + "default": "[]", + "examples": [ + "[\"golang:1.10.1-alpine3.7\", \"alpine:3.7\"]" + ] + }, + "dockerfile": { + "type": "string", + "description": "locates the Dockerfile relative to workspace.", + "x-intellij-html-description": "locates the Dockerfile relative to workspace.", + "default": "Dockerfile" + }, + "network": { + "type": "string", + "description": "passed through to docker and overrides the network configuration of docker builder. If unset, use whatever is configured in the underlying docker daemon. Valid modes are `host`: use the host's networking stack. `bridge`: use the bridged network configuration. `none`: no networking in the container.", + "x-intellij-html-description": "passed through to docker and overrides the network configuration of docker builder. If unset, use whatever is configured in the underlying docker daemon. Valid modes are host: use the host's networking stack. bridge: use the bridged network configuration. none: no networking in the container.", + "enum": [ + "host", + "bridge", + "none" + ] + }, + "noCache": { + "type": "boolean", + "description": "used to pass in --no-cache to docker build to prevent caching.", + "x-intellij-html-description": "used to pass in --no-cache to docker build to prevent caching.", + "default": "false" + }, + "target": { + "type": "string", + "description": "Dockerfile target name to build.", + "x-intellij-html-description": "Dockerfile target name to build." + } + }, + "preferredOrder": [ + "dockerfile", + "target", + "buildArgs", + "network", + "cacheFrom", + "noCache" + ], + "additionalProperties": false, + "description": "describes an artifact built from a Dockerfile, usually using `docker build`.", + "x-intellij-html-description": "describes an artifact built from a Dockerfile, usually using docker build." + }, + "DockerConfig": { + "properties": { + "path": { + "type": "string", + "description": "path to the docker `config.json`.", + "x-intellij-html-description": "path to the docker config.json." + }, + "secretName": { + "type": "string", + "description": "Kubernetes secret that contains the `config.json` Docker configuration. Note that the expected secret type is not 'kubernetes.io/dockerconfigjson' but 'Opaque'.", + "x-intellij-html-description": "Kubernetes secret that contains the config.json Docker configuration. Note that the expected secret type is not 'kubernetes.io/dockerconfigjson' but 'Opaque'." + } + }, + "preferredOrder": [ + "path", + "secretName" + ], + "additionalProperties": false, + "description": "contains information about the docker `config.json` to mount.", + "x-intellij-html-description": "contains information about the docker config.json to mount." + }, + "DockerfileDependency": { + "properties": { + "buildArgs": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "key/value pairs used to resolve values of `ARG` instructions in a Dockerfile. Values can be constants or environment variables via the go template syntax.", + "x-intellij-html-description": "key/value pairs used to resolve values of ARG instructions in a Dockerfile. Values can be constants or environment variables via the go template syntax.", + "default": "{}", + "examples": [ + "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"'{{.ENV_VARIABLE}}'\"}" + ] + }, + "path": { + "type": "string", + "description": "locates the Dockerfile relative to workspace.", + "x-intellij-html-description": "locates the Dockerfile relative to workspace." + } + }, + "preferredOrder": [ + "path", + "buildArgs" + ], + "additionalProperties": false, + "description": "*beta* used to specify a custom build artifact that is built from a Dockerfile. This allows skaffold to determine dependencies from the Dockerfile.", + "x-intellij-html-description": "beta used to specify a custom build artifact that is built from a Dockerfile. This allows skaffold to determine dependencies from the Dockerfile." + }, + "EnvTemplateTagger": { + "required": [ + "template" + ], + "properties": { + "template": { + "type": "string", + "description": "used to produce the image name and tag. See golang [text/template](https://golang.org/pkg/text/template/). The template is executed against the current environment, with those variables injected: IMAGE_NAME | Name of the image being built, as supplied in the artifacts section.", + "x-intellij-html-description": "used to produce the image name and tag. See golang text/template. The template is executed against the current environment, with those variables injected: IMAGE_NAME | Name of the image being built, as supplied in the artifacts section.", + "examples": [ + "{{.RELEASE}}-{{.IMAGE_NAME}}" + ] + } + }, + "preferredOrder": [ + "template" + ], + "additionalProperties": false, + "description": "*beta* tags images with a configurable template string.", + "x-intellij-html-description": "beta tags images with a configurable template string." + }, + "GitTagger": { + "properties": { + "prefix": { + "type": "string", + "description": "adds a fixed prefix to the tag.", + "x-intellij-html-description": "adds a fixed prefix to the tag." + }, + "variant": { + "type": "string", + "description": "determines the behavior of the git tagger. Valid variants are: `Tags` (default): use git tags or fall back to abbreviated commit hash. `CommitSha`: use the full git commit sha. `AbbrevCommitSha`: use the abbreviated git commit sha. `TreeSha`: use the full tree hash of the artifact workingdir. `AbbrevTreeSha`: use the abbreviated tree hash of the artifact workingdir.", + "x-intellij-html-description": "determines the behavior of the git tagger. Valid variants are: Tags (default): use git tags or fall back to abbreviated commit hash. CommitSha: use the full git commit sha. AbbrevCommitSha: use the abbreviated git commit sha. TreeSha: use the full tree hash of the artifact workingdir. AbbrevTreeSha: use the abbreviated tree hash of the artifact workingdir." + } + }, + "preferredOrder": [ + "variant", + "prefix" + ], + "additionalProperties": false, + "description": "*beta* tags images with the git tag or commit of the artifact's workspace.", + "x-intellij-html-description": "beta tags images with the git tag or commit of the artifact's workspace." + }, + "GoogleCloudBuild": { + "properties": { + "concurrency": { + "type": "integer", + "description": "how many artifacts can be built concurrently. 0 means \"no-limit\".", + "x-intellij-html-description": "how many artifacts can be built concurrently. 0 means "no-limit".", + "default": "0" + }, + "diskSizeGb": { + "type": "integer", + "description": "disk size of the VM that runs the build. See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions).", + "x-intellij-html-description": "disk size of the VM that runs the build. See Cloud Build Reference." + }, + "dockerImage": { + "type": "string", + "description": "image that runs a Docker build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).", + "x-intellij-html-description": "image that runs a Docker build. See Cloud Builders.", + "default": "gcr.io/cloud-builders/docker" + }, + "gradleImage": { + "type": "string", + "description": "image that runs a Gradle build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).", + "x-intellij-html-description": "image that runs a Gradle build. See Cloud Builders.", + "default": "gcr.io/cloud-builders/gradle" + }, + "kanikoImage": { + "type": "string", + "description": "image that runs a Kaniko build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).", + "x-intellij-html-description": "image that runs a Kaniko build. See Cloud Builders.", + "default": "gcr.io/kaniko-project/executor" + }, + "logStreamingOption": { + "type": "string", + "description": "specifies the behavior when writing build logs to Google Cloud Storage. Valid options are: `STREAM_DEFAULT`: Service may automatically determine build log streaming behavior. `STREAM_ON`: Build logs should be streamed to Google Cloud Storage. `STREAM_OFF`: Build logs should not be streamed to Google Cloud Storage; they will be written when the build is completed. See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#logstreamingoption).", + "x-intellij-html-description": "specifies the behavior when writing build logs to Google Cloud Storage. Valid options are: STREAM_DEFAULT: Service may automatically determine build log streaming behavior. STREAM_ON: Build logs should be streamed to Google Cloud Storage. STREAM_OFF: Build logs should not be streamed to Google Cloud Storage; they will be written when the build is completed. See Cloud Build Reference." + }, + "logging": { + "type": "string", + "description": "specifies the logging mode. Valid modes are: `LOGGING_UNSPECIFIED`: The service determines the logging mode. `LEGACY`: Stackdriver logging and Cloud Storage logging are enabled (default). `GCS_ONLY`: Only Cloud Storage logging is enabled. See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#loggingmode).", + "x-intellij-html-description": "specifies the logging mode. Valid modes are: LOGGING_UNSPECIFIED: The service determines the logging mode. LEGACY: Stackdriver logging and Cloud Storage logging are enabled (default). GCS_ONLY: Only Cloud Storage logging is enabled. See Cloud Build Reference." + }, + "machineType": { + "type": "string", + "description": "type of the VM that runs the build. See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions).", + "x-intellij-html-description": "type of the VM that runs the build. See Cloud Build Reference." + }, + "mavenImage": { + "type": "string", + "description": "image that runs a Maven build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).", + "x-intellij-html-description": "image that runs a Maven build. See Cloud Builders.", + "default": "gcr.io/cloud-builders/mvn" + }, + "packImage": { + "type": "string", + "description": "image that runs a Cloud Native Buildpacks build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).", + "x-intellij-html-description": "image that runs a Cloud Native Buildpacks build. See Cloud Builders.", + "default": "gcr.io/k8s-skaffold/pack" + }, + "projectId": { + "type": "string", + "description": "ID of your Cloud Platform Project. If it is not provided, Skaffold will guess it from the image name. For example, given the artifact image name `gcr.io/myproject/image`, Skaffold will use the `myproject` GCP project.", + "x-intellij-html-description": "ID of your Cloud Platform Project. If it is not provided, Skaffold will guess it from the image name. For example, given the artifact image name gcr.io/myproject/image, Skaffold will use the myproject GCP project." + }, + "timeout": { + "type": "string", + "description": "amount of time (in seconds) that this build should be allowed to run. See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#resource-build).", + "x-intellij-html-description": "amount of time (in seconds) that this build should be allowed to run. See Cloud Build Reference." + } + }, + "preferredOrder": [ + "projectId", + "diskSizeGb", + "machineType", + "timeout", + "logging", + "logStreamingOption", + "dockerImage", + "kanikoImage", + "mavenImage", + "gradleImage", + "packImage", + "concurrency" + ], + "additionalProperties": false, + "description": "*beta* describes how to do a remote build on [Google Cloud Build](https://cloud.google.com/cloud-build/docs/). Docker and Jib artifacts can be built on Cloud Build. The `projectId` needs to be provided and the currently logged in user should be given permissions to trigger new builds.", + "x-intellij-html-description": "beta describes how to do a remote build on Google Cloud Build. Docker and Jib artifacts can be built on Cloud Build. The projectId needs to be provided and the currently logged in user should be given permissions to trigger new builds." + }, + "HelmConventionConfig": { + "properties": { + "explicitRegistry": { + "type": "boolean", + "description": "separates `image.registry` to the image config syntax. Useful for some charts e.g. `postgresql`.", + "x-intellij-html-description": "separates image.registry to the image config syntax. Useful for some charts e.g. postgresql.", + "default": "false" + } + }, + "preferredOrder": [ + "explicitRegistry" + ], + "additionalProperties": false, + "description": "image config in the syntax of image.repository and image.tag.", + "x-intellij-html-description": "image config in the syntax of image.repository and image.tag." + }, + "HelmDeploy": { + "required": [ + "releases" + ], + "properties": { + "flags": { + "$ref": "#/definitions/HelmDeployFlags", + "description": "additional option flags that are passed on the command line to `helm`.", + "x-intellij-html-description": "additional option flags that are passed on the command line to helm." + }, + "releases": { + "items": { + "$ref": "#/definitions/HelmRelease" + }, + "type": "array", + "description": "a list of Helm releases.", + "x-intellij-html-description": "a list of Helm releases." + } + }, + "preferredOrder": [ + "releases", + "flags" + ], + "additionalProperties": false, + "description": "*beta* uses the `helm` CLI to apply the charts to the cluster.", + "x-intellij-html-description": "beta uses the helm CLI to apply the charts to the cluster." + }, + "HelmDeployFlags": { + "properties": { + "global": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed on every command.", + "x-intellij-html-description": "additional flags passed on every command.", + "default": "[]" + }, + "install": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed to (`helm install`).", + "x-intellij-html-description": "additional flags passed to (helm install).", + "default": "[]" + }, + "upgrade": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed to (`helm upgrade`).", + "x-intellij-html-description": "additional flags passed to (helm upgrade).", + "default": "[]" + } + }, + "preferredOrder": [ + "global", + "install", + "upgrade" + ], + "additionalProperties": false, + "description": "additional option flags that are passed on the command line to `helm`.", + "x-intellij-html-description": "additional option flags that are passed on the command line to helm." + }, + "HelmFQNConfig": { + "properties": { + "property": { + "type": "string", + "description": "defines the image config.", + "x-intellij-html-description": "defines the image config." + } + }, + "preferredOrder": [ + "property" + ], + "additionalProperties": false, + "description": "image config to use the FullyQualifiedImageName as param to set.", + "x-intellij-html-description": "image config to use the FullyQualifiedImageName as param to set." + }, + "HelmImageStrategy": { + "anyOf": [ + { + "additionalProperties": false + }, + { + "properties": { + "fqn": { + "$ref": "#/definitions/HelmFQNConfig", + "description": "image configuration uses the syntax `IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG`.", + "x-intellij-html-description": "image configuration uses the syntax IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG." + } + }, + "preferredOrder": [ + "fqn" + ], + "additionalProperties": false + }, + { + "properties": { + "helm": { + "$ref": "#/definitions/HelmConventionConfig", + "description": "image configuration uses the syntax `IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG`.", + "x-intellij-html-description": "image configuration uses the syntax IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG." + } + }, + "preferredOrder": [ + "helm" + ], + "additionalProperties": false + } + ], + "description": "adds image configurations to the Helm `values` file.", + "x-intellij-html-description": "adds image configurations to the Helm values file." + }, + "HelmPackaged": { + "properties": { + "appVersion": { + "type": "string", + "description": "sets the `appVersion` on the chart to this version.", + "x-intellij-html-description": "sets the appVersion on the chart to this version." + }, + "version": { + "type": "string", + "description": "sets the `version` on the chart to this semver version.", + "x-intellij-html-description": "sets the version on the chart to this semver version." + } + }, + "preferredOrder": [ + "version", + "appVersion" + ], + "additionalProperties": false, + "description": "parameters for packaging helm chart (`helm package`).", + "x-intellij-html-description": "parameters for packaging helm chart (helm package)." + }, + "HelmRelease": { + "required": [ + "name", + "chartPath" + ], + "properties": { + "chartPath": { + "type": "string", + "description": "path to the Helm chart.", + "x-intellij-html-description": "path to the Helm chart." + }, + "imageStrategy": { + "$ref": "#/definitions/HelmImageStrategy", + "description": "adds image configurations to the Helm `values` file.", + "x-intellij-html-description": "adds image configurations to the Helm values file." + }, + "name": { + "type": "string", + "description": "name of the Helm release.", + "x-intellij-html-description": "name of the Helm release." + }, + "namespace": { + "type": "string", + "description": "Kubernetes namespace.", + "x-intellij-html-description": "Kubernetes namespace." + }, + "overrides": { + "description": "key-value pairs. If present, Skaffold will build a Helm `values` file that overrides the original and use it to call Helm CLI (`--f` flag).", + "x-intellij-html-description": "key-value pairs. If present, Skaffold will build a Helm values file that overrides the original and use it to call Helm CLI (--f flag)." + }, + "packaged": { + "$ref": "#/definitions/HelmPackaged", + "description": "parameters for packaging helm chart (`helm package`).", + "x-intellij-html-description": "parameters for packaging helm chart (helm package)." + }, + "recreatePods": { + "type": "boolean", + "description": "if `true`, Skaffold will send `--recreate-pods` flag to Helm CLI when upgrading a new version of a chart in subsequent dev loop deploy.", + "x-intellij-html-description": "if true, Skaffold will send --recreate-pods flag to Helm CLI when upgrading a new version of a chart in subsequent dev loop deploy.", + "default": "false" + }, + "remote": { + "type": "boolean", + "description": "specifies whether the chart path is remote, or exists on the host filesystem.", + "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem.", + "default": "false" + }, + "setFiles": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "key-value pairs. If present, Skaffold will send `--set-file` flag to Helm CLI and append all pairs after the flag.", + "x-intellij-html-description": "key-value pairs. If present, Skaffold will send --set-file flag to Helm CLI and append all pairs after the flag.", + "default": "{}" + }, + "setValueTemplates": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "key-value pairs. If present, Skaffold will try to parse the value part of each key-value pair using environment variables in the system, then send `--set` flag to Helm CLI and append all parsed pairs after the flag.", + "x-intellij-html-description": "key-value pairs. If present, Skaffold will try to parse the value part of each key-value pair using environment variables in the system, then send --set flag to Helm CLI and append all parsed pairs after the flag.", + "default": "{}" + }, + "setValues": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "key-value pairs. If present, Skaffold will send `--set` flag to Helm CLI and append all pairs after the flag.", + "x-intellij-html-description": "key-value pairs. If present, Skaffold will send --set flag to Helm CLI and append all pairs after the flag.", + "default": "{}" + }, + "skipBuildDependencies": { + "type": "boolean", + "description": "should build dependencies be skipped. Ignored when `remote: true`.", + "x-intellij-html-description": "should build dependencies be skipped. Ignored when remote: true.", + "default": "false" + }, + "upgradeOnChange": { + "type": "boolean", + "description": "specifies whether to upgrade helm chart on code changes. Default is `true` when helm chart is local (`remote: false`). Default is `false` if `remote: true`.", + "x-intellij-html-description": "specifies whether to upgrade helm chart on code changes. Default is true when helm chart is local (remote: false). Default is false if remote: true." + }, + "useHelmSecrets": { + "type": "boolean", + "description": "instructs skaffold to use secrets plugin on deployment.", + "x-intellij-html-description": "instructs skaffold to use secrets plugin on deployment.", + "default": "false" + }, + "values": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "key-value pairs supplementing the Helm `values` file.", + "x-intellij-html-description": "key-value pairs supplementing the Helm values file.", + "default": "{}" + }, + "valuesFiles": { + "items": { + "type": "string" + }, + "type": "array", + "description": "paths to the Helm `values` files.", + "x-intellij-html-description": "paths to the Helm values files.", + "default": "[]" + }, + "version": { + "type": "string", + "description": "version of the chart.", + "x-intellij-html-description": "version of the chart." + }, + "wait": { + "type": "boolean", + "description": "if `true`, Skaffold will send `--wait` flag to Helm CLI.", + "x-intellij-html-description": "if true, Skaffold will send --wait flag to Helm CLI.", + "default": "false" + } + }, + "preferredOrder": [ + "name", + "chartPath", + "valuesFiles", + "values", + "namespace", + "version", + "setValues", + "setValueTemplates", + "setFiles", + "wait", + "recreatePods", + "skipBuildDependencies", + "useHelmSecrets", + "remote", + "upgradeOnChange", + "overrides", + "packaged", + "imageStrategy" + ], + "additionalProperties": false, + "description": "describes a helm release to be deployed.", + "x-intellij-html-description": "describes a helm release to be deployed." + }, + "JSONPatch": { + "required": [ + "path" + ], + "properties": { + "from": { + "type": "string", + "description": "source position in the yaml, used for `copy` or `move` operations.", + "x-intellij-html-description": "source position in the yaml, used for copy or move operations." + }, + "op": { + "type": "string", + "description": "operation carried by the patch: `add`, `remove`, `replace`, `move`, `copy` or `test`.", + "x-intellij-html-description": "operation carried by the patch: add, remove, replace, move, copy or test.", + "default": "replace" + }, + "path": { + "type": "string", + "description": "position in the yaml where the operation takes place. For example, this targets the `dockerfile` of the first artifact built.", + "x-intellij-html-description": "position in the yaml where the operation takes place. For example, this targets the dockerfile of the first artifact built.", + "examples": [ + "/build/artifacts/0/docker/dockerfile" + ] + }, + "value": { + "description": "value to apply. Can be any portion of yaml.", + "x-intellij-html-description": "value to apply. Can be any portion of yaml." + } + }, + "preferredOrder": [ + "op", + "path", + "from", + "value" + ], + "additionalProperties": false, + "description": "patch to be applied by a profile.", + "x-intellij-html-description": "patch to be applied by a profile." + }, + "JibArtifact": { + "properties": { + "args": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional build flags passed to the builder.", + "x-intellij-html-description": "additional build flags passed to the builder.", + "default": "[]", + "examples": [ + "[\"--no-build-cache\"]" + ] + }, + "project": { + "type": "string", + "description": "selects which sub-project to build for multi-module builds.", + "x-intellij-html-description": "selects which sub-project to build for multi-module builds." + }, + "type": { + "type": "string", + "description": "the Jib builder type; normally determined automatically. Valid types are `maven`: for Maven. `gradle`: for Gradle.", + "x-intellij-html-description": "the Jib builder type; normally determined automatically. Valid types are maven: for Maven. gradle: for Gradle.", + "enum": [ + "maven", + "gradle" + ] + } + }, + "preferredOrder": [ + "project", + "args", + "type" + ], + "additionalProperties": false, + "description": "builds images using the [Jib plugins for Maven and Gradle](https://github.com/GoogleContainerTools/jib/).", + "x-intellij-html-description": "builds images using the Jib plugins for Maven and Gradle." + }, + "KanikoArtifact": { + "properties": { + "buildArgs": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "arguments passed to the docker build. It also accepts environment variables via the go template syntax.", + "x-intellij-html-description": "arguments passed to the docker build. It also accepts environment variables via the go template syntax.", + "default": "{}", + "examples": [ + "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"'{{.ENV_VARIABLE}}'\"}" + ] + }, + "cache": { + "$ref": "#/definitions/KanikoCache", + "description": "configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds.", + "x-intellij-html-description": "configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds." + }, + "dockerfile": { + "type": "string", + "description": "locates the Dockerfile relative to workspace.", + "x-intellij-html-description": "locates the Dockerfile relative to workspace.", + "default": "Dockerfile" + }, + "env": { + "items": {}, + "type": "array", + "description": "environment variables passed to the kaniko pod.", + "x-intellij-html-description": "environment variables passed to the kaniko pod.", + "default": "[]" + }, + "flags": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags to be passed to Kaniko command line. See [Kaniko Additional Flags](https://github.com/GoogleContainerTools/kaniko#additional-flags). Deprecated - instead the named, unique fields should be used, e.g. `buildArgs`, `cache`, `target`.", + "x-intellij-html-description": "additional flags to be passed to Kaniko command line. See Kaniko Additional Flags. Deprecated - instead the named, unique fields should be used, e.g. buildArgs, cache, target.", + "default": "[]" + }, + "image": { + "type": "string", + "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 gcr.io/kaniko-project/executor." + }, + "initImage": { + "type": "string", + "description": "image used to run init container which mounts kaniko context.", + "x-intellij-html-description": "image used to run init container which mounts kaniko context." + }, + "reproducible": { + "type": "boolean", + "description": "used to strip timestamps out of the built image.", + "x-intellij-html-description": "used to strip timestamps out of the built image.", + "default": "false" + }, + "skipTLS": { + "type": "boolean", + "description": "skips TLS verification when pulling and pushing the image.", + "x-intellij-html-description": "skips TLS verification when pulling and pushing the image.", + "default": "false" + }, + "target": { + "type": "string", + "description": "Dockerfile target name to build.", + "x-intellij-html-description": "Dockerfile target name to build." + }, + "volumeMounts": { + "items": {}, + "type": "array", + "description": "volume mounts passed to kaniko pod.", + "x-intellij-html-description": "volume mounts passed to kaniko pod.", + "default": "[]" + } + }, + "preferredOrder": [ + "flags", + "dockerfile", + "target", + "buildArgs", + "env", + "initImage", + "image", + "cache", + "reproducible", + "skipTLS", + "volumeMounts" + ], + "additionalProperties": false, + "description": "describes an artifact built from a Dockerfile, with kaniko.", + "x-intellij-html-description": "describes an artifact built from a Dockerfile, with kaniko." + }, + "KanikoCache": { + "properties": { + "hostPath": { + "type": "string", + "description": "specifies a path on the host that is mounted to each pod as read only cache volume containing base images. If set, must exist on each node and prepopulated with kaniko-warmer.", + "x-intellij-html-description": "specifies a path on the host that is mounted to each pod as read only cache volume containing base images. If set, must exist on each node and prepopulated with kaniko-warmer." + }, + "repo": { + "type": "string", + "description": "a remote repository to store cached layers. If none is specified, one will be inferred from the image name. See [Kaniko Caching](https://github.com/GoogleContainerTools/kaniko#caching).", + "x-intellij-html-description": "a remote repository to store cached layers. If none is specified, one will be inferred from the image name. See Kaniko Caching." + } + }, + "preferredOrder": [ + "repo", + "hostPath" + ], + "additionalProperties": false, + "description": "configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds.", + "x-intellij-html-description": "configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds." + }, + "KubectlDeploy": { + "properties": { + "flags": { + "$ref": "#/definitions/KubectlFlags", + "description": "additional flags passed to `kubectl`.", + "x-intellij-html-description": "additional flags passed to kubectl." + }, + "manifests": { + "items": { + "type": "string" + }, + "type": "array", + "description": "the Kubernetes yaml or json manifests.", + "x-intellij-html-description": "the Kubernetes yaml or json manifests.", + "default": "[\"k8s/*.yaml\"]" + }, + "remoteManifests": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Kubernetes manifests in remote clusters.", + "x-intellij-html-description": "Kubernetes manifests in remote clusters.", + "default": "[]" + } + }, + "preferredOrder": [ + "manifests", + "remoteManifests", + "flags" + ], + "additionalProperties": false, + "description": "*beta* uses a client side `kubectl apply` to deploy manifests. You'll need a `kubectl` CLI version installed that's compatible with your cluster.", + "x-intellij-html-description": "beta uses a client side kubectl apply to deploy manifests. You'll need a kubectl CLI version installed that's compatible with your cluster." + }, + "KubectlFlags": { + "properties": { + "apply": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed on creations (`kubectl apply`).", + "x-intellij-html-description": "additional flags passed on creations (kubectl apply).", + "default": "[]" + }, + "delete": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed on deletions (`kubectl delete`).", + "x-intellij-html-description": "additional flags passed on deletions (kubectl delete).", + "default": "[]" + }, + "disableValidation": { + "type": "boolean", + "description": "passes the `--validate=false` flag to supported `kubectl` commands when enabled.", + "x-intellij-html-description": "passes the --validate=false flag to supported kubectl commands when enabled.", + "default": "false" + }, + "global": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional flags passed on every command.", + "x-intellij-html-description": "additional flags passed on every command.", + "default": "[]" + } + }, + "preferredOrder": [ + "global", + "apply", + "delete", + "disableValidation" + ], + "additionalProperties": false, + "description": "additional flags passed on the command line to kubectl either on every command (Global), on creations (Apply) or deletions (Delete).", + "x-intellij-html-description": "additional flags passed on the command line to kubectl either on every command (Global), on creations (Apply) or deletions (Delete)." + }, + "KustomizeDeploy": { + "properties": { + "buildArgs": { + "items": { + "type": "string" + }, + "type": "array", + "description": "additional args passed to `kustomize build`.", + "x-intellij-html-description": "additional args passed to kustomize build.", + "default": "[]" + }, + "flags": { + "$ref": "#/definitions/KubectlFlags", + "description": "additional flags passed to `kubectl`.", + "x-intellij-html-description": "additional flags passed to kubectl." + }, + "paths": { + "items": { + "type": "string" + }, + "type": "array", + "description": "path to Kustomization files.", + "x-intellij-html-description": "path to Kustomization files.", + "default": "[\".\"]" + } + }, + "preferredOrder": [ + "paths", + "flags", + "buildArgs" + ], + "additionalProperties": false, + "description": "*beta* uses the `kustomize` CLI to \"patch\" a deployment for a target environment.", + "x-intellij-html-description": "beta uses the kustomize CLI to "patch" a deployment for a target environment." + }, + "LocalBuild": { + "properties": { + "concurrency": { + "type": "integer", + "description": "how many artifacts can be built concurrently. 0 means \"no-limit\".", + "x-intellij-html-description": "how many artifacts can be built concurrently. 0 means "no-limit".", + "default": "1" + }, + "push": { + "type": "boolean", + "description": "should images be pushed to a registry. If not specified, images are pushed only if the current Kubernetes context connects to a remote cluster.", + "x-intellij-html-description": "should images be pushed to a registry. If not specified, images are pushed only if the current Kubernetes context connects to a remote cluster." + }, + "useBuildkit": { + "type": "boolean", + "description": "use BuildKit to build Docker images.", + "x-intellij-html-description": "use BuildKit to build Docker images.", + "default": "false" + }, + "useDockerCLI": { + "type": "boolean", + "description": "use `docker` command-line interface instead of Docker Engine APIs.", + "x-intellij-html-description": "use docker command-line interface instead of Docker Engine APIs.", + "default": "false" + } + }, + "preferredOrder": [ + "push", + "useDockerCLI", + "useBuildkit", + "concurrency" + ], + "additionalProperties": false, + "description": "*beta* describes how to do a build on the local docker daemon and optionally push to a repository.", + "x-intellij-html-description": "beta describes how to do a build on the local docker daemon and optionally push to a repository." + }, + "Metadata": { + "properties": { + "name": { + "type": "string", + "description": "an identifier for the project.", + "x-intellij-html-description": "an identifier for the project." + } + }, + "preferredOrder": [ + "name" + ], + "additionalProperties": false, + "description": "holds an optional name of the project.", + "x-intellij-html-description": "holds an optional name of the project." + }, + "PortForwardResource": { + "properties": { + "address": { + "type": "string", + "description": "local address to bind to. Defaults to the loopback address 127.0.0.1.", + "x-intellij-html-description": "local address to bind to. Defaults to the loopback address 127.0.0.1." + }, + "localPort": { + "type": "integer", + "description": "local port to forward to. If the port is unavailable, Skaffold will choose a random open port to forward to. *Optional*.", + "x-intellij-html-description": "local port to forward to. If the port is unavailable, Skaffold will choose a random open port to forward to. Optional." + }, + "namespace": { + "type": "string", + "description": "namespace of the resource to port forward.", + "x-intellij-html-description": "namespace of the resource to port forward." + }, + "port": { + "type": "integer", + "description": "resource port that will be forwarded.", + "x-intellij-html-description": "resource port that will be forwarded." + }, + "resourceName": { + "type": "string", + "description": "name of the Kubernetes resource to port forward.", + "x-intellij-html-description": "name of the Kubernetes resource to port forward." + }, + "resourceType": { + "type": "string", + "description": "Kubernetes type that should be port forwarded. Acceptable resource types include: `Service`, `Pod` and Controller resource type that has a pod spec: `ReplicaSet`, `ReplicationController`, `Deployment`, `StatefulSet`, `DaemonSet`, `Job`, `CronJob`.", + "x-intellij-html-description": "Kubernetes type that should be port forwarded. Acceptable resource types include: Service, Pod and Controller resource type that has a pod spec: ReplicaSet, ReplicationController, Deployment, StatefulSet, DaemonSet, Job, CronJob." + } + }, + "preferredOrder": [ + "resourceType", + "resourceName", + "namespace", + "port", + "address", + "localPort" + ], + "additionalProperties": false, + "description": "describes a resource to port forward.", + "x-intellij-html-description": "describes a resource to port forward." + }, + "Profile": { + "required": [ + "name" + ], + "properties": { + "activation": { + "items": { + "$ref": "#/definitions/Activation" + }, + "type": "array", + "description": "criteria by which a profile can be auto-activated. The profile is auto-activated if any one of the activations are triggered. An activation is triggered if all of the criteria (env, kubeContext, command) are triggered.", + "x-intellij-html-description": "criteria by which a profile can be auto-activated. The profile is auto-activated if any one of the activations are triggered. An activation is triggered if all of the criteria (env, kubeContext, command) are triggered." + }, + "build": { + "$ref": "#/definitions/BuildConfig", + "description": "describes how images are built.", + "x-intellij-html-description": "describes how images are built." + }, + "deploy": { + "$ref": "#/definitions/DeployConfig", + "description": "describes how images are deployed.", + "x-intellij-html-description": "describes how images are deployed." + }, + "name": { + "type": "string", + "description": "a unique profile name.", + "x-intellij-html-description": "a unique profile name.", + "examples": [ + "profile-prod" + ] + }, + "patches": { + "items": { + "$ref": "#/definitions/JSONPatch" + }, + "type": "array", + "description": "patches applied to the configuration. Patches use the JSON patch notation.", + "x-intellij-html-description": "patches applied to the configuration. Patches use the JSON patch notation." + }, + "portForward": { + "items": { + "$ref": "#/definitions/PortForwardResource" + }, + "type": "array", + "description": "describes user defined resources to port-forward.", + "x-intellij-html-description": "describes user defined resources to port-forward." + }, + "test": { + "items": { + "$ref": "#/definitions/TestCase" + }, + "type": "array", + "description": "describes how images are tested.", + "x-intellij-html-description": "describes how images are tested." + } + }, + "preferredOrder": [ + "name", + "build", + "test", + "deploy", + "portForward", + "patches", + "activation" + ], + "additionalProperties": false, + "description": "used to override any `build`, `test` or `deploy` configuration.", + "x-intellij-html-description": "used to override any build, test or deploy configuration." + }, + "ResourceRequirement": { + "properties": { + "cpu": { + "type": "string", + "description": "the number cores to be used.", + "x-intellij-html-description": "the number cores to be used.", + "examples": [ + "2`, `2.0` or `200m" + ] + }, + "ephemeralStorage": { + "type": "string", + "description": "the amount of Ephemeral storage to allocate to the pod.", + "x-intellij-html-description": "the amount of Ephemeral storage to allocate to the pod.", + "examples": [ + "1Gi` or `1000Mi" + ] + }, + "memory": { + "type": "string", + "description": "the amount of memory to allocate to the pod.", + "x-intellij-html-description": "the amount of memory to allocate to the pod.", + "examples": [ + "1Gi` or `1000Mi" + ] + }, + "resourceStorage": { + "type": "string", + "description": "the amount of resource storage to allocate to the pod.", + "x-intellij-html-description": "the amount of resource storage to allocate to the pod.", + "examples": [ + "1Gi` or `1000Mi" + ] + } + }, + "preferredOrder": [ + "cpu", + "memory", + "ephemeralStorage", + "resourceStorage" + ], + "additionalProperties": false, + "description": "stores the CPU/Memory requirements for the pod.", + "x-intellij-html-description": "stores the CPU/Memory requirements for the pod." + }, + "ResourceRequirements": { + "properties": { + "limits": { + "$ref": "#/definitions/ResourceRequirement", + "description": "[resource limits](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the Kaniko pod.", + "x-intellij-html-description": "resource limits for the Kaniko pod." + }, + "requests": { + "$ref": "#/definitions/ResourceRequirement", + "description": "[resource requests](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the Kaniko pod.", + "x-intellij-html-description": "resource requests for the Kaniko pod." + } + }, + "preferredOrder": [ + "requests", + "limits" + ], + "additionalProperties": false, + "description": "describes the resource requirements for the kaniko pod.", + "x-intellij-html-description": "describes the resource requirements for the kaniko pod." + }, + "ResourceType": { + "type": "string", + "description": "describes the Kubernetes resource types used for port forwarding.", + "x-intellij-html-description": "describes the Kubernetes resource types used for port forwarding." + }, + "ShaTagger": { + "description": "*beta* tags images with their sha256 digest.", + "x-intellij-html-description": "beta tags images with their sha256 digest." + }, + "SkaffoldConfig": { + "required": [ + "apiVersion", + "kind" + ], + "properties": { + "apiVersion": { + "type": "string", + "description": "version of the configuration.", + "x-intellij-html-description": "version of the configuration." + }, + "build": { + "$ref": "#/definitions/BuildConfig", + "description": "describes how images are built.", + "x-intellij-html-description": "describes how images are built." + }, + "deploy": { + "$ref": "#/definitions/DeployConfig", + "description": "describes how images are deployed.", + "x-intellij-html-description": "describes how images are deployed." + }, + "kind": { + "type": "string", + "description": "always `Config`.", + "x-intellij-html-description": "always Config.", + "default": "Config" + }, + "metadata": { + "$ref": "#/definitions/Metadata", + "description": "holds additional information about the config.", + "x-intellij-html-description": "holds additional information about the config." + }, + "portForward": { + "items": { + "$ref": "#/definitions/PortForwardResource" + }, + "type": "array", + "description": "describes user defined resources to port-forward.", + "x-intellij-html-description": "describes user defined resources to port-forward." + }, + "profiles": { + "items": { + "$ref": "#/definitions/Profile" + }, + "type": "array", + "description": "*beta* can override be used to `build`, `test` or `deploy` configuration.", + "x-intellij-html-description": "beta can override be used to build, test or deploy configuration." + }, + "test": { + "items": { + "$ref": "#/definitions/TestCase" + }, + "type": "array", + "description": "describes how images are tested.", + "x-intellij-html-description": "describes how images are tested." + } + }, + "preferredOrder": [ + "apiVersion", + "kind", + "metadata", + "build", + "test", + "deploy", + "portForward", + "profiles" + ], + "additionalProperties": false, + "description": "holds the fields parsed from the Skaffold configuration file (skaffold.yaml).", + "x-intellij-html-description": "holds the fields parsed from the Skaffold configuration file (skaffold.yaml)." + }, + "Sync": { + "properties": { + "auto": { + "$ref": "#/definitions/Auto", + "description": "delegates discovery of sync rules to the build system. Only available for jib and buildpacks.", + "x-intellij-html-description": "delegates discovery of sync rules to the build system. Only available for jib and buildpacks." + }, + "infer": { + "items": { + "type": "string" + }, + "type": "array", + "description": "file patterns which may be synced into the container The container destination is inferred by the builder based on the instructions of a Dockerfile. Available for docker and kaniko artifacts and custom artifacts that declare dependencies on a dockerfile.", + "x-intellij-html-description": "file patterns which may be synced into the container The container destination is inferred by the builder based on the instructions of a Dockerfile. Available for docker and kaniko artifacts and custom artifacts that declare dependencies on a dockerfile.", + "default": "[]" + }, + "manual": { + "items": { + "$ref": "#/definitions/SyncRule" + }, + "type": "array", + "description": "manual sync rules indicating the source and destination.", + "x-intellij-html-description": "manual sync rules indicating the source and destination." + } + }, + "preferredOrder": [ + "manual", + "infer", + "auto" + ], + "additionalProperties": false, + "description": "*beta* specifies what files to sync into the container. This is a list of sync rules indicating the intent to sync for source files. If no files are listed, sync all the files and infer the destination.", + "x-intellij-html-description": "beta specifies what files to sync into the container. This is a list of sync rules indicating the intent to sync for source files. If no files are listed, sync all the files and infer the destination.", + "default": "infer: [\"**/*\"]" + }, + "SyncRule": { + "required": [ + "src", + "dest" + ], + "properties": { + "dest": { + "type": "string", + "description": "destination path in the container where the files should be synced to.", + "x-intellij-html-description": "destination path in the container where the files should be synced to.", + "examples": [ + "\"app/\"" + ] + }, + "src": { + "type": "string", + "description": "a glob pattern to match local paths against. Directories should be delimited by `/` on all platforms.", + "x-intellij-html-description": "a glob pattern to match local paths against. Directories should be delimited by / on all platforms.", + "examples": [ + "\"css/**/*.css\"" + ] + }, + "strip": { + "type": "string", + "description": "specifies the path prefix to remove from the source path when transplanting the files into the destination folder.", + "x-intellij-html-description": "specifies the path prefix to remove from the source path when transplanting the files into the destination folder.", + "examples": [ + "\"css/\"" + ] + } + }, + "preferredOrder": [ + "src", + "dest", + "strip" + ], + "additionalProperties": false, + "description": "specifies which local files to sync to remote folders.", + "x-intellij-html-description": "specifies which local files to sync to remote folders." + }, + "TagPolicy": { + "properties": { + "dateTime": { + "$ref": "#/definitions/DateTimeTagger", + "description": "*beta* tags images with the build timestamp.", + "x-intellij-html-description": "beta tags images with the build timestamp." + }, + "envTemplate": { + "$ref": "#/definitions/EnvTemplateTagger", + "description": "*beta* tags images with a configurable template string.", + "x-intellij-html-description": "beta tags images with a configurable template string." + }, + "gitCommit": { + "$ref": "#/definitions/GitTagger", + "description": "*beta* tags images with the git tag or commit of the artifact's workspace.", + "x-intellij-html-description": "beta tags images with the git tag or commit of the artifact's workspace." + }, + "sha256": { + "$ref": "#/definitions/ShaTagger", + "description": "*beta* tags images with their sha256 digest.", + "x-intellij-html-description": "beta tags images with their sha256 digest." + } + }, + "preferredOrder": [ + "gitCommit", + "sha256", + "envTemplate", + "dateTime" + ], + "additionalProperties": false, + "description": "contains all the configuration for the tagging step.", + "x-intellij-html-description": "contains all the configuration for the tagging step." + }, + "TestCase": { + "required": [ + "image" + ], + "properties": { + "image": { + "type": "string", + "description": "artifact on which to run those tests.", + "x-intellij-html-description": "artifact on which to run those tests.", + "examples": [ + "gcr.io/k8s-skaffold/example" + ] + }, + "structureTests": { + "items": { + "type": "string" + }, + "type": "array", + "description": "the [Container Structure Tests](https://github.com/GoogleContainerTools/container-structure-test) to run on that artifact.", + "x-intellij-html-description": "the Container Structure Tests to run on that artifact.", + "default": "[]", + "examples": [ + "[\"./test/*\"]" + ] + } + }, + "preferredOrder": [ + "image", + "structureTests" + ], + "additionalProperties": false, + "description": "a list of structure tests to run on images that Skaffold builds.", + "x-intellij-html-description": "a list of structure tests to run on images that Skaffold builds." + } + } +} diff --git a/integration/examples/bazel/skaffold.yaml b/integration/examples/bazel/skaffold.yaml index 25dd57800d9..98ab4c699d8 100644 --- a/integration/examples/bazel/skaffold.yaml +++ b/integration/examples/bazel/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/buildpacks-node/skaffold.yaml b/integration/examples/buildpacks-node/skaffold.yaml index 3270737f363..cc03108ba57 100644 --- a/integration/examples/buildpacks-node/skaffold.yaml +++ b/integration/examples/buildpacks-node/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/buildpacks/skaffold.yaml b/integration/examples/buildpacks/skaffold.yaml index 9c8edfbb2b3..66c34373bac 100644 --- a/integration/examples/buildpacks/skaffold.yaml +++ b/integration/examples/buildpacks/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/custom/skaffold.yaml b/integration/examples/custom/skaffold.yaml index 9617eb21fcc..84872f6b3ec 100644 --- a/integration/examples/custom/skaffold.yaml +++ b/integration/examples/custom/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/gcb-kaniko/skaffold.yaml b/integration/examples/gcb-kaniko/skaffold.yaml index da80e1ecab7..c14573cb7fb 100644 --- a/integration/examples/gcb-kaniko/skaffold.yaml +++ b/integration/examples/gcb-kaniko/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: googleCloudBuild: diff --git a/integration/examples/generate-pipeline/skaffold.yaml b/integration/examples/generate-pipeline/skaffold.yaml index 3e2280efd33..5623de9fa24 100644 --- a/integration/examples/generate-pipeline/skaffold.yaml +++ b/integration/examples/generate-pipeline/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/getting-started-kustomize/skaffold.yaml b/integration/examples/getting-started-kustomize/skaffold.yaml index 2202f91a6c3..c03520442ba 100644 --- a/integration/examples/getting-started-kustomize/skaffold.yaml +++ b/integration/examples/getting-started-kustomize/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config metadata: name: getting-started-kustomize diff --git a/integration/examples/getting-started/skaffold.yaml b/integration/examples/getting-started/skaffold.yaml index a9707a9f659..1f7f41c300d 100644 --- a/integration/examples/getting-started/skaffold.yaml +++ b/integration/examples/getting-started/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/google-cloud-build/skaffold.yaml b/integration/examples/google-cloud-build/skaffold.yaml index 555d3a69978..83a6aaea365 100644 --- a/integration/examples/google-cloud-build/skaffold.yaml +++ b/integration/examples/google-cloud-build/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: googleCloudBuild: diff --git a/integration/examples/helm-deployment-dependencies/skaffold.yaml b/integration/examples/helm-deployment-dependencies/skaffold.yaml index d3e236375ba..244590db4d7 100644 --- a/integration/examples/helm-deployment-dependencies/skaffold.yaml +++ b/integration/examples/helm-deployment-dependencies/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: tagPolicy: diff --git a/integration/examples/helm-deployment/skaffold.yaml b/integration/examples/helm-deployment/skaffold.yaml index 8f0ad8a1575..d76b3efaec3 100644 --- a/integration/examples/helm-deployment/skaffold.yaml +++ b/integration/examples/helm-deployment/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/hot-reload/skaffold.yaml b/integration/examples/hot-reload/skaffold.yaml index 9d299a81c90..fd1f472a5dd 100644 --- a/integration/examples/hot-reload/skaffold.yaml +++ b/integration/examples/hot-reload/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/jib-gradle/skaffold.yaml b/integration/examples/jib-gradle/skaffold.yaml index 42dd1e533dc..cec85c4c637 100644 --- a/integration/examples/jib-gradle/skaffold.yaml +++ b/integration/examples/jib-gradle/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/jib-multimodule/skaffold.yaml b/integration/examples/jib-multimodule/skaffold.yaml index 9b412b7d0fc..e20d108c5b5 100644 --- a/integration/examples/jib-multimodule/skaffold.yaml +++ b/integration/examples/jib-multimodule/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/jib/skaffold.yaml b/integration/examples/jib/skaffold.yaml index 22f12d8d751..8375e43d1e7 100644 --- a/integration/examples/jib/skaffold.yaml +++ b/integration/examples/jib/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/kaniko/skaffold.yaml b/integration/examples/kaniko/skaffold.yaml index ae70d6770b8..f7050f02032 100644 --- a/integration/examples/kaniko/skaffold.yaml +++ b/integration/examples/kaniko/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/kustomize/skaffold.yaml b/integration/examples/kustomize/skaffold.yaml index 7dfbd055f18..d38e890f430 100644 --- a/integration/examples/kustomize/skaffold.yaml +++ b/integration/examples/kustomize/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config deploy: kustomize: {} diff --git a/integration/examples/microservices/skaffold.yaml b/integration/examples/microservices/skaffold.yaml index 47d860a3676..dff900a7495 100644 --- a/integration/examples/microservices/skaffold.yaml +++ b/integration/examples/microservices/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/nodejs/skaffold.yaml b/integration/examples/nodejs/skaffold.yaml index 121e016a5ba..3dd3c3cfe9f 100644 --- a/integration/examples/nodejs/skaffold.yaml +++ b/integration/examples/nodejs/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: diff --git a/integration/examples/profile-patches/skaffold.yaml b/integration/examples/profile-patches/skaffold.yaml index 2e6c862dcfd..077ae557e42 100644 --- a/integration/examples/profile-patches/skaffold.yaml +++ b/integration/examples/profile-patches/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: # only build and deploy "base-service" on main profile diff --git a/integration/examples/profiles/skaffold.yaml b/integration/examples/profiles/skaffold.yaml index c285c7ed64f..183ea5b711d 100644 --- a/integration/examples/profiles/skaffold.yaml +++ b/integration/examples/profiles/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: # only build and deploy "world-service" on main profile diff --git a/integration/examples/react-reload/skaffold.yaml b/integration/examples/react-reload/skaffold.yaml index e96619c66c9..abc3a8e398c 100644 --- a/integration/examples/react-reload/skaffold.yaml +++ b/integration/examples/react-reload/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/ruby/skaffold.yaml b/integration/examples/ruby/skaffold.yaml index f5e8eb76d8b..a684ba3de65 100644 --- a/integration/examples/ruby/skaffold.yaml +++ b/integration/examples/ruby/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/structure-tests/skaffold.yaml b/integration/examples/structure-tests/skaffold.yaml index cf422afb0b3..24005cb71be 100644 --- a/integration/examples/structure-tests/skaffold.yaml +++ b/integration/examples/structure-tests/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/examples/tagging-with-environment-variables/skaffold.yaml b/integration/examples/tagging-with-environment-variables/skaffold.yaml index a31563b5789..90bc63d2dfd 100644 --- a/integration/examples/tagging-with-environment-variables/skaffold.yaml +++ b/integration/examples/tagging-with-environment-variables/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/build/skaffold.yaml b/integration/testdata/build/skaffold.yaml index 026c1479765..2d810434bbe 100644 --- a/integration/testdata/build/skaffold.yaml +++ b/integration/testdata/build/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: local: diff --git a/integration/testdata/debug/skaffold.yaml b/integration/testdata/debug/skaffold.yaml index 36f2007a943..e221129f7de 100644 --- a/integration/testdata/debug/skaffold.yaml +++ b/integration/testdata/debug/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/deploy-multiple/skaffold.yaml b/integration/testdata/deploy-multiple/skaffold.yaml index a21d639de21..d2c55196511 100644 --- a/integration/testdata/deploy-multiple/skaffold.yaml +++ b/integration/testdata/deploy-multiple/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/dev/skaffold.yaml b/integration/testdata/dev/skaffold.yaml index d2b1e660bb1..0d74061cea2 100644 --- a/integration/testdata/dev/skaffold.yaml +++ b/integration/testdata/dev/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/gke_loadbalancer/skaffold.yaml b/integration/testdata/gke_loadbalancer/skaffold.yaml index be207d76a5b..f23e3d2f76d 100644 --- a/integration/testdata/gke_loadbalancer/skaffold.yaml +++ b/integration/testdata/gke_loadbalancer/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/hello/skaffold.yaml b/integration/testdata/hello/skaffold.yaml index 32012ea7f63..67484dacacb 100644 --- a/integration/testdata/hello/skaffold.yaml +++ b/integration/testdata/hello/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/init/compose/skaffold.yaml b/integration/testdata/init/compose/skaffold.yaml index 614c8f106bc..a997b7cd318 100644 --- a/integration/testdata/init/compose/skaffold.yaml +++ b/integration/testdata/init/compose/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config metadata: name: compose diff --git a/integration/testdata/jib-sync/skaffold.yaml b/integration/testdata/jib-sync/skaffold.yaml index bfd27abc5d4..b87eee9dd2d 100644 --- a/integration/testdata/jib-sync/skaffold.yaml +++ b/integration/testdata/jib-sync/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/jib/skaffold.yaml b/integration/testdata/jib/skaffold.yaml index 9992d4271e1..deb782c17cd 100644 --- a/integration/testdata/jib/skaffold.yaml +++ b/integration/testdata/jib/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-explicit-repo/skaffold.yaml b/integration/testdata/kaniko-explicit-repo/skaffold.yaml index 99fd6db7ed6..e57e779202b 100644 --- a/integration/testdata/kaniko-explicit-repo/skaffold.yaml +++ b/integration/testdata/kaniko-explicit-repo/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml b/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml index a9707a9f659..1f7f41c300d 100644 --- a/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml +++ b/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-insecure-registry/skaffold.yaml b/integration/testdata/kaniko-insecure-registry/skaffold.yaml index b4c2c43d94f..836d602c163 100644 --- a/integration/testdata/kaniko-insecure-registry/skaffold.yaml +++ b/integration/testdata/kaniko-insecure-registry/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config profiles: - name: build-artifact diff --git a/integration/testdata/kaniko-microservices/skaffold.yaml b/integration/testdata/kaniko-microservices/skaffold.yaml index 386d55cf047..56f85a132e7 100644 --- a/integration/testdata/kaniko-microservices/skaffold.yaml +++ b/integration/testdata/kaniko-microservices/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-sub-folder/skaffold.yaml b/integration/testdata/kaniko-sub-folder/skaffold.yaml index f907bd95742..d2944cd477e 100644 --- a/integration/testdata/kaniko-sub-folder/skaffold.yaml +++ b/integration/testdata/kaniko-sub-folder/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-target/skaffold.yaml b/integration/testdata/kaniko-target/skaffold.yaml index 1ebbb944f37..6ca5f47e589 100644 --- a/integration/testdata/kaniko-target/skaffold.yaml +++ b/integration/testdata/kaniko-target/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/integration/testdata/tagPolicy/skaffold.yaml b/integration/testdata/tagPolicy/skaffold.yaml index d8fa5bec1c0..9074797fca9 100644 --- a/integration/testdata/tagPolicy/skaffold.yaml +++ b/integration/testdata/tagPolicy/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config build: artifacts: diff --git a/pkg/skaffold/initializer/testdata/init/allcli/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/allcli/skaffold.yaml index d4d2128d00c..af039538489 100644 --- a/pkg/skaffold/initializer/testdata/init/allcli/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/allcli/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config metadata: name: allcli diff --git a/pkg/skaffold/initializer/testdata/init/getting-started-kustomize/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/getting-started-kustomize/skaffold.yaml index 2202f91a6c3..c03520442ba 100644 --- a/pkg/skaffold/initializer/testdata/init/getting-started-kustomize/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/getting-started-kustomize/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config metadata: name: getting-started-kustomize diff --git a/pkg/skaffold/initializer/testdata/init/hello-no-manifest/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/hello-no-manifest/skaffold.yaml index a363176f767..079a9226819 100644 --- a/pkg/skaffold/initializer/testdata/init/hello-no-manifest/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/hello-no-manifest/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config metadata: name: hello diff --git a/pkg/skaffold/initializer/testdata/init/hello/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/hello/skaffold.yaml index a363176f767..079a9226819 100644 --- a/pkg/skaffold/initializer/testdata/init/hello/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/hello/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config metadata: name: hello diff --git a/pkg/skaffold/initializer/testdata/init/ignore-tags/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/ignore-tags/skaffold.yaml index 7372173908e..87f4e939ab7 100644 --- a/pkg/skaffold/initializer/testdata/init/ignore-tags/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/ignore-tags/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config metadata: name: ignore-tags diff --git a/pkg/skaffold/initializer/testdata/init/microservices/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/microservices/skaffold.yaml index 3a5b62f0eae..5f77b2c1172 100644 --- a/pkg/skaffold/initializer/testdata/init/microservices/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/microservices/skaffold.yaml @@ -1,4 +1,4 @@ -apiVersion: skaffold/v2beta3 +apiVersion: skaffold/v2beta4 kind: Config metadata: name: microservices diff --git a/pkg/skaffold/schema/latest/config.go b/pkg/skaffold/schema/latest/config.go index 683888b20cc..5879d3c42ae 100644 --- a/pkg/skaffold/schema/latest/config.go +++ b/pkg/skaffold/schema/latest/config.go @@ -22,8 +22,8 @@ import ( "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/util" ) -// !!! WARNING !!! This config version is already released, please DO NOT MODIFY the structs in this file. -const Version string = "skaffold/v2beta3" +// This config version is not yet released, it is SAFE TO MODIFY the structs in this file. +const Version string = "skaffold/v2beta4" // NewSkaffoldConfig creates a SkaffoldConfig func NewSkaffoldConfig() util.VersionedConfig { diff --git a/pkg/skaffold/schema/v2beta2/upgrade.go b/pkg/skaffold/schema/v2beta2/upgrade.go index f73f05786aa..3bb737c5330 100755 --- a/pkg/skaffold/schema/v2beta2/upgrade.go +++ b/pkg/skaffold/schema/v2beta2/upgrade.go @@ -17,8 +17,8 @@ limitations under the License. package v2beta2 import ( - next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/util" + next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2beta3" pkgutil "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" ) diff --git a/pkg/skaffold/schema/v2beta2/upgrade_test.go b/pkg/skaffold/schema/v2beta2/upgrade_test.go index 5358bfdbc70..10a92171d7e 100755 --- a/pkg/skaffold/schema/v2beta2/upgrade_test.go +++ b/pkg/skaffold/schema/v2beta2/upgrade_test.go @@ -21,7 +21,7 @@ import ( yaml "gopkg.in/yaml.v2" - next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" + next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2beta3" "github.com/GoogleContainerTools/skaffold/testutil" ) diff --git a/pkg/skaffold/schema/v2beta3/config.go b/pkg/skaffold/schema/v2beta3/config.go new file mode 100755 index 00000000000..ac6aa634afc --- /dev/null +++ b/pkg/skaffold/schema/v2beta3/config.go @@ -0,0 +1,901 @@ +/* +Copyright 2019 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v2beta3 + +import ( + v1 "k8s.io/api/core/v1" + + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/util" +) + +// !!! WARNING !!! This config version is already released, please DO NOT MODIFY the structs in this file. +const Version string = "skaffold/v2beta3" + +// NewSkaffoldConfig creates a SkaffoldConfig +func NewSkaffoldConfig() util.VersionedConfig { + return new(SkaffoldConfig) +} + +// SkaffoldConfig holds the fields parsed from the Skaffold configuration file (skaffold.yaml). +type SkaffoldConfig struct { + // APIVersion is the version of the configuration. + APIVersion string `yaml:"apiVersion" yamltags:"required"` + + // Kind is always `Config`. Defaults to `Config`. + Kind string `yaml:"kind" yamltags:"required"` + + // Metadata holds additional information about the config. + Metadata Metadata `yaml:"metadata,omitempty"` + + // Pipeline defines the Build/Test/Deploy phases. + Pipeline `yaml:",inline"` + + // Profiles *beta* can override be used to `build`, `test` or `deploy` configuration. + Profiles []Profile `yaml:"profiles,omitempty"` +} + +// Metadata holds an optional name of the project. +type Metadata struct { + // Name is an identifier for the project. + Name string `yaml:"name,omitempty"` +} + +// Pipeline describes a Skaffold pipeline. +type Pipeline struct { + // Build describes how images are built. + Build BuildConfig `yaml:"build,omitempty"` + + // Test describes how images are tested. + Test []*TestCase `yaml:"test,omitempty"` + + // Deploy describes how images are deployed. + Deploy DeployConfig `yaml:"deploy,omitempty"` + + // PortForward describes user defined resources to port-forward. + PortForward []*PortForwardResource `yaml:"portForward,omitempty"` +} + +func (c *SkaffoldConfig) GetVersion() string { + return c.APIVersion +} + +// ResourceType describes the Kubernetes resource types used for port forwarding. +type ResourceType string + +// PortForwardResource describes a resource to port forward. +type PortForwardResource struct { + // Type is the Kubernetes type that should be port forwarded. + // Acceptable resource types include: `Service`, `Pod` and Controller resource type that has a pod spec: `ReplicaSet`, `ReplicationController`, `Deployment`, `StatefulSet`, `DaemonSet`, `Job`, `CronJob`. + Type ResourceType `yaml:"resourceType,omitempty"` + + // Name is the name of the Kubernetes resource to port forward. + Name string `yaml:"resourceName,omitempty"` + + // Namespace is the namespace of the resource to port forward. + Namespace string `yaml:"namespace,omitempty"` + + // Port is the resource port that will be forwarded. + Port int `yaml:"port,omitempty"` + + // Address is the local address to bind to. Defaults to the loopback address 127.0.0.1. + Address string `yaml:"address,omitempty"` + + // LocalPort is the local port to forward to. If the port is unavailable, Skaffold will choose a random open port to forward to. *Optional*. + LocalPort int `yaml:"localPort,omitempty"` +} + +// BuildConfig contains all the configuration for the build steps. +type BuildConfig struct { + // Artifacts lists the images you're going to be building. + Artifacts []*Artifact `yaml:"artifacts,omitempty"` + + // InsecureRegistries is a list of registries declared by the user to be insecure. + // These registries will be connected to via HTTP instead of HTTPS. + InsecureRegistries []string `yaml:"insecureRegistries,omitempty"` + + // TagPolicy *beta* determines how images are tagged. + // A few strategies are provided here, although you most likely won't need to care! + // If not specified, it defaults to `gitCommit: {variant: Tags}`. + TagPolicy TagPolicy `yaml:"tagPolicy,omitempty"` + + BuildType `yaml:",inline"` +} + +// TagPolicy contains all the configuration for the tagging step. +type TagPolicy struct { + // GitTagger *beta* tags images with the git tag or commit of the artifact's workspace. + GitTagger *GitTagger `yaml:"gitCommit,omitempty" yamltags:"oneOf=tag"` + + // ShaTagger *beta* tags images with their sha256 digest. + ShaTagger *ShaTagger `yaml:"sha256,omitempty" yamltags:"oneOf=tag"` + + // EnvTemplateTagger *beta* tags images with a configurable template string. + EnvTemplateTagger *EnvTemplateTagger `yaml:"envTemplate,omitempty" yamltags:"oneOf=tag"` + + // DateTimeTagger *beta* tags images with the build timestamp. + DateTimeTagger *DateTimeTagger `yaml:"dateTime,omitempty" yamltags:"oneOf=tag"` +} + +// ShaTagger *beta* tags images with their sha256 digest. +type ShaTagger struct{} + +// GitTagger *beta* tags images with the git tag or commit of the artifact's workspace. +type GitTagger struct { + // Variant determines the behavior of the git tagger. Valid variants are: + // `Tags` (default): use git tags or fall back to abbreviated commit hash. + // `CommitSha`: use the full git commit sha. + // `AbbrevCommitSha`: use the abbreviated git commit sha. + // `TreeSha`: use the full tree hash of the artifact workingdir. + // `AbbrevTreeSha`: use the abbreviated tree hash of the artifact workingdir. + Variant string `yaml:"variant,omitempty"` + + // Prefix adds a fixed prefix to the tag. + Prefix string `yaml:"prefix,omitempty"` +} + +// EnvTemplateTagger *beta* tags images with a configurable template string. +type EnvTemplateTagger struct { + // Template used to produce the image name and tag. + // See golang [text/template](https://golang.org/pkg/text/template/). + // The template is executed against the current environment, + // with those variables injected: + // IMAGE_NAME | Name of the image being built, as supplied in the artifacts section. + // For example: `{{.RELEASE}}-{{.IMAGE_NAME}}`. + Template string `yaml:"template,omitempty" yamltags:"required"` +} + +// DateTimeTagger *beta* tags images with the build timestamp. +type DateTimeTagger struct { + // Format formats the date and time. + // See [#Time.Format](https://golang.org/pkg/time/#Time.Format). + // Defaults to `2006-01-02_15-04-05.999_MST`. + Format string `yaml:"format,omitempty"` + + // TimeZone sets the timezone for the date and time. + // See [Time.LoadLocation](https://golang.org/pkg/time/#Time.LoadLocation). + // Defaults to the local timezone. + TimeZone string `yaml:"timezone,omitempty"` +} + +// BuildType contains the specific implementation and parameters needed +// for the build step. Only one field should be populated. +type BuildType struct { + // LocalBuild *beta* describes how to do a build on the local docker daemon + // and optionally push to a repository. + LocalBuild *LocalBuild `yaml:"local,omitempty" yamltags:"oneOf=build"` + + // GoogleCloudBuild *beta* describes how to do a remote build on + // [Google Cloud Build](https://cloud.google.com/cloud-build/). + GoogleCloudBuild *GoogleCloudBuild `yaml:"googleCloudBuild,omitempty" yamltags:"oneOf=build"` + + // Cluster *beta* describes how to do an on-cluster build. + Cluster *ClusterDetails `yaml:"cluster,omitempty" yamltags:"oneOf=build"` +} + +// LocalBuild *beta* describes how to do a build on the local docker daemon +// and optionally push to a repository. +type LocalBuild struct { + // Push should images be pushed to a registry. + // If not specified, images are pushed only if the current Kubernetes context + // connects to a remote cluster. + Push *bool `yaml:"push,omitempty"` + + // UseDockerCLI use `docker` command-line interface instead of Docker Engine APIs. + UseDockerCLI bool `yaml:"useDockerCLI,omitempty"` + + // UseBuildkit use BuildKit to build Docker images. + UseBuildkit bool `yaml:"useBuildkit,omitempty"` + + // Concurrency is how many artifacts can be built concurrently. 0 means "no-limit". + // Defaults to `1`. + Concurrency *int `yaml:"concurrency,omitempty"` +} + +// GoogleCloudBuild *beta* describes how to do a remote build on +// [Google Cloud Build](https://cloud.google.com/cloud-build/docs/). +// Docker and Jib artifacts can be built on Cloud Build. The `projectId` needs +// to be provided and the currently logged in user should be given permissions to trigger +// new builds. +type GoogleCloudBuild struct { + // ProjectID is the ID of your Cloud Platform Project. + // If it is not provided, Skaffold will guess it from the image name. + // For example, given the artifact image name `gcr.io/myproject/image`, Skaffold + // will use the `myproject` GCP project. + ProjectID string `yaml:"projectId,omitempty"` + + // DiskSizeGb is the disk size of the VM that runs the build. + // See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions). + DiskSizeGb int64 `yaml:"diskSizeGb,omitempty"` + + // MachineType is the type of the VM that runs the build. + // See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions). + MachineType string `yaml:"machineType,omitempty"` + + // Timeout is the amount of time (in seconds) that this build should be allowed to run. + // See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#resource-build). + Timeout string `yaml:"timeout,omitempty"` + + // Logging specifies the logging mode. + // Valid modes are: + // `LOGGING_UNSPECIFIED`: The service determines the logging mode. + // `LEGACY`: Stackdriver logging and Cloud Storage logging are enabled (default). + // `GCS_ONLY`: Only Cloud Storage logging is enabled. + // See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#loggingmode). + Logging string `yaml:"logging,omitempty"` + + // LogStreamingOption specifies the behavior when writing build logs to Google Cloud Storage. + // Valid options are: + // `STREAM_DEFAULT`: Service may automatically determine build log streaming behavior. + // `STREAM_ON`: Build logs should be streamed to Google Cloud Storage. + // `STREAM_OFF`: Build logs should not be streamed to Google Cloud Storage; they will be written when the build is completed. + // See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#logstreamingoption). + LogStreamingOption string `yaml:"logStreamingOption,omitempty"` + + // DockerImage is the image that runs a Docker build. + // See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders). + // Defaults to `gcr.io/cloud-builders/docker`. + DockerImage string `yaml:"dockerImage,omitempty"` + + // KanikoImage is the image that runs a Kaniko build. + // See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders). + // Defaults to `gcr.io/kaniko-project/executor`. + KanikoImage string `yaml:"kanikoImage,omitempty"` + + // MavenImage is the image that runs a Maven build. + // See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders). + // Defaults to `gcr.io/cloud-builders/mvn`. + MavenImage string `yaml:"mavenImage,omitempty"` + + // GradleImage is the image that runs a Gradle build. + // See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders). + // Defaults to `gcr.io/cloud-builders/gradle`. + GradleImage string `yaml:"gradleImage,omitempty"` + + // PackImage is the image that runs a Cloud Native Buildpacks build. + // See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders). + // Defaults to `gcr.io/k8s-skaffold/pack`. + PackImage string `yaml:"packImage,omitempty"` + + // Concurrency is how many artifacts can be built concurrently. 0 means "no-limit". + // Defaults to `0`. + Concurrency int `yaml:"concurrency,omitempty"` +} + +// KanikoCache configures Kaniko caching. If a cache is specified, Kaniko will +// use a remote cache which will speed up builds. +type KanikoCache struct { + // Repo is a remote repository to store cached layers. If none is specified, one will be + // inferred from the image name. See [Kaniko Caching](https://github.com/GoogleContainerTools/kaniko#caching). + Repo string `yaml:"repo,omitempty"` + // HostPath specifies a path on the host that is mounted to each pod as read only cache volume containing base images. + // If set, must exist on each node and prepopulated with kaniko-warmer. + HostPath string `yaml:"hostPath,omitempty"` +} + +// ClusterDetails *beta* describes how to do an on-cluster build. +type ClusterDetails struct { + // HTTPProxy for kaniko pod. + HTTPProxy string `yaml:"HTTP_PROXY,omitempty"` + + // HTTPSProxy for kaniko pod. + HTTPSProxy string `yaml:"HTTPS_PROXY,omitempty"` + + // PullSecret is the path to the Google Cloud service account secret key file. + PullSecret string `yaml:"pullSecret,omitempty"` + + // PullSecretName is the name of the Kubernetes secret for pulling base images + // and pushing the final image. If given, the secret needs to contain the Google Cloud + // service account secret key under the key `kaniko-secret`. + // Defaults to `kaniko-secret`. + PullSecretName string `yaml:"pullSecretName,omitempty"` + + // PullSecretMountPath is the path the pull secret will be mounted at within the running container. + PullSecretMountPath string `yaml:"pullSecretMountPath,omitempty"` + + // Namespace is the Kubernetes namespace. + // Defaults to current namespace in Kubernetes configuration. + Namespace string `yaml:"namespace,omitempty"` + + // Timeout is the amount of time (in seconds) that this build is allowed to run. + // Defaults to 20 minutes (`20m`). + Timeout string `yaml:"timeout,omitempty"` + + // DockerConfig describes how to mount the local Docker configuration into a pod. + DockerConfig *DockerConfig `yaml:"dockerConfig,omitempty"` + + // ServiceAccountName describes the Kubernetes service account to use for the pod. + // Defaults to 'default'. + ServiceAccountName string `yaml:"serviceAccount,omitempty"` + + // RunAsUser defines the UID to request for running the container. + // If omitted, no SeurityContext will be specified for the pod and will therefore be inherited + // from the service account. + RunAsUser *int64 `yaml:"runAsUser,omitempty"` + + // Resources define the resource requirements for the kaniko pod. + Resources *ResourceRequirements `yaml:"resources,omitempty"` + + // Concurrency is how many artifacts can be built concurrently. 0 means "no-limit". + // Defaults to `0`. + Concurrency int `yaml:"concurrency,omitempty"` + + // Volumes defines container mounts for ConfigMap and Secret resources. + Volumes []v1.Volume `yaml:"volumes,omitempty"` + + // RandomPullSecret adds a random UUID postfix to the default name of the pull secret to facilitate parallel builds, e.g. kaniko-secretdocker-cfgfd154022-c761-416f-8eb3-cf8258450b85. + RandomPullSecret bool `yaml:"randomPullSecret,omitempty"` + + // RandomDockerConfigSecret adds a random UUID postfix to the default name of the docker secret to facilitate parallel builds, e.g. docker-cfgfd154022-c761-416f-8eb3-cf8258450b85. + RandomDockerConfigSecret bool `yaml:"randomDockerConfigSecret,omitempty"` +} + +// DockerConfig contains information about the docker `config.json` to mount. +type DockerConfig struct { + // Path is the path to the docker `config.json`. + Path string `yaml:"path,omitempty"` + + // SecretName is the Kubernetes secret that contains the `config.json` Docker configuration. + // Note that the expected secret type is not 'kubernetes.io/dockerconfigjson' but 'Opaque'. + SecretName string `yaml:"secretName,omitempty"` +} + +// ResourceRequirements describes the resource requirements for the kaniko pod. +type ResourceRequirements struct { + // Requests [resource requests](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the Kaniko pod. + Requests *ResourceRequirement `yaml:"requests,omitempty"` + + // Limits [resource limits](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the Kaniko pod. + Limits *ResourceRequirement `yaml:"limits,omitempty"` +} + +// ResourceRequirement stores the CPU/Memory requirements for the pod. +type ResourceRequirement struct { + // CPU the number cores to be used. + // For example: `2`, `2.0` or `200m`. + CPU string `yaml:"cpu,omitempty"` + + // Memory the amount of memory to allocate to the pod. + // For example: `1Gi` or `1000Mi`. + Memory string `yaml:"memory,omitempty"` + + // EphemeralStorage the amount of Ephemeral storage to allocate to the pod. + // For example: `1Gi` or `1000Mi`. + EphemeralStorage string `yaml:"ephemeralStorage,omitempty"` + + // ResourceStorage the amount of resource storage to allocate to the pod. + // For example: `1Gi` or `1000Mi`. + ResourceStorage string `yaml:"resourceStorage,omitempty"` +} + +// TestCase is a list of structure tests to run on images that Skaffold builds. +type TestCase struct { + // ImageName is the artifact on which to run those tests. + // For example: `gcr.io/k8s-skaffold/example`. + ImageName string `yaml:"image" yamltags:"required"` + + // StructureTests lists the [Container Structure Tests](https://github.com/GoogleContainerTools/container-structure-test) + // to run on that artifact. + // For example: `["./test/*"]`. + StructureTests []string `yaml:"structureTests,omitempty"` +} + +// DeployConfig contains all the configuration needed by the deploy steps. +type DeployConfig struct { + DeployType `yaml:",inline"` + + // StatusCheckDeadlineSeconds *beta* is the deadline for deployments to stabilize in seconds. + StatusCheckDeadlineSeconds int `yaml:"statusCheckDeadlineSeconds,omitempty"` + + // KubeContext is the Kubernetes context that Skaffold should deploy to. + // For example: `minikube`. + KubeContext string `yaml:"kubeContext,omitempty"` +} + +// DeployType contains the specific implementation and parameters needed +// for the deploy step. All three deployer types can be used at the same +// time for hybrid workflows. +type DeployType struct { + // HelmDeploy *beta* uses the `helm` CLI to apply the charts to the cluster. + HelmDeploy *HelmDeploy `yaml:"helm,omitempty"` + + // KubectlDeploy *beta* uses a client side `kubectl apply` to deploy manifests. + // You'll need a `kubectl` CLI version installed that's compatible with your cluster. + KubectlDeploy *KubectlDeploy `yaml:"kubectl,omitempty"` + + // KustomizeDeploy *beta* uses the `kustomize` CLI to "patch" a deployment for a target environment. + KustomizeDeploy *KustomizeDeploy `yaml:"kustomize,omitempty"` +} + +// KubectlDeploy *beta* uses a client side `kubectl apply` to deploy manifests. +// You'll need a `kubectl` CLI version installed that's compatible with your cluster. +type KubectlDeploy struct { + // Manifests lists the Kubernetes yaml or json manifests. + // Defaults to `["k8s/*.yaml"]`. + Manifests []string `yaml:"manifests,omitempty"` + + // RemoteManifests lists Kubernetes manifests in remote clusters. + RemoteManifests []string `yaml:"remoteManifests,omitempty"` + + // Flags are additional flags passed to `kubectl`. + Flags KubectlFlags `yaml:"flags,omitempty"` +} + +// KubectlFlags are additional flags passed on the command +// line to kubectl either on every command (Global), on creations (Apply) +// or deletions (Delete). +type KubectlFlags struct { + // Global are additional flags passed on every command. + Global []string `yaml:"global,omitempty"` + + // Apply are additional flags passed on creations (`kubectl apply`). + Apply []string `yaml:"apply,omitempty"` + + // Delete are additional flags passed on deletions (`kubectl delete`). + Delete []string `yaml:"delete,omitempty"` + + // DisableValidation passes the `--validate=false` flag to supported + // `kubectl` commands when enabled. + DisableValidation bool `yaml:"disableValidation,omitempty"` +} + +// HelmDeploy *beta* uses the `helm` CLI to apply the charts to the cluster. +type HelmDeploy struct { + // Releases is a list of Helm releases. + Releases []HelmRelease `yaml:"releases,omitempty" yamltags:"required"` + + // Flags are additional option flags that are passed on the command + // line to `helm`. + Flags HelmDeployFlags `yaml:"flags,omitempty"` +} + +// HelmDeployFlags are additional option flags that are passed on the command +// line to `helm`. +type HelmDeployFlags struct { + // Global are additional flags passed on every command. + Global []string `yaml:"global,omitempty"` + + // Install are additional flags passed to (`helm install`). + Install []string `yaml:"install,omitempty"` + + // Upgrade are additional flags passed to (`helm upgrade`). + Upgrade []string `yaml:"upgrade,omitempty"` +} + +// KustomizeDeploy *beta* uses the `kustomize` CLI to "patch" a deployment for a target environment. +type KustomizeDeploy struct { + // KustomizePaths is the path to Kustomization files. + // Defaults to `["."]`. + KustomizePaths []string `yaml:"paths,omitempty"` + + // Flags are additional flags passed to `kubectl`. + Flags KubectlFlags `yaml:"flags,omitempty"` + + // BuildArgs are additional args passed to `kustomize build`. + BuildArgs []string `yaml:"buildArgs,omitempty"` +} + +// HelmRelease describes a helm release to be deployed. +type HelmRelease struct { + // Name is the name of the Helm release. + Name string `yaml:"name,omitempty" yamltags:"required"` + + // ChartPath is the path to the Helm chart. + ChartPath string `yaml:"chartPath,omitempty" yamltags:"required"` + + // ValuesFiles are the paths to the Helm `values` files. + ValuesFiles []string `yaml:"valuesFiles,omitempty"` + + // Values are key-value pairs supplementing the Helm `values` file. + Values map[string]string `yaml:"values,omitempty,omitempty"` + + // Namespace is the Kubernetes namespace. + Namespace string `yaml:"namespace,omitempty"` + + // Version is the version of the chart. + Version string `yaml:"version,omitempty"` + + // SetValues are key-value pairs. + // If present, Skaffold will send `--set` flag to Helm CLI and append all pairs after the flag. + SetValues map[string]string `yaml:"setValues,omitempty"` + + // SetValueTemplates are key-value pairs. + // If present, Skaffold will try to parse the value part of each key-value pair using + // environment variables in the system, then send `--set` flag to Helm CLI and append + // all parsed pairs after the flag. + SetValueTemplates map[string]string `yaml:"setValueTemplates,omitempty"` + + // SetFiles are key-value pairs. + // If present, Skaffold will send `--set-file` flag to Helm CLI and append all pairs after the flag. + SetFiles map[string]string `yaml:"setFiles,omitempty"` + + // Wait if `true`, Skaffold will send `--wait` flag to Helm CLI. + // Defaults to `false`. + Wait bool `yaml:"wait,omitempty"` + + // RecreatePods if `true`, Skaffold will send `--recreate-pods` flag to Helm CLI + // when upgrading a new version of a chart in subsequent dev loop deploy. + // Defaults to `false`. + RecreatePods bool `yaml:"recreatePods,omitempty"` + + // SkipBuildDependencies should build dependencies be skipped. + SkipBuildDependencies bool `yaml:"skipBuildDependencies,omitempty"` + + // UseHelmSecrets instructs skaffold to use secrets plugin on deployment. + UseHelmSecrets bool `yaml:"useHelmSecrets,omitempty"` + + // Remote specifies whether the chart path is remote, or exists on the host filesystem. + // `remote: true` implies `skipBuildDependencies: true`. + Remote bool `yaml:"remote,omitempty"` + + // Overrides are key-value pairs. + // If present, Skaffold will build a Helm `values` file that overrides + // the original and use it to call Helm CLI (`--f` flag). + Overrides util.HelmOverrides `yaml:"overrides,omitempty"` + + // Packaged parameters for packaging helm chart (`helm package`). + Packaged *HelmPackaged `yaml:"packaged,omitempty"` + + // ImageStrategy adds image configurations to the Helm `values` file. + ImageStrategy HelmImageStrategy `yaml:"imageStrategy,omitempty"` +} + +// HelmPackaged parameters for packaging helm chart (`helm package`). +type HelmPackaged struct { + // Version sets the `version` on the chart to this semver version. + Version string `yaml:"version,omitempty"` + + // AppVersion sets the `appVersion` on the chart to this version. + AppVersion string `yaml:"appVersion,omitempty"` +} + +// HelmImageStrategy adds image configurations to the Helm `values` file. +type HelmImageStrategy struct { + HelmImageConfig `yaml:",inline"` +} + +// HelmImageConfig describes an image configuration. +type HelmImageConfig struct { + // HelmFQNConfig is the image configuration uses the syntax `IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG`. + HelmFQNConfig *HelmFQNConfig `yaml:"fqn,omitempty" yamltags:"oneOf=helmImageStrategy"` + + // HelmConventionConfig is the image configuration uses the syntax `IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG`. + HelmConventionConfig *HelmConventionConfig `yaml:"helm,omitempty" yamltags:"oneOf=helmImageStrategy"` +} + +// HelmFQNConfig is the image config to use the FullyQualifiedImageName as param to set. +type HelmFQNConfig struct { + // Property defines the image config. + Property string `yaml:"property,omitempty"` +} + +// HelmConventionConfig is the image config in the syntax of image.repository and image.tag. +type HelmConventionConfig struct { + // ExplicitRegistry separates `image.registry` to the image config syntax. Useful for some charts e.g. `postgresql`. + ExplicitRegistry bool `yaml:"explicitRegistry,omitempty"` +} + +// Artifact are the items that need to be built, along with the context in which +// they should be built. +type Artifact struct { + // ImageName is the name of the image to be built. + // For example: `gcr.io/k8s-skaffold/example`. + ImageName string `yaml:"image,omitempty" yamltags:"required"` + + // Workspace is the directory containing the artifact's sources. + // Defaults to `.`. + Workspace string `yaml:"context,omitempty"` + + // Sync *beta* lists local files synced to pods instead + // of triggering an image build when modified. + // If no files are listed, sync all the files and infer the destination. + // Defaults to `infer: ["**/*"]`. + Sync *Sync `yaml:"sync,omitempty"` + + // ArtifactType describes how to build an artifact. + ArtifactType `yaml:",inline"` +} + +// Sync *beta* specifies what files to sync into the container. +// This is a list of sync rules indicating the intent to sync for source files. +// If no files are listed, sync all the files and infer the destination. +// Defaults to `infer: ["**/*"]`. +type Sync struct { + // Manual lists manual sync rules indicating the source and destination. + Manual []*SyncRule `yaml:"manual,omitempty" yamltags:"oneOf=sync"` + + // Infer lists file patterns which may be synced into the container + // The container destination is inferred by the builder + // based on the instructions of a Dockerfile. + // Available for docker and kaniko artifacts and custom + // artifacts that declare dependencies on a dockerfile. + Infer []string `yaml:"infer,omitempty" yamltags:"oneOf=sync"` + + // Auto delegates discovery of sync rules to the build system. + // Only available for jib and buildpacks. + Auto *Auto `yaml:"auto,omitempty" yamltags:"oneOf=sync"` +} + +// SyncRule specifies which local files to sync to remote folders. +type SyncRule struct { + // Src is a glob pattern to match local paths against. + // Directories should be delimited by `/` on all platforms. + // For example: `"css/**/*.css"`. + Src string `yaml:"src,omitempty" yamltags:"required"` + + // Dest is the destination path in the container where the files should be synced to. + // For example: `"app/"` + Dest string `yaml:"dest,omitempty" yamltags:"required"` + + // Strip specifies the path prefix to remove from the source path when + // transplanting the files into the destination folder. + // For example: `"css/"` + Strip string `yaml:"strip,omitempty"` +} + +// Auto cannot be customized. +type Auto struct{} + +// Profile is used to override any `build`, `test` or `deploy` configuration. +type Profile struct { + // Name is a unique profile name. + // For example: `profile-prod`. + Name string `yaml:"name,omitempty" yamltags:"required"` + + // Pipeline contains the definitions to replace the default skaffold pipeline. + Pipeline `yaml:",inline"` + + // Patches lists patches applied to the configuration. + // Patches use the JSON patch notation. + Patches []JSONPatch `yaml:"patches,omitempty"` + + // Activation criteria by which a profile can be auto-activated. + // The profile is auto-activated if any one of the activations are triggered. + // An activation is triggered if all of the criteria (env, kubeContext, command) are triggered. + Activation []Activation `yaml:"activation,omitempty"` +} + +// JSONPatch patch to be applied by a profile. +type JSONPatch struct { + // Op is the operation carried by the patch: `add`, `remove`, `replace`, `move`, `copy` or `test`. + // Defaults to `replace`. + Op string `yaml:"op,omitempty"` + + // Path is the position in the yaml where the operation takes place. + // For example, this targets the `dockerfile` of the first artifact built. + // For example: `/build/artifacts/0/docker/dockerfile`. + Path string `yaml:"path,omitempty" yamltags:"required"` + + // From is the source position in the yaml, used for `copy` or `move` operations. + From string `yaml:"from,omitempty"` + + // Value is the value to apply. Can be any portion of yaml. + Value *util.YamlpatchNode `yaml:"value,omitempty"` +} + +// Activation criteria by which a profile is auto-activated. +type Activation struct { + // Env is a `key=pattern` pair. The profile is auto-activated if an Environment + // Variable `key` matches the pattern. If the pattern starts with `!`, activation + // happens if the remaining pattern is _not_ matched. The pattern matches if the + // Environment Variable value is exactly `pattern`, or the regex `pattern` is + // found in it. An empty `pattern` (e.g. `env: "key="`) always only matches if + // the Environment Variable is undefined or empty. + // For example: `ENV=production` + Env string `yaml:"env,omitempty"` + + // KubeContext is a Kubernetes context for which the profile is auto-activated. + // For example: `minikube`. + KubeContext string `yaml:"kubeContext,omitempty"` + + // Command is a Skaffold command for which the profile is auto-activated. + // For example: `dev`. + Command string `yaml:"command,omitempty"` +} + +// ArtifactType describes how to build an artifact. +type ArtifactType struct { + // DockerArtifact *beta* describes an artifact built from a Dockerfile. + DockerArtifact *DockerArtifact `yaml:"docker,omitempty" yamltags:"oneOf=artifact"` + + // BazelArtifact *beta* requires bazel CLI to be installed and the sources to + // contain [Bazel](https://bazel.build/) configuration files. + BazelArtifact *BazelArtifact `yaml:"bazel,omitempty" yamltags:"oneOf=artifact"` + + // JibArtifact builds images using the + // [Jib plugins for Maven or Gradle](https://github.com/GoogleContainerTools/jib/). + JibArtifact *JibArtifact `yaml:"jib,omitempty" yamltags:"oneOf=artifact"` + + // KanikoArtifact builds images using [kaniko](https://github.com/GoogleContainerTools/kaniko). + KanikoArtifact *KanikoArtifact `yaml:"kaniko,omitempty" yamltags:"oneOf=artifact"` + + // BuildpackArtifact builds images using [Cloud Native Buildpacks](https://buildpacks.io/). + BuildpackArtifact *BuildpackArtifact `yaml:"buildpack,omitempty" yamltags:"oneOf=artifact"` + + // CustomArtifact *beta* builds images using a custom build script written by the user. + CustomArtifact *CustomArtifact `yaml:"custom,omitempty" yamltags:"oneOf=artifact"` +} + +// BuildpackArtifact *alpha* describes an artifact built using [Cloud Native Buildpacks](https://buildpacks.io/). +// It can be used to build images out of project's sources without any additional configuration. +type BuildpackArtifact struct { + // Builder is the builder image used. + Builder string `yaml:"builder" yamltags:"required"` + + // RunImage overrides the stack's default run image. + RunImage string `yaml:"runImage,omitempty"` + + // Env are environment variables, in the `key=value` form, passed to the build. + // Values can use the go template syntax. + // For example: `["key1=value1", "key2=value2", "key3={{.ENV_VARIABLE}}"]`. + Env []string `yaml:"env,omitempty"` + + // Buildpacks is a list of strings, where each string is a specific buildpack to use with the builder. + // If you specify buildpacks the builder image automatic detection will be ignored. These buildpacks will be used to build the Image from your source code. + // Order matters. + Buildpacks []string `yaml:"buildpacks,omitempty"` + + // Dependencies are the file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact. + Dependencies *BuildpackDependencies `yaml:"dependencies,omitempty"` +} + +// BuildpackDependencies *alpha* is used to specify dependencies for an artifact built by a buildpack. +type BuildpackDependencies struct { + // Paths should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization. + Paths []string `yaml:"paths,omitempty" yamltags:"oneOf=dependency"` + + // Ignore specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both `paths` and in `ignore`, it will be ignored, and will be excluded from both rebuilds and file synchronization. + // Will only work in conjunction with `paths`. + Ignore []string `yaml:"ignore,omitempty"` +} + +// CustomArtifact *beta* describes an artifact built from a custom build script +// written by the user. It can be used to build images with builders that aren't directly integrated with skaffold. +type CustomArtifact struct { + // BuildCommand is the command executed to build the image. + BuildCommand string `yaml:"buildCommand,omitempty"` + // Dependencies are the file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact. + Dependencies *CustomDependencies `yaml:"dependencies,omitempty"` +} + +// CustomDependencies *beta* is used to specify dependencies for an artifact built by a custom build script. +// Either `dockerfile` or `paths` should be specified for file watching to work as expected. +type CustomDependencies struct { + // Dockerfile should be set if the artifact is built from a Dockerfile, from which skaffold can determine dependencies. + Dockerfile *DockerfileDependency `yaml:"dockerfile,omitempty" yamltags:"oneOf=dependency"` + + // Command represents a custom command that skaffold executes to obtain dependencies. The output of this command *must* be a valid JSON array. + Command string `yaml:"command,omitempty" yamltags:"oneOf=dependency"` + + // Paths should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization. + Paths []string `yaml:"paths,omitempty" yamltags:"oneOf=dependency"` + + // Ignore specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both `paths` and in `ignore`, it will be ignored, and will be excluded from both rebuilds and file synchronization. + // Will only work in conjunction with `paths`. + Ignore []string `yaml:"ignore,omitempty"` +} + +// DockerfileDependency *beta* is used to specify a custom build artifact that is built from a Dockerfile. This allows skaffold to determine dependencies from the Dockerfile. +type DockerfileDependency struct { + // Path locates the Dockerfile relative to workspace. + Path string `yaml:"path,omitempty"` + + // BuildArgs are key/value pairs used to resolve values of `ARG` instructions in a Dockerfile. + // Values can be constants or environment variables via the go template syntax. + // For example: `{"key1": "value1", "key2": "value2", "key3": "'{{.ENV_VARIABLE}}'"}`. + BuildArgs map[string]*string `yaml:"buildArgs,omitempty"` +} + +// KanikoArtifact describes an artifact built from a Dockerfile, +// with kaniko. +type KanikoArtifact struct { + // AdditionalFlags are additional flags to be passed to Kaniko command line. + // See [Kaniko Additional Flags](https://github.com/GoogleContainerTools/kaniko#additional-flags). + // Deprecated - instead the named, unique fields should be used, e.g. `buildArgs`, `cache`, `target`. + AdditionalFlags []string `yaml:"flags,omitempty"` + + // DockerfilePath locates the Dockerfile relative to workspace. + // Defaults to `Dockerfile`. + DockerfilePath string `yaml:"dockerfile,omitempty"` + + // Target is the Dockerfile target name to build. + Target string `yaml:"target,omitempty"` + + // BuildArgs are arguments passed to the docker build. + // It also accepts environment variables via the go template syntax. + // For example: `{"key1": "value1", "key2": "value2", "key3": "'{{.ENV_VARIABLE}}'"}`. + BuildArgs map[string]*string `yaml:"buildArgs,omitempty"` + + // Env are environment variables passed to the kaniko pod. + Env []v1.EnvVar `yaml:"env,omitempty"` + + // InitImage is the image used to run init container which mounts kaniko context. + InitImage string `yaml:"initImage,omitempty"` + + // Image is the Docker image used by the Kaniko pod. + // Defaults to the latest released version of `gcr.io/kaniko-project/executor`. + Image string `yaml:"image,omitempty"` + + // Cache configures Kaniko caching. If a cache is specified, Kaniko will + // use a remote cache which will speed up builds. + Cache *KanikoCache `yaml:"cache,omitempty"` + + // Reproducible is used to strip timestamps out of the built image. + Reproducible bool `yaml:"reproducible,omitempty"` + + // SkipTLS skips TLS verification when pulling and pushing the image. + SkipTLS bool `yaml:"skipTLS,omitempty"` + + // VolumeMounts are volume mounts passed to kaniko pod. + VolumeMounts []v1.VolumeMount `yaml:"volumeMounts,omitempty"` +} + +// DockerArtifact describes an artifact built from a Dockerfile, +// usually using `docker build`. +type DockerArtifact struct { + // DockerfilePath locates the Dockerfile relative to workspace. + // Defaults to `Dockerfile`. + DockerfilePath string `yaml:"dockerfile,omitempty"` + + // Target is the Dockerfile target name to build. + Target string `yaml:"target,omitempty"` + + // BuildArgs are arguments passed to the docker build. + // For example: `{"key1": "value1", "key2": "value2"}`. + BuildArgs map[string]*string `yaml:"buildArgs,omitempty"` + + // NetworkMode is passed through to docker and overrides the + // network configuration of docker builder. If unset, use whatever + // is configured in the underlying docker daemon. Valid modes are + // `host`: use the host's networking stack. + // `bridge`: use the bridged network configuration. + // `none`: no networking in the container. + NetworkMode string `yaml:"network,omitempty"` + + // CacheFrom lists the Docker images used as cache sources. + // For example: `["golang:1.10.1-alpine3.7", "alpine:3.7"]`. + CacheFrom []string `yaml:"cacheFrom,omitempty"` + + // NoCache used to pass in --no-cache to docker build to prevent caching. + NoCache bool `yaml:"noCache,omitempty"` +} + +// BazelArtifact describes an artifact built with [Bazel](https://bazel.build/). +type BazelArtifact struct { + // BuildTarget is the `bazel build` target to run. + // For example: `//:skaffold_example.tar`. + BuildTarget string `yaml:"target,omitempty" yamltags:"required"` + + // BuildArgs are additional args to pass to `bazel build`. + // For example: `["-flag", "--otherflag"]`. + BuildArgs []string `yaml:"args,omitempty"` +} + +// JibArtifact builds images using the +// [Jib plugins for Maven and Gradle](https://github.com/GoogleContainerTools/jib/). +type JibArtifact struct { + // Project selects which sub-project to build for multi-module builds. + Project string `yaml:"project,omitempty"` + + // Flags are additional build flags passed to the builder. + // For example: `["--no-build-cache"]`. + Flags []string `yaml:"args,omitempty"` + + // Type the Jib builder type; normally determined automatically. Valid types are + // `maven`: for Maven. + // `gradle`: for Gradle. + Type string `yaml:"type,omitempty"` +} diff --git a/pkg/skaffold/schema/v2beta3/upgrade.go b/pkg/skaffold/schema/v2beta3/upgrade.go new file mode 100755 index 00000000000..3b10b102d80 --- /dev/null +++ b/pkg/skaffold/schema/v2beta3/upgrade.go @@ -0,0 +1,41 @@ +/* +Copyright 2019 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v2beta3 + +import ( + next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/util" + pkgutil "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" +) + +// Upgrade upgrades a configuration to the next version. +// Config changes from v2beta3 to v2beta4 +// 1. Additions: +// 2. Removals: +// 3. Updates: +func (c *SkaffoldConfig) Upgrade() (util.VersionedConfig, error) { + var newConfig next.SkaffoldConfig + pkgutil.CloneThroughJSON(c, &newConfig) + newConfig.APIVersion = next.Version + + err := util.UpgradePipelines(c, &newConfig, upgradeOnePipeline) + return &newConfig, err +} + +func upgradeOnePipeline(_, _ interface{}) error { + return nil +} diff --git a/pkg/skaffold/schema/v2beta3/upgrade_test.go b/pkg/skaffold/schema/v2beta3/upgrade_test.go new file mode 100755 index 00000000000..3fefa1c7775 --- /dev/null +++ b/pkg/skaffold/schema/v2beta3/upgrade_test.go @@ -0,0 +1,174 @@ +/* +Copyright 2019 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v2beta3 + +import ( + "testing" + + yaml "gopkg.in/yaml.v2" + + next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" + "github.com/GoogleContainerTools/skaffold/testutil" +) + +func TestUpgrade(t *testing.T) { + yaml := `apiVersion: skaffold/v2beta3 +kind: Config +build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + docker: + dockerfile: path/to/Dockerfile + - image: gcr.io/k8s-skaffold/bazel + bazel: + target: //mytarget + - image: gcr.io/k8s-skaffold/jib-maven + jib: + args: ['-v', '--activate-profiles', 'prof'] + project: dir + - image: gcr.io/k8s-skaffold/jib-gradle + jib: + args: ['-v'] + googleCloudBuild: + projectId: test-project +test: + - image: gcr.io/k8s-skaffold/skaffold-example + structureTests: + - ./test/* +deploy: + kubectl: + manifests: + - k8s-* + kustomize: + paths: + - kustomization-main +profiles: + - name: test profile + build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + kaniko: + cache: {} + cluster: + pullSecretName: e2esecret + namespace: default + test: + - image: gcr.io/k8s-skaffold/skaffold-example + structureTests: + - ./test/* + deploy: + kubectl: + manifests: + - k8s-* + kustomize: + paths: + - kustomization-test + - name: test local + build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + docker: + dockerfile: path/to/Dockerfile + local: + push: false + deploy: + kubectl: + manifests: + - k8s-* + kustomize: {} +` + expected := `apiVersion: skaffold/v2beta4 +kind: Config +build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + docker: + dockerfile: path/to/Dockerfile + - image: gcr.io/k8s-skaffold/bazel + bazel: + target: //mytarget + - image: gcr.io/k8s-skaffold/jib-maven + jib: + args: ['-v', '--activate-profiles', 'prof'] + project: dir + - image: gcr.io/k8s-skaffold/jib-gradle + jib: + args: ['-v'] + googleCloudBuild: + projectId: test-project +test: + - image: gcr.io/k8s-skaffold/skaffold-example + structureTests: + - ./test/* +deploy: + kubectl: + manifests: + - k8s-* + kustomize: + paths: + - kustomization-main +profiles: + - name: test profile + build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + kaniko: + cache: {} + cluster: + pullSecretName: e2esecret + namespace: default + test: + - image: gcr.io/k8s-skaffold/skaffold-example + structureTests: + - ./test/* + deploy: + kubectl: + manifests: + - k8s-* + kustomize: + paths: + - kustomization-test + - name: test local + build: + artifacts: + - image: gcr.io/k8s-skaffold/skaffold-example + docker: + dockerfile: path/to/Dockerfile + local: + push: false + deploy: + kubectl: + manifests: + - k8s-* + kustomize: {} +` + verifyUpgrade(t, yaml, expected) +} + +func verifyUpgrade(t *testing.T, input, output string) { + config := NewSkaffoldConfig() + err := yaml.UnmarshalStrict([]byte(input), config) + testutil.CheckErrorAndDeepEqual(t, false, err, Version, config.GetVersion()) + + upgraded, err := config.Upgrade() + testutil.CheckError(t, false, err) + + expected := next.NewSkaffoldConfig() + err = yaml.UnmarshalStrict([]byte(output), expected) + + testutil.CheckErrorAndDeepEqual(t, false, err, expected, upgraded) +} diff --git a/pkg/skaffold/schema/versions.go b/pkg/skaffold/schema/versions.go index 0acce8ad03b..d63b0a56862 100644 --- a/pkg/skaffold/schema/versions.go +++ b/pkg/skaffold/schema/versions.go @@ -58,6 +58,7 @@ import ( "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2alpha4" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2beta1" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2beta2" + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2beta3" misc "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" ) @@ -95,6 +96,7 @@ var SchemaVersions = Versions{ {v2alpha4.Version, v2alpha4.NewSkaffoldConfig}, {v2beta1.Version, v2beta1.NewSkaffoldConfig}, {v2beta2.Version, v2beta2.NewSkaffoldConfig}, + {v2beta3.Version, v2beta3.NewSkaffoldConfig}, {latest.Version, latest.NewSkaffoldConfig}, } From 7dc4557d98245ecf6acfae1803634371cf16311f Mon Sep 17 00:00:00 2001 From: David Hovey Date: Wed, 27 May 2020 11:41:49 -0700 Subject: [PATCH 10/11] updated schema --- docs/content/en/schemas/v2beta3.json | 14 ++++---------- docs/content/en/schemas/v2beta5.json | 14 ++++++++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/content/en/schemas/v2beta3.json b/docs/content/en/schemas/v2beta3.json index c80a6e17191..de13d941b66 100755 --- a/docs/content/en/schemas/v2beta3.json +++ b/docs/content/en/schemas/v2beta3.json @@ -1241,8 +1241,8 @@ }, "remote": { "type": "boolean", - "description": "specifies whether the chart path is remote, or exists on the host filesystem.", - "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem.", + "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true`.", + "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true.", "default": "false" }, "setFiles": { @@ -1274,15 +1274,10 @@ }, "skipBuildDependencies": { "type": "boolean", - "description": "should build dependencies be skipped. Ignored when `remote: true`.", - "x-intellij-html-description": "should build dependencies be skipped. Ignored when remote: true.", + "description": "should build dependencies be skipped.", + "x-intellij-html-description": "should build dependencies be skipped.", "default": "false" }, - "upgradeOnChange": { - "type": "boolean", - "description": "specifies whether to upgrade helm chart on code changes. Default is `true` when helm chart is local (`remote: false`). Default is `false` if `remote: true`.", - "x-intellij-html-description": "specifies whether to upgrade helm chart on code changes. Default is true when helm chart is local (remote: false). Default is false if remote: true." - }, "useHelmSecrets": { "type": "boolean", "description": "instructs skaffold to use secrets plugin on deployment.", @@ -1334,7 +1329,6 @@ "skipBuildDependencies", "useHelmSecrets", "remote", - "upgradeOnChange", "overrides", "packaged", "imageStrategy" diff --git a/docs/content/en/schemas/v2beta5.json b/docs/content/en/schemas/v2beta5.json index b9a8d4ddf81..51dcf65230b 100755 --- a/docs/content/en/schemas/v2beta5.json +++ b/docs/content/en/schemas/v2beta5.json @@ -1250,8 +1250,8 @@ }, "remote": { "type": "boolean", - "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true`.", - "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true.", + "description": "specifies whether the chart path is remote, or exists on the host filesystem.", + "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem.", "default": "false" }, "setFiles": { @@ -1283,10 +1283,15 @@ }, "skipBuildDependencies": { "type": "boolean", - "description": "should build dependencies be skipped.", - "x-intellij-html-description": "should build dependencies be skipped.", + "description": "should build dependencies be skipped. Ignored when `remote: true`.", + "x-intellij-html-description": "should build dependencies be skipped. Ignored when remote: true.", "default": "false" }, + "upgradeOnChange": { + "type": "boolean", + "description": "specifies whether to upgrade helm chart on code changes. Default is `true` when helm chart is local (`remote: false`). Default is `false` if `remote: true`.", + "x-intellij-html-description": "specifies whether to upgrade helm chart on code changes. Default is true when helm chart is local (remote: false). Default is false if remote: true." + }, "useHelmSecrets": { "type": "boolean", "description": "instructs skaffold to use secrets plugin on deployment.", @@ -1329,6 +1334,7 @@ "skipBuildDependencies", "useHelmSecrets", "remote", + "upgradeOnChange", "overrides", "packaged", "imageStrategy" From a659e91832c2a7fa2f47a1a5bf4a7b3441496082 Mon Sep 17 00:00:00 2001 From: David Hovey Date: Wed, 27 May 2020 11:46:42 -0700 Subject: [PATCH 11/11] Adding merged changes --- docs/config.toml | 4 - docs/content/en/docs/references/cli/_index.md | 4 - docs/content/en/schemas/v2beta4.json | 49 ------- integration/examples/bazel/skaffold.yaml | 4 - .../examples/buildpacks-node/skaffold.yaml | 4 - integration/examples/buildpacks/skaffold.yaml | 4 - integration/examples/custom/skaffold.yaml | 4 - integration/examples/gcb-kaniko/skaffold.yaml | 4 - .../examples/generate-pipeline/skaffold.yaml | 4 - .../getting-started-kustomize/skaffold.yaml | 4 - .../examples/getting-started/skaffold.yaml | 4 - .../examples/google-cloud-build/skaffold.yaml | 4 - .../skaffold.yaml | 4 - .../examples/helm-deployment/skaffold.yaml | 4 - integration/examples/hot-reload/skaffold.yaml | 4 - integration/examples/jib-gradle/skaffold.yaml | 4 - .../examples/jib-multimodule/skaffold.yaml | 4 - integration/examples/jib/skaffold.yaml | 4 - integration/examples/kaniko/skaffold.yaml | 4 - integration/examples/kustomize/skaffold.yaml | 4 - .../examples/microservices/skaffold.yaml | 4 - integration/examples/nodejs/skaffold.yaml | 4 - .../examples/profile-patches/skaffold.yaml | 4 - integration/examples/profiles/skaffold.yaml | 4 - .../examples/react-reload/skaffold.yaml | 4 - integration/examples/ruby/skaffold.yaml | 4 - .../examples/structure-tests/skaffold.yaml | 4 - .../skaffold.yaml | 4 - integration/testdata/build/skaffold.yaml | 4 - integration/testdata/debug/skaffold.yaml | 4 - .../testdata/deploy-multiple/skaffold.yaml | 4 - integration/testdata/dev/skaffold.yaml | 4 - .../testdata/gke_loadbalancer/skaffold.yaml | 4 - integration/testdata/hello/skaffold.yaml | 4 - .../testdata/init/compose/skaffold.yaml | 4 - integration/testdata/jib-sync/skaffold.yaml | 4 - integration/testdata/jib/skaffold.yaml | 4 - .../kaniko-explicit-repo/skaffold.yaml | 4 - .../app/skaffold.yaml | 4 - .../kaniko-insecure-registry/skaffold.yaml | 4 - .../kaniko-microservices/skaffold.yaml | 4 - .../testdata/kaniko-sub-folder/skaffold.yaml | 4 - .../testdata/kaniko-target/skaffold.yaml | 4 - integration/testdata/tagPolicy/skaffold.yaml | 4 - .../testdata/init/allcli/skaffold.yaml | 4 - .../getting-started-kustomize/skaffold.yaml | 4 - .../init/hello-no-manifest/skaffold.yaml | 4 - .../testdata/init/hello/skaffold.yaml | 4 - .../testdata/init/ignore-tags/skaffold.yaml | 4 - .../testdata/init/microservices/skaffold.yaml | 4 - pkg/skaffold/schema/latest/config.go | 4 - pkg/skaffold/schema/v2beta3/upgrade.go | 16 --- pkg/skaffold/schema/v2beta3/upgrade_test.go | 135 ------------------ pkg/skaffold/schema/versions.go | 6 - 54 files changed, 406 deletions(-) diff --git a/docs/config.toml b/docs/config.toml index d72b843de6e..1a5dae054f3 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -82,11 +82,7 @@ weight = 1 copyright = "Skaffold Authors" privacy_policy = "https://policies.google.com/privacy" github_repo = "https://github.com/GoogleContainerTools/skaffold" -<<<<<<< HEAD skaffold_version = "skaffold/v2beta5" -======= -skaffold_version = "skaffold/v2beta4" ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 # Google Custom Search Engine ID. Remove or comment out to disable search. gcs_engine_id = "013756393218025596041:3nojel67sum" diff --git a/docs/content/en/docs/references/cli/_index.md b/docs/content/en/docs/references/cli/_index.md index 31b816446cc..5772e974487 100644 --- a/docs/content/en/docs/references/cli/_index.md +++ b/docs/content/en/docs/references/cli/_index.md @@ -626,11 +626,7 @@ Examples: Options: -f, --filename='skaffold.yaml': Path or URL to the Skaffold config file --overwrite=false: Overwrite original config with fixed config -<<<<<<< HEAD --version='skaffold/v2beta5': Target schema version to upgrade to -======= - --version='skaffold/v2beta4': Target schema version to upgrade to ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 Usage: skaffold fix [options] diff --git a/docs/content/en/schemas/v2beta4.json b/docs/content/en/schemas/v2beta4.json index 2e8d701bae4..b9a8d4ddf81 100755 --- a/docs/content/en/schemas/v2beta4.json +++ b/docs/content/en/schemas/v2beta4.json @@ -1204,7 +1204,6 @@ "chartPath" ], "properties": { -<<<<<<< HEAD "artifactOverrides": { "additionalProperties": { "type": "string" @@ -1214,8 +1213,6 @@ "x-intellij-html-description": "key value pairs where key represents the parameter used in values file to define a container image and value corresponds to artifact i.e. ImageName defined in Build.Artifacts section.", "default": "{}" }, -======= ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 "chartPath": { "type": "string", "description": "path to the Helm chart.", @@ -1253,13 +1250,8 @@ }, "remote": { "type": "boolean", -<<<<<<< HEAD "description": "specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true`.", "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem. remote: true implies skipBuildDependencies: true.", -======= - "description": "specifies whether the chart path is remote, or exists on the host filesystem.", - "x-intellij-html-description": "specifies whether the chart path is remote, or exists on the host filesystem.", ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 "default": "false" }, "setFiles": { @@ -1291,40 +1283,16 @@ }, "skipBuildDependencies": { "type": "boolean", -<<<<<<< HEAD "description": "should build dependencies be skipped.", "x-intellij-html-description": "should build dependencies be skipped.", "default": "false" }, -======= - "description": "should build dependencies be skipped. Ignored when `remote: true`.", - "x-intellij-html-description": "should build dependencies be skipped. Ignored when remote: true.", - "default": "false" - }, - "upgradeOnChange": { - "type": "boolean", - "description": "specifies whether to upgrade helm chart on code changes. Default is `true` when helm chart is local (`remote: false`). Default is `false` if `remote: true`.", - "x-intellij-html-description": "specifies whether to upgrade helm chart on code changes. Default is true when helm chart is local (remote: false). Default is false if remote: true." - }, ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 "useHelmSecrets": { "type": "boolean", "description": "instructs skaffold to use secrets plugin on deployment.", "x-intellij-html-description": "instructs skaffold to use secrets plugin on deployment.", "default": "false" }, -<<<<<<< HEAD -======= - "values": { - "additionalProperties": { - "type": "string" - }, - "type": "object", - "description": "key-value pairs supplementing the Helm `values` file.", - "x-intellij-html-description": "key-value pairs supplementing the Helm values file.", - "default": "{}" - }, ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 "valuesFiles": { "items": { "type": "string" @@ -1350,11 +1318,7 @@ "name", "chartPath", "valuesFiles", -<<<<<<< HEAD "artifactOverrides", -======= - "values", ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 "namespace", "version", "setValues", @@ -1365,10 +1329,6 @@ "skipBuildDependencies", "useHelmSecrets", "remote", -<<<<<<< HEAD -======= - "upgradeOnChange", ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 "overrides", "packaged", "imageStrategy" @@ -1838,21 +1798,12 @@ }, "preferredOrder": [ "name", -<<<<<<< HEAD "activation", "patches", "build", "test", "deploy", "portForward" -======= - "build", - "test", - "deploy", - "portForward", - "patches", - "activation" ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 ], "additionalProperties": false, "description": "used to override any `build`, `test` or `deploy` configuration.", diff --git a/integration/examples/bazel/skaffold.yaml b/integration/examples/bazel/skaffold.yaml index 4a11dda0e96..5e6e6b541f5 100644 --- a/integration/examples/bazel/skaffold.yaml +++ b/integration/examples/bazel/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/buildpacks-node/skaffold.yaml b/integration/examples/buildpacks-node/skaffold.yaml index 48e1beff16f..97ac5ad956c 100644 --- a/integration/examples/buildpacks-node/skaffold.yaml +++ b/integration/examples/buildpacks-node/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/buildpacks/skaffold.yaml b/integration/examples/buildpacks/skaffold.yaml index cf5995bc6cd..5e32b3bbfdf 100644 --- a/integration/examples/buildpacks/skaffold.yaml +++ b/integration/examples/buildpacks/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/custom/skaffold.yaml b/integration/examples/custom/skaffold.yaml index 6c5d1e386f2..39c483f76ce 100644 --- a/integration/examples/custom/skaffold.yaml +++ b/integration/examples/custom/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/gcb-kaniko/skaffold.yaml b/integration/examples/gcb-kaniko/skaffold.yaml index 1b1180ad37c..1bc1ea92ba0 100644 --- a/integration/examples/gcb-kaniko/skaffold.yaml +++ b/integration/examples/gcb-kaniko/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: googleCloudBuild: diff --git a/integration/examples/generate-pipeline/skaffold.yaml b/integration/examples/generate-pipeline/skaffold.yaml index 7e5d43a2087..a8c067666f5 100644 --- a/integration/examples/generate-pipeline/skaffold.yaml +++ b/integration/examples/generate-pipeline/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/getting-started-kustomize/skaffold.yaml b/integration/examples/getting-started-kustomize/skaffold.yaml index e8bc4d3c422..46fdd59384f 100644 --- a/integration/examples/getting-started-kustomize/skaffold.yaml +++ b/integration/examples/getting-started-kustomize/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config metadata: name: getting-started-kustomize diff --git a/integration/examples/getting-started/skaffold.yaml b/integration/examples/getting-started/skaffold.yaml index a702d69e3c0..cbf95a1a7a6 100644 --- a/integration/examples/getting-started/skaffold.yaml +++ b/integration/examples/getting-started/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/google-cloud-build/skaffold.yaml b/integration/examples/google-cloud-build/skaffold.yaml index 107c0d97633..e184470c972 100644 --- a/integration/examples/google-cloud-build/skaffold.yaml +++ b/integration/examples/google-cloud-build/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: googleCloudBuild: diff --git a/integration/examples/helm-deployment-dependencies/skaffold.yaml b/integration/examples/helm-deployment-dependencies/skaffold.yaml index 32698dfb8f4..bc03bffe500 100644 --- a/integration/examples/helm-deployment-dependencies/skaffold.yaml +++ b/integration/examples/helm-deployment-dependencies/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: tagPolicy: diff --git a/integration/examples/helm-deployment/skaffold.yaml b/integration/examples/helm-deployment/skaffold.yaml index 7872bf78e66..11a765e449e 100644 --- a/integration/examples/helm-deployment/skaffold.yaml +++ b/integration/examples/helm-deployment/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/hot-reload/skaffold.yaml b/integration/examples/hot-reload/skaffold.yaml index c81a8056e56..7f37ce5ca7e 100644 --- a/integration/examples/hot-reload/skaffold.yaml +++ b/integration/examples/hot-reload/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/jib-gradle/skaffold.yaml b/integration/examples/jib-gradle/skaffold.yaml index a8195af320f..9e4044a66f0 100644 --- a/integration/examples/jib-gradle/skaffold.yaml +++ b/integration/examples/jib-gradle/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/jib-multimodule/skaffold.yaml b/integration/examples/jib-multimodule/skaffold.yaml index 4f2ffc0e857..59a15b369ac 100644 --- a/integration/examples/jib-multimodule/skaffold.yaml +++ b/integration/examples/jib-multimodule/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/jib/skaffold.yaml b/integration/examples/jib/skaffold.yaml index f4545bff32e..4d2d0fc9bc6 100644 --- a/integration/examples/jib/skaffold.yaml +++ b/integration/examples/jib/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/kaniko/skaffold.yaml b/integration/examples/kaniko/skaffold.yaml index b312afe9674..9da8dbb8e05 100644 --- a/integration/examples/kaniko/skaffold.yaml +++ b/integration/examples/kaniko/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/kustomize/skaffold.yaml b/integration/examples/kustomize/skaffold.yaml index 61868a3d404..0e6a43e3a59 100644 --- a/integration/examples/kustomize/skaffold.yaml +++ b/integration/examples/kustomize/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config deploy: kustomize: {} diff --git a/integration/examples/microservices/skaffold.yaml b/integration/examples/microservices/skaffold.yaml index 62f0b419bc7..482917aa3ae 100644 --- a/integration/examples/microservices/skaffold.yaml +++ b/integration/examples/microservices/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/nodejs/skaffold.yaml b/integration/examples/nodejs/skaffold.yaml index ed3e015368d..9d743d24815 100644 --- a/integration/examples/nodejs/skaffold.yaml +++ b/integration/examples/nodejs/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: diff --git a/integration/examples/profile-patches/skaffold.yaml b/integration/examples/profile-patches/skaffold.yaml index 47534e195da..88a425ad40b 100644 --- a/integration/examples/profile-patches/skaffold.yaml +++ b/integration/examples/profile-patches/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: # only build and deploy "base-service" on main profile diff --git a/integration/examples/profiles/skaffold.yaml b/integration/examples/profiles/skaffold.yaml index 343e8dc6365..10de3653cfc 100644 --- a/integration/examples/profiles/skaffold.yaml +++ b/integration/examples/profiles/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: # only build and deploy "world-service" on main profile diff --git a/integration/examples/react-reload/skaffold.yaml b/integration/examples/react-reload/skaffold.yaml index 1e87c1d1f8e..68ca9cf7c1d 100644 --- a/integration/examples/react-reload/skaffold.yaml +++ b/integration/examples/react-reload/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/ruby/skaffold.yaml b/integration/examples/ruby/skaffold.yaml index fa6cee75e4a..f4d1439c8f4 100644 --- a/integration/examples/ruby/skaffold.yaml +++ b/integration/examples/ruby/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/structure-tests/skaffold.yaml b/integration/examples/structure-tests/skaffold.yaml index 1f1669c219f..1e504414ada 100644 --- a/integration/examples/structure-tests/skaffold.yaml +++ b/integration/examples/structure-tests/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/examples/tagging-with-environment-variables/skaffold.yaml b/integration/examples/tagging-with-environment-variables/skaffold.yaml index 1d3a24b5887..d2ea69d50f0 100644 --- a/integration/examples/tagging-with-environment-variables/skaffold.yaml +++ b/integration/examples/tagging-with-environment-variables/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/build/skaffold.yaml b/integration/testdata/build/skaffold.yaml index 27ad751da03..6f90aa8cf66 100644 --- a/integration/testdata/build/skaffold.yaml +++ b/integration/testdata/build/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: local: diff --git a/integration/testdata/debug/skaffold.yaml b/integration/testdata/debug/skaffold.yaml index 90dcba9eca7..eb66712619e 100644 --- a/integration/testdata/debug/skaffold.yaml +++ b/integration/testdata/debug/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/deploy-multiple/skaffold.yaml b/integration/testdata/deploy-multiple/skaffold.yaml index f8caf22588d..383588f32c3 100644 --- a/integration/testdata/deploy-multiple/skaffold.yaml +++ b/integration/testdata/deploy-multiple/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/dev/skaffold.yaml b/integration/testdata/dev/skaffold.yaml index 4fc32bdfea7..98f8671a687 100644 --- a/integration/testdata/dev/skaffold.yaml +++ b/integration/testdata/dev/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/gke_loadbalancer/skaffold.yaml b/integration/testdata/gke_loadbalancer/skaffold.yaml index dd0184239d0..0e72a356acf 100644 --- a/integration/testdata/gke_loadbalancer/skaffold.yaml +++ b/integration/testdata/gke_loadbalancer/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/hello/skaffold.yaml b/integration/testdata/hello/skaffold.yaml index 8cb135700f7..2f9f05dd1dc 100644 --- a/integration/testdata/hello/skaffold.yaml +++ b/integration/testdata/hello/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/init/compose/skaffold.yaml b/integration/testdata/init/compose/skaffold.yaml index 262fcb4daba..aa270131933 100644 --- a/integration/testdata/init/compose/skaffold.yaml +++ b/integration/testdata/init/compose/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config metadata: name: compose diff --git a/integration/testdata/jib-sync/skaffold.yaml b/integration/testdata/jib-sync/skaffold.yaml index 941354852a9..24f4fefd77e 100644 --- a/integration/testdata/jib-sync/skaffold.yaml +++ b/integration/testdata/jib-sync/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/jib/skaffold.yaml b/integration/testdata/jib/skaffold.yaml index 9583dc6fd4d..d3c897031a5 100644 --- a/integration/testdata/jib/skaffold.yaml +++ b/integration/testdata/jib/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-explicit-repo/skaffold.yaml b/integration/testdata/kaniko-explicit-repo/skaffold.yaml index d7e3c3e0481..2bac16aedaa 100644 --- a/integration/testdata/kaniko-explicit-repo/skaffold.yaml +++ b/integration/testdata/kaniko-explicit-repo/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml b/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml index a702d69e3c0..cbf95a1a7a6 100644 --- a/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml +++ b/integration/testdata/kaniko-insecure-registry/app/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-insecure-registry/skaffold.yaml b/integration/testdata/kaniko-insecure-registry/skaffold.yaml index 4a4a0e81605..663ac85d80a 100644 --- a/integration/testdata/kaniko-insecure-registry/skaffold.yaml +++ b/integration/testdata/kaniko-insecure-registry/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config profiles: - name: build-artifact diff --git a/integration/testdata/kaniko-microservices/skaffold.yaml b/integration/testdata/kaniko-microservices/skaffold.yaml index 9559bfb8446..8c5c03943ed 100644 --- a/integration/testdata/kaniko-microservices/skaffold.yaml +++ b/integration/testdata/kaniko-microservices/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-sub-folder/skaffold.yaml b/integration/testdata/kaniko-sub-folder/skaffold.yaml index 4d025864468..bdaa651ff09 100644 --- a/integration/testdata/kaniko-sub-folder/skaffold.yaml +++ b/integration/testdata/kaniko-sub-folder/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/kaniko-target/skaffold.yaml b/integration/testdata/kaniko-target/skaffold.yaml index ec2b4afcfba..d16c5f119fe 100644 --- a/integration/testdata/kaniko-target/skaffold.yaml +++ b/integration/testdata/kaniko-target/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/integration/testdata/tagPolicy/skaffold.yaml b/integration/testdata/tagPolicy/skaffold.yaml index b7e5c936488..9a7befb3797 100644 --- a/integration/testdata/tagPolicy/skaffold.yaml +++ b/integration/testdata/tagPolicy/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: diff --git a/pkg/skaffold/initializer/testdata/init/allcli/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/allcli/skaffold.yaml index 65648734911..e8bbd7cecc3 100644 --- a/pkg/skaffold/initializer/testdata/init/allcli/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/allcli/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config metadata: name: allcli diff --git a/pkg/skaffold/initializer/testdata/init/getting-started-kustomize/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/getting-started-kustomize/skaffold.yaml index e8bc4d3c422..46fdd59384f 100644 --- a/pkg/skaffold/initializer/testdata/init/getting-started-kustomize/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/getting-started-kustomize/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config metadata: name: getting-started-kustomize diff --git a/pkg/skaffold/initializer/testdata/init/hello-no-manifest/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/hello-no-manifest/skaffold.yaml index 528bd42a96b..27b453a0433 100644 --- a/pkg/skaffold/initializer/testdata/init/hello-no-manifest/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/hello-no-manifest/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config metadata: name: hello diff --git a/pkg/skaffold/initializer/testdata/init/hello/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/hello/skaffold.yaml index 528bd42a96b..27b453a0433 100644 --- a/pkg/skaffold/initializer/testdata/init/hello/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/hello/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config metadata: name: hello diff --git a/pkg/skaffold/initializer/testdata/init/ignore-tags/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/ignore-tags/skaffold.yaml index 9093908905f..ce1316d6040 100644 --- a/pkg/skaffold/initializer/testdata/init/ignore-tags/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/ignore-tags/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config metadata: name: ignore-tags diff --git a/pkg/skaffold/initializer/testdata/init/microservices/skaffold.yaml b/pkg/skaffold/initializer/testdata/init/microservices/skaffold.yaml index 2cfd1fff617..03122135054 100644 --- a/pkg/skaffold/initializer/testdata/init/microservices/skaffold.yaml +++ b/pkg/skaffold/initializer/testdata/init/microservices/skaffold.yaml @@ -1,8 +1,4 @@ -<<<<<<< HEAD apiVersion: skaffold/v2beta5 -======= -apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config metadata: name: microservices diff --git a/pkg/skaffold/schema/latest/config.go b/pkg/skaffold/schema/latest/config.go index 25cc1d5c00a..357cd22ec86 100644 --- a/pkg/skaffold/schema/latest/config.go +++ b/pkg/skaffold/schema/latest/config.go @@ -23,11 +23,7 @@ import ( ) // This config version is not yet released, it is SAFE TO MODIFY the structs in this file. -<<<<<<< HEAD const Version string = "skaffold/v2beta5" -======= -const Version string = "skaffold/v2beta4" ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 // NewSkaffoldConfig creates a SkaffoldConfig func NewSkaffoldConfig() util.VersionedConfig { diff --git a/pkg/skaffold/schema/v2beta3/upgrade.go b/pkg/skaffold/schema/v2beta3/upgrade.go index 975dc49548a..df0f7d0210e 100755 --- a/pkg/skaffold/schema/v2beta3/upgrade.go +++ b/pkg/skaffold/schema/v2beta3/upgrade.go @@ -1,9 +1,5 @@ /* -<<<<<<< HEAD Copyright 2020 The Skaffold Authors -======= -Copyright 2019 The Skaffold Authors ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,13 +17,8 @@ limitations under the License. package v2beta3 import ( -<<<<<<< HEAD "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/util" next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2beta4" -======= - next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" - "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/util" ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 pkgutil "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" ) @@ -36,10 +27,7 @@ import ( // 1. Additions: // 2. Removals: // 3. Updates: -<<<<<<< HEAD // - Rename `values` in `helm.Releases` to `artifactOverrides` -======= ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 func (c *SkaffoldConfig) Upgrade() (util.VersionedConfig, error) { var newConfig next.SkaffoldConfig pkgutil.CloneThroughJSON(c, &newConfig) @@ -49,7 +37,6 @@ func (c *SkaffoldConfig) Upgrade() (util.VersionedConfig, error) { return &newConfig, err } -<<<<<<< HEAD func upgradeOnePipeline(oldPipeline, newPipeline interface{}) error { oldDeploy := &oldPipeline.(*Pipeline).Deploy if oldDeploy.HelmDeploy == nil { @@ -60,8 +47,5 @@ func upgradeOnePipeline(oldPipeline, newPipeline interface{}) error { for i, r := range oldDeploy.HelmDeploy.Releases { newDeploy.HelmDeploy.Releases[i].ArtifactOverrides = r.Values } -======= -func upgradeOnePipeline(_, _ interface{}) error { ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 return nil } diff --git a/pkg/skaffold/schema/v2beta3/upgrade_test.go b/pkg/skaffold/schema/v2beta3/upgrade_test.go index 1748e9799ef..def13d75d0b 100755 --- a/pkg/skaffold/schema/v2beta3/upgrade_test.go +++ b/pkg/skaffold/schema/v2beta3/upgrade_test.go @@ -1,9 +1,5 @@ /* -<<<<<<< HEAD Copyright 2020 The Skaffold Authors -======= -Copyright 2019 The Skaffold Authors ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,16 +21,11 @@ import ( yaml "gopkg.in/yaml.v2" -<<<<<<< HEAD next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2beta4" -======= - next "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 "github.com/GoogleContainerTools/skaffold/testutil" ) func TestUpgrade(t *testing.T) { -<<<<<<< HEAD tests := []struct { description string yaml string @@ -43,30 +34,12 @@ func TestUpgrade(t *testing.T) { { description: "no helm deploy", yaml: `apiVersion: skaffold/v2beta3 -======= - yaml := `apiVersion: skaffold/v2beta3 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: - image: gcr.io/k8s-skaffold/skaffold-example docker: dockerfile: path/to/Dockerfile -<<<<<<< HEAD -======= - - image: gcr.io/k8s-skaffold/bazel - bazel: - target: //mytarget - - image: gcr.io/k8s-skaffold/jib-maven - jib: - args: ['-v', '--activate-profiles', 'prof'] - project: dir - - image: gcr.io/k8s-skaffold/jib-gradle - jib: - args: ['-v'] - googleCloudBuild: - projectId: test-project ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 test: - image: gcr.io/k8s-skaffold/skaffold-example structureTests: @@ -77,69 +50,14 @@ deploy: - k8s-* kustomize: paths: -<<<<<<< HEAD - kustomization-main`, expected: `apiVersion: skaffold/v2beta4 -======= - - kustomization-main -profiles: - - name: test profile - build: - artifacts: - - image: gcr.io/k8s-skaffold/skaffold-example - kaniko: - cache: {} - cluster: - pullSecretName: e2esecret - namespace: default - test: - - image: gcr.io/k8s-skaffold/skaffold-example - structureTests: - - ./test/* - deploy: - kubectl: - manifests: - - k8s-* - kustomize: - paths: - - kustomization-test - - name: test local - build: - artifacts: - - image: gcr.io/k8s-skaffold/skaffold-example - docker: - dockerfile: path/to/Dockerfile - local: - push: false - deploy: - kubectl: - manifests: - - k8s-* - kustomize: {} -` - expected := `apiVersion: skaffold/v2beta4 ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 kind: Config build: artifacts: - image: gcr.io/k8s-skaffold/skaffold-example docker: dockerfile: path/to/Dockerfile -<<<<<<< HEAD -======= - - image: gcr.io/k8s-skaffold/bazel - bazel: - target: //mytarget - - image: gcr.io/k8s-skaffold/jib-maven - jib: - args: ['-v', '--activate-profiles', 'prof'] - project: dir - - image: gcr.io/k8s-skaffold/jib-gradle - jib: - args: ['-v'] - googleCloudBuild: - projectId: test-project ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 test: - image: gcr.io/k8s-skaffold/skaffold-example structureTests: @@ -150,7 +68,6 @@ deploy: - k8s-* kustomize: paths: -<<<<<<< HEAD - kustomization-main`, }, { @@ -232,61 +149,9 @@ func verifyUpgrade(t *testutil.T, input, output string) { upgraded, err := config.Upgrade() t.CheckError(false, err) -======= - - kustomization-main -profiles: - - name: test profile - build: - artifacts: - - image: gcr.io/k8s-skaffold/skaffold-example - kaniko: - cache: {} - cluster: - pullSecretName: e2esecret - namespace: default - test: - - image: gcr.io/k8s-skaffold/skaffold-example - structureTests: - - ./test/* - deploy: - kubectl: - manifests: - - k8s-* - kustomize: - paths: - - kustomization-test - - name: test local - build: - artifacts: - - image: gcr.io/k8s-skaffold/skaffold-example - docker: - dockerfile: path/to/Dockerfile - local: - push: false - deploy: - kubectl: - manifests: - - k8s-* - kustomize: {} -` - verifyUpgrade(t, yaml, expected) -} - -func verifyUpgrade(t *testing.T, input, output string) { - config := NewSkaffoldConfig() - err := yaml.UnmarshalStrict([]byte(input), config) - testutil.CheckErrorAndDeepEqual(t, false, err, Version, config.GetVersion()) - - upgraded, err := config.Upgrade() - testutil.CheckError(t, false, err) ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 expected := next.NewSkaffoldConfig() err = yaml.UnmarshalStrict([]byte(output), expected) -<<<<<<< HEAD t.CheckErrorAndDeepEqual(false, err, expected, upgraded) -======= - testutil.CheckErrorAndDeepEqual(t, false, err, expected, upgraded) ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 } diff --git a/pkg/skaffold/schema/versions.go b/pkg/skaffold/schema/versions.go index 2c9727c4091..8c4d65be241 100644 --- a/pkg/skaffold/schema/versions.go +++ b/pkg/skaffold/schema/versions.go @@ -59,10 +59,7 @@ import ( "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2beta1" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2beta2" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2beta3" -<<<<<<< HEAD "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/v2beta4" -======= ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 misc "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" ) @@ -101,10 +98,7 @@ var SchemaVersions = Versions{ {v2beta1.Version, v2beta1.NewSkaffoldConfig}, {v2beta2.Version, v2beta2.NewSkaffoldConfig}, {v2beta3.Version, v2beta3.NewSkaffoldConfig}, -<<<<<<< HEAD {v2beta4.Version, v2beta4.NewSkaffoldConfig}, -======= ->>>>>>> d43417a8588f9c52cf717199deb05ae72757d941 {latest.Version, latest.NewSkaffoldConfig}, }