v0 ECS: image name and version are wrong when the container image is pinned by digest

Aperta
#7,674 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
aws, go
Ambito
cloud

Direzione di ricerca

Read pkg/app/piped/platformprovider/ecs/task.go, especially parseContainerImage, and compare its behavior with the v1 ECS plugin and the handling described in #7633. Reproduce the digest case from the issue and check the tests for parseContainerImage, FindImageTag, and FindArtifactVersions; done means the image name is web and the digest is used as the version. The reporter says a fix with tests is ready and will open a PR.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/bug

What happened:

parseContainerImage in pkg/app/piped/platformprovider/ecs/task.go splits the image on the last ":" of the last path segment, but it doesn't split off the "@digest" part first. For an image pinned by digest, the digest ends up as the tag and "@sha256" stays in the name:

123456789012.dkr.ecr.us-east-1.amazonaws.com/web@sha256:0123... => name="web@sha256", tag="0123..."

FindImageTag and FindArtifactVersions use this, so the application version and the artifact versions shown for a v0 ECS app are wrong.

What you expected to happen:

name="web", and the digest is used as the version when the image has one. This is what the pipedv1 ECS plugin already does, and what #7633 does for v0 Kubernetes and Cloud Run.

How to reproduce it:

Call parseContainerImage with "123456789012.dkr.ecr.us-east-1.amazonaws.com/web@sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef". It returns name "web@sha256" and the hex part as the tag. I checked this with a small test on master (d8de050).

Environment:

  • piped version: master (d8de050), v0 piped
  • control-plane version: n/a
  • Others: pkg/app/piped/platformprovider/ecs

I have a fix with tests ready and will open a PR.

Lingua principale
Go
Stelle
1.4k
Fork
403
Merge medio
2g 9h
PR unite (30g)
40

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pipe-cd/pipecd

Tutte le issue di pipe-cd/pipecd

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.