Skip to content

Use --set-string for helm image values#3313

Merged
balopat merged 1 commit intoGoogleContainerTools:masterfrom
michaelbeaumont:helm-set-string
Dec 18, 2019
Merged

Use --set-string for helm image values#3313
balopat merged 1 commit intoGoogleContainerTools:masterfrom
michaelbeaumont:helm-set-string

Conversation

@michaelbeaumont
Copy link
Copy Markdown
Contributor

Fixes #1992, related to helm/helm#1707

Description

This prevents helm from interpreting tags as numbers, for example, short git commits made up of numeric characters.

User facing changes

n/a

Before

helm is called with the image and tag information using something like --set image.repository=container,image.tag=5678444 causing the tag to be interpreted as a number. This leads to Pods failing with InvalidImageName:

  Warning  InspectFailed  9s (x3 over 10s)  kubelet, minikube  Failed to apply default image tag "container:5.555559e+06": couldn't parse image reference "container:5.678444e+06": invalid reference format
  Warning  Failed         9s (x3 over 10s)  kubelet, minikube  Error: InvalidImageName

After

helm is called with the image and tag information using something like --set-string image.repository=container,image.tag=5678444, preventing 5678444 from being interpreted as a float.

Next PRs.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Mentions any output changes.
  • Adds documentation as needed: user docs, YAML reference, CLI reference.
  • Adds integration tests if needed.

Reviewer Notes

  • The code flow looks good.
  • Unit test added.
  • User facing changes look good.

Release Notes

Examples of user facing changes:
- Skaffold config changes like
  e.g. "Add buildArgs to `Kustomize` deployer skaffold config."
- Bug fixes
  e.g. "Improve skaffold init behaviour when tags are used in manifests"
- Any changes in skaffold behavior
  e.g. "Artiface cachine is turned on by default."

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 27, 2019

Codecov Report

Merging #3313 into master will not change coverage.
The diff coverage is 100%.

Impacted Files Coverage Δ
pkg/skaffold/deploy/helm.go 77.33% <100%> (ø) ⬆️

@balopat balopat added the kokoro:run runs the kokoro jobs on a PR label Dec 3, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Dec 3, 2019
Fixes #1992

- Includes unit test
@balopat balopat added the kokoro:run runs the kokoro jobs on a PR label Dec 18, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Dec 18, 2019
@balopat
Copy link
Copy Markdown
Contributor

balopat commented Dec 18, 2019

I hope that this won't cause issues where people would expect typed values (booleans, integers?)?

@michaelbeaumont
Copy link
Copy Markdown
Contributor Author

I don't think so since it's only used for image.tag, image.repository, image.registry as far as I can tell. I can't imagine a case where someone expects anything but a string there.

@balopat balopat merged commit 3186964 into GoogleContainerTools:master Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skaffold not able to parse image name from git commit when commit is numeric.

4 participants