helm-kubernetes-services icon indicating copy to clipboard operation
helm-kubernetes-services copied to clipboard

Add ability to deploy image using sha256 digest, not floating label

Open tpayne opened this issue 2 years ago • 2 comments

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

run1.txt 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 or bug/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

tpayne avatar May 10 '22 12:05 tpayne

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?

autero1 avatar May 15 '22 04:05 autero1

Thanks for the comments. I'll try and add these over the next week or so.

tpayne avatar May 18 '22 17:05 tpayne