GoogleContainerTools / GoogleContainerTools/skaffold

Possible inconsistency on template variables

Open
#8,904 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

I passed the image tag and digest to env vars under (helm) `setValueTemplates` and it seems like the `IMAGE_TAG` is equal to the `IMAGE_DIGEST`, with both being the sha256 hash. It appears to be no way to pass the tag defined in the build phase into the deploy phase.

Additionally, you can verify that the tag provided on the `IMAGE_FULLY_QUALIFIED` is not the same as the one under `IMAGE_TAG`.

Please advise.

### Expected behavior

app.imageVersion: ``
app.imageDigest: ``

### Actual behavior

app.imageVersion: ``
app.imageDigest: ``

### Information

- Skaffold version: 2.5.1
- Operating system: macOS Ventura 13.4 (M2 Pro)
- Installed via: Homebrew
- Contents of skaffold.yaml:

```yaml
tagPolicy:
inputDigest: {}

...

setValueTemplates:
app.imageVersion: '{{printf "%.63s" .IMAGE_TAG15}}'
app.imageDigest: '{{printf "%.63s" .IMAGE_DIGEST15}}'
```

### Steps to reproduce the behavior

1. `skaffold run`

### Note on the docs

The issue relates to the docs on this page: https://skaffold.dev/docs/environment/templating/
- On Helm deployments it has the following:
> IMAGE_NAME, IMAGE_TAG, IMAGE_DIGEST, IMAGE_DOMAIN, IMAGE_REPO_NO_DOMAIN - the first (by order of declaration in build.artifacts) artifact’s image name, repo, tag, sha256 digest, registry/domain and repository w/o the registry/domain prefixed . Note: the [image name rewriting](https://skaffold.dev/docs/environment/image-registries/) acts after the template is calculated.

And should be:
IMAGE_NAME, **_IMAGE_REPO_**, IMAGE_TAG, ...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.