1
0
mirror of synced 2026-07-01 15:40:49 +00:00

Use single OCI layer selector flag

Signed-off-by: Dan Meier <me.daniel.meier@gmail.com>
Assisted-by: Codex/gpt-5
This commit is contained in:
Dan Meier
2026-05-13 16:11:18 +02:00
committed by Matheus Pimenta
parent efc030ffe4
commit 5df79510e2
3 changed files with 65 additions and 0 deletions
+15
View File
@@ -81,6 +81,21 @@ func TestCreateSourceOCI(t *testing.T) {
args: "create source oci podinfo --url=oci://ghcr.io/stefanprodan/manifests/podinfo --tag=6.3.5 --interval 10m --verify-provider=cosign --verify-secret-ref=cosign-pub --export",
assertFunc: assertGoldenFile("./testdata/oci/export_with_verify_secret.golden"),
},
{
name: "export manifest with layer selector",
args: "create source oci podinfo --url=oci://ghcr.io/stefanprodan/manifests/podinfo --tag=6.3.5 --interval 10m --layer-selector=application/vnd.cncf.helm.chart.content.v1.tar+gzip:copy --export",
assertFunc: assertGoldenFile("./testdata/oci/export_with_layer_selector.golden"),
},
{
name: "invalid layer selector operation",
args: "create source oci podinfo --url=oci://ghcr.io/stefanprodan/manifests/podinfo --tag=6.3.5 --layer-selector=application/vnd.cncf.helm.chart.content.v1.tar+gzip:move --export",
assertFunc: assertError("invalid --layer-selector \"application/vnd.cncf.helm.chart.content.v1.tar+gzip:move\": operation must be \"extract\" or \"copy\""),
},
{
name: "invalid layer selector format",
args: "create source oci podinfo --url=oci://ghcr.io/stefanprodan/manifests/podinfo --tag=6.3.5 --layer-selector=application/vnd.cncf.helm.chart.content.v1.tar+gzip --export",
assertFunc: assertError("invalid --layer-selector \"application/vnd.cncf.helm.chart.content.v1.tar+gzip\": must be in the format '<media-type>:<operation>'"),
},
}
for _, tt := range tests {