devcontainers / devcontainers/features
[Terraform] Improve `cosign` reliability
- 主要言語
- Shell
- スター
- 1.5k
- フォーク
- 621
- 平均マージ
- 6日 53分
- マージ済み PR(30日)
- 9
説明
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).
コントリビューションガイド
調査の方向性
src/terraform/install.sh、特に182-199行のensure_cosign関数を読み、リンクされた失敗したworkflowを調べて、releaseがない場合の挙動を確認してください。cosign latest tagは存在するものの、そのバイナリが利用できない期間中もTerraform Featureのインストール可能な状態が維持され、fallbackロジックまたは固定されたreleaseが使用されれば、作業は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- shell, terraform
- 領域
- devops
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 48/100