Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Some Alpine-based packages must be locked when building with terraform

オープン
#33 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
terraform

調査の方向性

Start by reproducing the Alpine package configuration with terraform apply and inspect .terraform/modules/latest.this/main.tf at line 72, where the Invalid index error is reported. Trace how unpinned packages are represented before that expression runs. Done means the configuration completes without the Invalid index errors while retaining package locking behavior.

索引モデルが issue の本文から書いたものです。

説明

With the following config (alpine-base):

contents:
  packages:
    - alpine-baselayout-data
    - alpine-release
    - apk-tools
    - busybox
    - libc-utils

on terraform apply, we get the following obscure error:

╷
│ Warning: unable to lock certain packages
│ 
│   with module.latest.module.this.data.apko_config.this,
│   on .terraform/modules/latest.this/main.tf line 17, in data "apko_config" "this":
│   17: data "apko_config" "this" {
│ 
│ [alpine-release]
╵
╷
│ Warning: unable to lock certain packages for 386
│ 
│   with module.latest.module.this.data.apko_config.this,
│   on .terraform/modules/latest.this/main.tf line 17, in data "apko_config" "this":
│   17: data "apko_config" "this" {
│ 
│ [libcrypto3 libssl3 musl musl-utils]
╵
╷
│ Warning: unable to lock certain packages for amd64
│ 
│   with module.latest.module.this.data.apko_config.this,
│   on .terraform/modules/latest.this/main.tf line 17, in data "apko_config" "this":
│   17: data "apko_config" "this" {
│ 
│ [libcrypto3 libssl3 musl musl-utils]
╵
╷
│ Warning: unable to lock certain packages for arm/v6
│ 
│   with module.latest.module.this.data.apko_config.this,
│   on .terraform/modules/latest.this/main.tf line 17, in data "apko_config" "this":
│   17: data "apko_config" "this" {
│ 
│ [libcrypto3 libssl3 musl musl-utils]
╵
╷
│ Warning: unable to lock certain packages for arm/v7
│ 
│   with module.latest.module.this.data.apko_config.this,
│   on .terraform/modules/latest.this/main.tf line 17, in data "apko_config" "this":
│   17: data "apko_config" "this" {
│ 
│ [libcrypto3 libssl3 musl musl-utils]
╵
╷
│ Warning: unable to lock certain packages for arm64
│ 
│   with module.latest.module.this.data.apko_config.this,
│   on .terraform/modules/latest.this/main.tf line 17, in data "apko_config" "this":
│   17: data "apko_config" "this" {
│ 
│ [libcrypto3 libssl3 musl musl-utils]
╵
╷
│ Warning: unable to lock certain packages for ppc64le
│ 
│   with module.latest.module.this.data.apko_config.this,
│   on .terraform/modules/latest.this/main.tf line 17, in data "apko_config" "this":
│   17: data "apko_config" "this" {
│ 
│ [libcrypto3 libssl3 musl musl-utils]
╵
╷
│ Warning: unable to lock certain packages for riscv64
│ 
│   with module.latest.module.this.data.apko_config.this,
│   on .terraform/modules/latest.this/main.tf line 17, in data "apko_config" "this":
│   17: data "apko_config" "this" {
│ 
│ [libcrypto3 libssl3 musl musl-utils]
╵
╷
│ Warning: unable to lock certain packages for s390x
│ 
│   with module.latest.module.this.data.apko_config.this,
│   on .terraform/modules/latest.this/main.tf line 17, in data "apko_config" "this":
│   17: data "apko_config" "this" {
│ 
│ [libcrypto3 libssl3 musl musl-utils]
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/latest.this/main.tf line 72, in resource "cosign_attest" "slsa-provenance":
│   72:         for k in data.apko_config.this.config.contents.packages : split("=", k)[0] => split("=", k)[1]
│ 
│ The given key does not identify an element in this collection value: the given index is greater than or equal to the length of the
│ collection.
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/latest.this/main.tf line 72, in resource "cosign_attest" "slsa-provenance":
│   72:         for k in data.apko_config.this.config.contents.packages : split("=", k)[0] => split("=", k)[1]
│ 
│ The given key does not identify an element in this collection value: the given index is greater than or equal to the length of the
│ collection.
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/latest.this/main.tf line 72, in resource "cosign_attest" "slsa-provenance":
│   72:         for k in data.apko_config.this.config.contents.packages : split("=", k)[0] => split("=", k)[1]
│ 
│ The given key does not identify an element in this collection value: the given index is greater than or equal to the length of the
│ collection.
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/latest.this/main.tf line 72, in resource "cosign_attest" "slsa-provenance":
│   72:         for k in data.apko_config.this.config.contents.packages : split("=", k)[0] => split("=", k)[1]
│ 
│ The given key does not identify an element in this collection value: the given index is greater than or equal to the length of the
│ collection.
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/latest.this/main.tf line 72, in resource "cosign_attest" "slsa-provenance":
│   72:         for k in data.apko_config.this.config.contents.packages : split("=", k)[0] => split("=", k)[1]
│ 
│ The given key does not identify an element in this collection value: the given index is greater than or equal to the length of the
│ collection.
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/latest.this/main.tf line 72, in resource "cosign_attest" "slsa-provenance":
│   72:         for k in data.apko_config.this.config.contents.packages : split("=", k)[0] => split("=", k)[1]
│ 
│ The given key does not identify an element in this collection value: the given index is greater than or equal to the length of the
│ collection.
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/latest.this/main.tf line 72, in resource "cosign_attest" "slsa-provenance":
│   72:         for k in data.apko_config.this.config.contents.packages : split("=", k)[0] => split("=", k)[1]
│ 
│ The given key does not identify an element in this collection value: the given index is greater than or equal to the length of the
│ collection.
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/latest.this/main.tf line 72, in resource "cosign_attest" "slsa-provenance":
│   72:         for k in data.apko_config.this.config.contents.packages : split("=", k)[0] => split("=", k)[1]
│ 
│ The given key does not identify an element in this collection value: the given index is greater than or equal to the length of the
│ collection.
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/latest.this/main.tf line 72, in resource "cosign_attest" "slsa-provenance":
│   72:         for k in data.apko_config.this.config.contents.packages : split("=", k)[0] => split("=", k)[1]
│ 
│ The given key does not identify an element in this collection value: the given index is greater than or equal to the length of the
│ collection.
╵

this is resolved by locking the package referred to in the error:

contents:
  packages:
    - alpine-baselayout-data
    - alpine-release==3 # <--------
    - apk-tools
    - busybox
    - libc-utils

主要言語
HCL
スター
28
フォーク
25
平均マージ
4日 31分
マージ済み PR(30日)
6

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

wolfi-dev/tools のほかの issue

wolfi-dev/tools の issue をすべて見る

似ている issue

DevOps の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。