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

skaffold build -q tag does not match tagger settings #8221

Open
Blackclaws opened this issue Dec 12, 2022 · 3 comments
Open

skaffold build -q tag does not match tagger settings #8221

Blackclaws opened this issue Dec 12, 2022 · 3 comments
Labels
area/build kind/bug Something isn't working priority/p2 May take a couple of releases

Comments

@Blackclaws
Copy link

Blackclaws commented Dec 12, 2022

Expected behavior

Running

skaffold build -q

should output the actual built tag in the tag field.

Actual behavior

tag contains the sha256 id of the image

Information

  • Skaffold version: v2.0.3
  • Operating system: Ubuntu 22.04
  • Installed via: curl
  • Contents of skaffold.yaml:
apiVersion: skaffold/v3
kind: Config
metadata:
  name: test
build:
  artifacts:
    - image: "target"
  tagPolicy:
    envTemplate:
      template: "{{.VERSION}}"
  • Content of Dockerfile:
FROM alpine@sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4

Steps to reproduce the behavior

  1. VERSION=1 skaffold build
Generating tags...
 - target -> target:1
  1. VERSION=1 skaffold build -q --dry-run
{"builds":[{"imageName":"target","tag":"target:1"}]}
  1. VERSION=1 skaffold build -q
{"builds":[{"imageName":"target","tag":"target:49176f190c7e9cdb51ac85ab6c6d5e4512352218190cd69b08e6fd803ffbf3da"}]}

Seeing as the docs state:

  # Quietly build artifacts and output the image names as json
  skaffold build -q > build_result.json

I would have expected that -q outputs the tag that it actually created even if not dry running.

Fun fact, if you also include --push then the result is correct, though the sha256 digest is appended:

> VERSION=1 skaffold build --default-repo REDACTED -q --push
{"builds":[{"imageName":"target","tag":"REDACTED/target:1@sha256:c0d488a800e4127c334ad20d61d7bc21b4097540327217dfab52262adc02380c"}]}
@aaron-prindle aaron-prindle added kind/bug Something isn't working area/build priority/p2 May take a couple of releases labels Dec 22, 2022
@jceb
Copy link

jceb commented Dec 12, 2023

I'm experiencing the same issue. I tried version 1.39.2 and the same behavior exists there as well.

@shezaan
Copy link

shezaan commented Jan 18, 2024

Over a year later this is still a problem unless push is set to true.

@hcguersoy-cg
Copy link

Run into same problem here, too.
The tagPolicy configuration is ignored.
Skaffold v2.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build kind/bug Something isn't working priority/p2 May take a couple of releases
Projects
None yet
Development

No branches or pull requests

5 participants