devcontainers / devcontainers/features

[Terraform] Improve `cosign` reliability

Aperta
#773 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Shell
Stelle
1.5k
Fork
621
Merge medio
6g 53m
PR unite (30g)
9

Descrizione

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).

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.