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

Đang mở
#7,674 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
aws, go
Lĩnh vực
cloud

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
1.4k
Fork
403
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
40

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pipe-cd/pipecd

Tất cả issue của pipe-cd/pipecd

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.