helm-kubernetes-services
helm-kubernetes-services copied to clipboard
Add ability to deploy image using sha256 digest, not floating label
Description
This change is to allow the containerImage.tag
key to support both SHA256 digest image values as well as standard tag labels like master
or latest
.
When a SHA256 value is specified, then the _deployment_spec.tpl
will generate an image line like...
image: "nginx@sha256:15b5f7f28672bbbf26f058928b16ecb465843845fafe5ea9a06b05a590709150"
rather than...
image: "nginx:latest"
The change is fully backward compatible with existing tag usage.
Tested by running the "-tag tpl" go test scripts, plus the following...
% helm template . --set-string containerImage.repository=fred,containerImage.tag=sha256:15b5f7f28672bbbf26f058928b16ecb465843845fafe5ea9a06b05a590709150,applicationName=fred,canary.enabled=true,canary.containerImage.repository=fredx,canary.containerImage.tag=sha256:15b5f7f28672bbbf26f058928b16ecb465843845fafe5ea9a06b05a590709150 > run1.txt
% helm template . --set-string containerImage.repository=fred,containerImage.tag=latest,applicationName=fred,canary.enabled=true,canary.containerImage.repository=fredx,canary.containerImage.tag=latest > run2.txt
Documentation
Updates have been made to the helm-kubernetes-services/charts/k8s-service/README.md
to describe the change and the use-cases that you might want to use it for.
This includes a code snippet on usage.
TODOs
Please ensure all of these TODOs are completed before asking for a review.
- [x] Ensure the branch is named correctly with the issue number. e.g:
feature/new-vpc-endpoints-955
orbug/missing-count-param-434
. - [x] Update the docs.
- [x] Keep the changes backward compatible where possible.
- [x] Run the pre-commit checks successfully.
- [x] Run the relevant tests successfully.
- [x] Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
Related Issues
Thanks for the PR @tpayne! This LGTM! We should probably have a regression test for this - can you add a template test that makes sure the templates render correctly?
Thanks for the comments. I'll try and add these over the next week or so.