kubernetes-sigs / image-builder

Tools for building Kubernetes disk images
https://image-builder.sigs.k8s.io/
Apache License 2.0
362 stars 365 forks source link

Goss tests broken on anything that does not define OS_VERSION #1075

Open hrak opened 1 year ago

hrak commented 1 year ago

What steps did you take and what happened:

Build a Flatcar image for QEMU

What did you expect to happen:

Successful goss test run

Anything else you would like to add:

This appears to be broken since #1062 was merged. This PR removes the conditional in images/capi/packer/goss/goss-package.yaml that restricted this test to ova

Goss tests now fail on anything that does not use ova/sig/vhd / does not define OS_VERSION

==> qemu: Running goss tests...
==> qemu: Running GOSS render command: cd /tmp/goss &&  /tmp/goss-0.3.16-linux-amd64 --gossfile goss/goss.yaml --vars /tmp/goss/goss-vars.yaml --vars-inline '{"ARCH":"amd64","OS":"flatcar","PROVIDER":"qemu","containerd_version":"1.6.15","kubernetes_cni_deb_version":"1.2.0-00","kubernetes_cni_rpm_version":"1.2.0","kubernetes_cni_source_type":"http","kubernetes_cni_version":"1.2.0","kubernetes_deb_version":"1.23.15-00","kubernetes_rpm_version":"1.23.15","kubernetes_source_type":"http","kubernetes_version":"1.25.6"}' render > /tmp/goss-spec.yaml
==> qemu: could not read json data in goss/goss-package.yaml: template: test:60:26: executing "test" at <.Vars.OS_VERSION>: map has no entry for key "OS_VERSION"
==> qemu: Goss render failed
==> qemu: Inspect mode on : proceeding without failing Packer
==> qemu: Running GOSS render debug command: cd /tmp/goss &&  /tmp/goss-0.3.16-linux-amd64 --gossfile goss/goss.yaml --vars /tmp/goss/goss-vars.yaml --vars-inline '{"ARCH":"amd64","OS":"flatcar","PROVIDER":"qemu","containerd_version":"1.6.15","kubernetes_cni_deb_version":"1.2.0-00","kubernetes_cni_rpm_version":"1.2.0","kubernetes_cni_source_type":"http","kubernetes_cni_version":"1.2.0","kubernetes_deb_version":"1.23.15-00","kubernetes_rpm_version":"1.23.15","kubernetes_source_type":"http","kubernetes_version":"1.25.6"}' render -d > /tmp/debug-goss-spec.yaml
==> qemu: could not read json data in goss/goss-package.yaml: template: test:60:26: executing "test" at <.Vars.OS_VERSION>: map has no entry for key "OS_VERSION"
==> qemu: Goss render debug failed
==> qemu: Inspect mode on : proceeding without failing Packer
==> qemu: Running GOSS validate command: cd /tmp/goss && sudo  /tmp/goss-0.3.16-linux-amd64 --gossfile goss/goss.yaml --vars /tmp/goss/goss-vars.yaml --vars-inline '{"ARCH":"amd64","OS":"flatcar","PROVIDER":"qemu","containerd_version":"1.6.15","kubernetes_cni_deb_version":"1.2.0-00","kubernetes_cni_rpm_version":"1.2.0","kubernetes_cni_source_type":"http","kubernetes_cni_version":"1.2.0","kubernetes_deb_version":"1.23.15-00","kubernetes_rpm_version":"1.23.15","kubernetes_source_type":"http","kubernetes_version":"1.25.6"}' validate --retry-timeout 0s --sleep 1s -f json -o pretty
    qemu: Error: could not read json data in goss/goss-package.yaml: template: test:60:26: executing "test" at <.Vars.OS_VERSION>: map has no entry for key "OS_VERSION"
==> qemu: Goss validate failed

/kind bug [One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]

sirhopcount commented 1 year ago

Ran into the same issue when building build-qemu-ubuntu-2004

==> qemu: could not read json data in goss/goss-package.yaml: template: test:60:26: executing "test" at <.Vars.OS_VERSION>: map has no entry for key "OS_VERSION"
==> qemu: Goss render failed
k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

hrak commented 7 months ago

/remove-lifecycle stale