skaffold
skaffold copied to clipboard
[ko builder] Image digest is not updated when kodata files are changed
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
- Skaffold version: v2.9.0
- Operating system: Ubuntu 20.04
- Installed via: https://skaffold.dev/docs/install/
- Contents of 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
Steps to reproduce the behavior
mkdir skaffold-bugcd skaffold-bugmkdir cmd
cat << EOF > cmd/main.go
package main
func main() {
}
EOF
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
skaffold build --dry-run, remember which tag is generated
cat << EOF > cmd/kodata/test.txt
test 2
EOF
skaffold build --dry-runExpected 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).