-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.Assist humans wanting to comment on an old issue or PR with locked comments.triagedIssue has been triagedIssue has been triaged
Description
Feature request description
The media type of artifacts files is derived from the first 512 bytes of the file using go standard library net/http#DetectContentType.
The media type can be incorrect and a source of error when the artifact gets pushed to an OCI container image registry.
Consider the following example:
# run Zot (https://zotregistry.dev) on localhost:5001
podman run -d -p "127.0.0.1:5001:5000" --name zot ghcr.io/project-zot/zot-minimal-linux-amd64:latest
# create hello.yaml and an artifact hello:latest
echo "foo: bar" > hello.yaml
podman artifact add localhost:5001/hello/hello:latest ./hello.yaml
# verify that the layer's media type is `text/plain; charset=utf-8`
podman artifact inspect localhost:5001/hello/hello:latest | jq '.Manifest.layers[].mediaType'
# push it to Zot
podman artifact push docker://localhost:5001/hello/hello:latest
Pushing the artifact returns an error:
Error: invalid reference format
The media type inferred by DetectContentType
(text/plain; charset=utf-8
) is the issue:
- It includes the
charset
parameter and the support for media types parameters is controversial - It's not accurate (
text/yaml
would be more appropriate)
Suggest potential solution
To address these cases, podman artifact add
should have a flag to specify the files' media types.
Metadata
Metadata
Assignees
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.Assist humans wanting to comment on an old issue or PR with locked comments.triagedIssue has been triagedIssue has been triaged