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

[ko builder] Image digest is not updated when kodata files are changed #9463

Open
strowk opened this issue Jul 2, 2024 · 0 comments
Open

Comments

@strowk
Copy link

strowk commented Jul 2, 2024

If configured inputDigest and ko builder, digest is not calculated correctly.

Expected behavior

When files are present in cmd/kodata, changing them should result in a new tag.

Actual behavior

Tag is not changing.

Information

apiVersion: skaffold/v4beta7
kind: Config
metadata:
  name: skaffold-kodata-bug
build:
  tagPolicy:
    inputDigest: {}
  artifacts:
    - image: skaffold-kodata-bug
      ko:
        fromImage: gcr.io/distroless/static-debian12:nonroot
        main: ./cmd

Steps to reproduce the behavior

  1. mkdir skaffold-bug
  2. cd skaffold-bug
  3. mkdir cmd
cat << EOF > cmd/main.go
package main

func main() {
}
EOF
  1. mkdir cmd/kodata
cat << EOF > cmd/kodata/test.txt
test 1
EOF
cat << EOF > skaffold.yaml
apiVersion: skaffold/v4beta7
kind: Config
metadata:
  name: skaffold-kodata-bug
build:
  tagPolicy:
    inputDigest: {}
  artifacts:
    - image: skaffold-kodata-bug
      ko:
        fromImage: gcr.io/distroless/static-debian12:nonroot
        main: ./cmd
EOF
  1. skaffold build --dry-run , remember which tag is generated
cat << EOF > cmd/kodata/test.txt
test 2
EOF
  1. skaffold build --dry-run
    Expected different tag, actual is same.

I understand this can be bypassed by specifying dependencies, but that IMO would somewhat defeat the purpose of having inputDigest in the first place (which is supposed to be only changed when actually used sources are changed, but for this to work we would have to manually specify all reachable go packages).

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

No branches or pull requests

1 participant