Fix expiry time for Git SHA tagged Docker images
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
調査の方向性
.github/workflows/build-image.yaml から始め、次に Dockerfile の label と Makefile の QUAY_IMAGE_EXPIRY 設定を調べます。workflow の tag と有効期限の扱いを Quay のイメージ有効期限に関するドキュメントと比較し、main、latest、release の tag は決して期限切れにならず、Git SHA tag は 3 週間後に期限切れになることを確認します。その際、branch-tag の動作は変更しません。
索引モデルが issue の本文から書いたものです。
説明
Summary
Docker images tagged with Git SHA are not expiring as expected on Quay.io. Currently, SHA-tagged images are set to never expire, leading to storage accumulation.
Current Behavior
Looking at quay.io/kuadrant/developer-portal-controller, images with Git SHA tags (e.g., b2ab687...) do not have an expiry time set.
Expected Behavior
Images should automatically expire based on their tags:
- Images with
maintag: Never expire - Images with
latesttag: Never expire - Release tag images (e.g.,
v0.4.0,v1.2.3-alpha.1): Never expire - Git SHA tagged images: Expire after 3 weeks
- Branch tagged images (non-main branches): Expire after 3 weeks ✅ (already working correctly)
Root Cause
The issue is in .github/workflows/build-image.yaml. When a push to the main branch occurs:
- The metadata action generates multiple tags for a single build:
main,latest, and the Git SHA - The expiry logic evaluates to
expiry=neverbecausegithub.ref_name == "main" - The Docker build uses a single
QUAY_IMAGE_EXPIRYvalue for all tags via theLABEL quay.expires-afterdirective - Result: All tags including the Git SHA inherit
quay.expires-after=never
This is a Docker/Quay limitation - you cannot set different expiry times for different tags in the same image build because the label is set at the image layer level, not per-tag.
Possible Solutions
Option 1: Separate Builds for Different Expiry Requirements
Split the image building into separate jobs with different QUAY_IMAGE_EXPIRY build args:
- Job 1: Build and tag with
mainandlatest(expiry = never) - Job 2: Build and tag with Git SHA (expiry = 3w)
Option 2: Use Quay API to Set Tag Expiry Post-Build
After the image is built and pushed, use the Quay API to programmatically set expiration time for the Git SHA tag only.
Additional Context
- Current Makefile setting:
QUAY_IMAGE_EXPIRY ?= 3w - Dockerfile label:
LABEL quay.expires-after=$QUAY_IMAGE_EXPIRY - Quay.io documentation on image expiration: https://docs.quay.io/guides/image-expiration.html
- 主要言語
- Go
- スター
- 3
- フォーク
- 15
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Kuadrant/developer-portal-controller のほかの issue
-
documentation linkinator-failure
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
Add reference documentation for APIKeyRequest CRD対応中かも @amalsaidov が 18 日前に担当しました。 オープンdocumentation good first issue triage/accepted
難易度 2/5 半日 初心者へのやさしさ 74/100
-
triage/accepted
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Kuadrant/developer-portal-controller#83 · コメント 1 件 ·
-
Add unit tests for name generation, data transformation, and object helpers再び着手できるかも @VISHNU0906 が 19 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement good first issue triage/accepted
難易度 4/5 3〜5日 初心者へのやさしさ 72/100
Kuadrant/developer-portal-controller#76 · コメント 1 件 ·
-
Add unit tests for status and condition helper functions再び着手できるかも @aviralgarg05 が 21 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement good first issue triage/accepted
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
Kuadrant/developer-portal-controller#75 · コメント 1 件 ·
Kuadrant/developer-portal-controller の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mattermost/mattermost-plugin-jira#1397 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add Free CS Systems Workshops, Starter Scaffolds & Zero-Dependency Verification CLI to CS Seriesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
docs: Route53 EKS Terraform example uses outdated EKS module arguments in main.tf対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
nutmos/expensetrackr#235 ·
メンテナーはふだん 1 日以内に返信