devcontainers / devcontainers/features
[Terraform] Improve `cosign` reliability
- Dominant language
- Shell
- Stars
- 1.5k
- Forks
- 621
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 4
Description
It appears that when [cosign](https://github.com/sigstore/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`](https://github.com/devcontainers/features/blob/main/src/terraform/install.sh#L182-L199) function, or add additional fallback logic if the binaries in the `latest` tag are missing (preferred).
Contributor guide
Assessment
This issue has not been assessed yet.