features icon indicating copy to clipboard operation
features copied to clipboard

[Terraform] Improve `cosign` reliability

Open joshspicer opened this issue 2 years ago • 0 comments

It appears that when cosign is updated there is a short period of time where the tag is pushed but the underlying binaries are not present on the release. This causes a period of time where the installation of the terraform Feature fails:

Eg: https://github.com/devcontainers/features/actions/runs/7105913963/job/19344285357#step:4:656

18.62 Installing cosign...

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
19.38 
100     9  100     9    0     0     22      0 --:--:-- --:--:-- --:--:--    22
19.38 dpkg-deb: error: '/tmp/cosign_2.2.2_amd64.deb' is not a Debian format archive
19.38 dpkg: error processing archive /tmp/cosign_2.2.2_amd64.deb (--install):
19.38  dpkg-deb --control subprocess returned error exit status 2
19.39 Errors were encountered while processing:
19.39  /tmp/cosign_2.2.2_amd64.deb
19.39 ERROR: Feature "Terraform, tflint, and TFGrunt" (Unknown) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/terraform for help troubleshooting this error.

The issue in this case resolved within an hour, but it's long enough and high enough visibility that we should patch our Feature to be resilient in this instance.

To fix, either pin to a specific release in the ensure_cosign function, or add additional fallback logic if the binaries in the latest tag are missing (preferred).

joshspicer avatar Dec 05 '23 21:12 joshspicer