Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tpayne
Copy link

@tpayne tpayne commented May 10, 2022

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.

  • Ensure the branch is named correctly with the issue number. e.g: feature/new-vpc-endpoints-955 or bug/missing-count-param-434.
  • Update the docs.
  • Keep the changes backward compatible where possible.
  • Run the pre-commit checks successfully.
  • Run the relevant tests successfully.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.

Related Issues

@autero1
Copy link
Contributor

autero1 commented May 15, 2022

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?

@tpayne
Copy link
Author

tpayne commented May 18, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants