Skip to content

Commit

Permalink
Clarify usage of ArtifactOverrides, ImageStrategy (#4487)
Browse files Browse the repository at this point in the history
* Clarify usage of ArtifactOverrides, ImageStrategy

ArtifactOverrides was incorrectly claiming it needed "values file" syntax, i.e. structured YAML, but it actually takes `--set-string` syntax, i.e. dotted path.

Also tied ArtifactOverrides directly to `ImageStrategy`, since the two work together.

Signed-off-by: Paul "Hampy" Hampson <[email protected]>

* Remove duplicated omitempty tag

Signed-off-by: Paul "Hampy" Hampson <[email protected]>
  • Loading branch information
TBBle authored Sep 10, 2020
1 parent ab91350 commit 677d665
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/content/en/schemas/v2beta6.json
Original file line number Diff line number Diff line change
Expand Up @@ -1279,8 +1279,8 @@
],
"properties": {
"artifactOverrides": {
"description": "key value pairs. If present, Skaffold will send `--set-string` flag to Helm CLI and append all pairs after the flag.",
"x-intellij-html-description": "key value pairs. If present, Skaffold will send <code>--set-string</code> flag to Helm CLI and append all pairs after the flag."
"description": "key value pairs where the key represents the parameter used in the `--set-string` Helm CLI flag to define a container image and the value corresponds to artifact i.e. `ImageName` defined in `Build.Artifacts` section. The resulting command-line is controlled by `ImageStrategy`.",
"x-intellij-html-description": "key value pairs where the key represents the parameter used in the <code>--set-string</code> Helm CLI flag to define a container image and the value corresponds to artifact i.e. <code>ImageName</code> defined in <code>Build.Artifacts</code> section. The resulting command-line is controlled by <code>ImageStrategy</code>."
},
"chartPath": {
"type": "string",
Expand All @@ -1289,8 +1289,8 @@
},
"imageStrategy": {
"$ref": "#/definitions/HelmImageStrategy",
"description": "adds image configurations to the Helm `values` file.",
"x-intellij-html-description": "adds image configurations to the Helm <code>values</code> file."
"description": "controls how an `ArtifactOverrides` entry is turned into `--set-string` Helm CLI flag or flags.",
"x-intellij-html-description": "controls how an <code>ArtifactOverrides</code> entry is turned into <code>--set-string</code> Helm CLI flag or flags."
},
"name": {
"type": "string",
Expand Down
11 changes: 7 additions & 4 deletions pkg/skaffold/schema/latest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,11 @@ type HelmRelease struct {
// ValuesFiles are the paths to the Helm `values` files.
ValuesFiles []string `yaml:"valuesFiles,omitempty"`

// ArtifactOverrides are key value pairs.
// If present, Skaffold will send `--set-string` flag to Helm CLI and append all pairs after the flag.
ArtifactOverrides util.FlatMap `yaml:"artifactOverrides,omitempty,omitempty"`
// ArtifactOverrides are key value pairs where the
// key represents the parameter used in the `--set-string` Helm CLI flag to define a container
// image and the value corresponds to artifact i.e. `ImageName` defined in `Build.Artifacts` section.
// The resulting command-line is controlled by `ImageStrategy`.
ArtifactOverrides util.FlatMap `yaml:"artifactOverrides,omitempty"`

// Namespace is the Kubernetes namespace.
Namespace string `yaml:"namespace,omitempty"`
Expand Down Expand Up @@ -660,7 +662,8 @@ type HelmRelease struct {
// Packaged parameters for packaging helm chart (`helm package`).
Packaged *HelmPackaged `yaml:"packaged,omitempty"`

// ImageStrategy adds image configurations to the Helm `values` file.
// ImageStrategy controls how an `ArtifactOverrides` entry is
// turned into `--set-string` Helm CLI flag or flags.
ImageStrategy HelmImageStrategy `yaml:"imageStrategy,omitempty"`
}

Expand Down

0 comments on commit 677d665

Please sign in to comment.