OCIRepository: pick the Helm chart layer automatically when the first layer is a provenance file
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
- 78/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- backend, infrastructure
Hướng nghiên cứu
Bắt đầu tại internal/controller/ocirepository_controller.go, ở selectLayer, đặc biệt là nhánh default, và đọc các bài kiểm thử chọn layer hiện có. Thêm một test artifact có layer provenance ở vị trí đầu tiên và xác nhận rằng layer nội dung chart được chọn khi không có selector nào được đặt. Hoàn thành khi hành vi mặc định xử lý thứ tự đó và các selector layer tường minh vẫn được ưu tiên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
How we ran into it
We were bootstrapping a new cluster and reused the CloudNativePG setup from another cluster that has been running for two months: an OCIRepository for oci://ghcr.io/cloudnative-pg/charts/cloudnative-pg pinned to 0.29.0 plus a HelmRelease with chartRef. The only change was a patch bump of the tag to 0.29.1. The source immediately went to:
failed to extract layer contents from artifact: requires gzip-compressed body: gzip: invalid header
Both versions are signed and carry the same two layers. The only difference is their order:
0.29.0
application/vnd.cncf.helm.chart.content.v1.tar+gzip 201392
application/vnd.cncf.helm.chart.provenance.v1.prov 1625
0.29.1
application/vnd.cncf.helm.chart.provenance.v1.prov 1625
application/vnd.cncf.helm.chart.content.v1.tar+gzip 205129
So a patch release of an upstream chart broke a config that had been working for two months, and nothing on our side changed.
Current behaviour
Without spec.layerSelector, selectLayer always takes layers[0]:
When layers[0] is the .prov layer, extraction always fails. The documented fix is to set layerSelector.mediaType: application/vnd.cncf.helm.chart.content.v1.tar+gzip, and that does fix it. Still, it keeps coming up as a bug report, because signed charts (Helm 4, cosign v3) put the provenance layer first and the error doesn't point to the cause:
- #1847: dynatrace-operator 1.6.0
- #1932: traefik 37.2.0
- fluxcd/flux2#5788: cloudnative-pg/plugin-barman-cloud
In fluxcd/flux2#5788 the answer to "why isn't this the default?" was that defaults can't change in GA software and that OCIRepository is meant for any artifact type, first of all Flux's own. I agree with both points. I think the change below doesn't conflict with either of them.
Proposal
Only touch the default: branch, i.e. the case where no layer selector is set:
- if
layers[0]has media typeapplication/vnd.cncf.helm.chart.provenance.v1.prov(registry.ProvLayerMediaTypein Helm), - then pick the first layer with
application/vnd.cncf.helm.chart.content.v1.tar+gzip(registry.ChartLayerMediaType) instead, - and leave the operation at the default (
extract), same as today.
Alternatively, the check could key off the manifest config media type application/vnd.cncf.helm.config.v1+json. Either is fine with me; the provenance check is the narrower one.
Why this is safe for existing users
- Charts that work today have the chart layer first. They hit exactly the same layer with the same operation, so artifact, revision and digest are identical. Nothing changes for them.
- Charts with the provenance layer first fail with a hard error today. That is the only case whose behaviour changes, and it changes from "always broken" to "works". It's hard to imagine anyone relying on that error.
- Flux artifacts and any other non-Helm artifacts are untouched: their config is
application/vnd.cncf.flux.config.v1+jsonand their layers are never.prov. - An explicit
layerSelectorkeeps full precedence, as today.
It is a trivial change: a few lines in selectLayer plus a test with a provenance-first artifact. No API change, no new field, no change to existing artifacts. I'm happy to send the PR if the maintainers agree with the approach.
Out of scope
The _ ↔ + tag mapping for ref.semver (convertOCIToSemVerTag) is also tied to layerSelector.mediaType, and it runs before the manifest is fetched, so autodetection can't cover it. Users with semver ranges over tags like 1.2.3_build.1 would still need the explicit selector. I'd keep that out of this issue on purpose.
- Ngôn ngữ chính
- Go
- Star
- 285
- Fork
- 259
- Merge trung bình
- 2 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fluxcd/source-controller
-
Improve documentation on debugging the controller locallyCó thể làm lại được @Bryandero98 đã nhận 36 ngày trước và không có pull request nào đang mở. Đang mởarea/docs good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
fluxcd/source-controller#666 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/oci enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
fluxcd/source-controller#2180 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`OCIRepository`/cosign verification: support TSA-only trusted roots (no transparency log) for private Sigstore instances like GitHub Artifact AttestationsCó thể đã có người làm @stealthybox đã nhận 150 ngày trước. Đang mởarea/oci area/security enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
fluxcd/source-controller#2167 · 4 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
fluxcd/source-controller#2150 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GitRepository `.spec.ref.commit` + `.spec.ref.branch` does not shallow clone, contrary to the docsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
fluxcd/source-controller#2146 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của fluxcd/source-controller
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
praetorianer777/Dynamo#53 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/engineering pulumi/pulumi-terraform Task Workflow Failure
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
pulumi/pulumi-terraform#1261 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Controllers integration tests fail when port 8080 is in useCó thể đã có người làm @noahnut đã nhận hôm nay. Đang mởarea/cluster-autoscaler kind/bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
kubernetes-sigs/cluster-autoscaler#236 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày