crossplane / crossplane/cli

Map XPKG annotations to OCI annotations

Open
#59 2 comments 1 reaction 0 assignees View on GitHub
enhancement stale
Dominant language
Go
Stars
19
Forks
31
Avg merge
3d 4h
Merged PRs (30d)
52

Description

### What problem are you facing?

The XPKG spec has the concept of [object annotations](https://github.com/crossplane/crossplane/blob/main/contributing/specifications/xpkg.md#object-annotations), which allow specifying package metadata. The OCI spec similarly has certain [pre-defined annotation keys](https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys).

Right now there is no way to set OCI annotations on artifacts produced by `crossplane project build`. This is addressed by #11, but it requires that you specify both XPKG annotations and OCI annotations.

### How could Crossplane help solve your problem?

Having to specify the same annotations twice for XPKG and OCI is annoying, especially if it's done in two different ways: one via configuration file (`crossplane-project.yaml`) and the other via CLI flag.

There is quite a big overlap between XPKG and OCI annotations. I think it could make sense to map from the former to the later, possibly as an opt-in (for example, `--map-xpkg-to-oci-annotations`). When this is set, it would automatically propagate `meta.crossplane.io/source` to `org.opencontainers.image.source`, etc. The details of this mapping needs to be figured out.

This could be done in addition to manually specifying OCI annotations (i.e. #11). If both are specified, I would expect them to be merged and for the manually specified OCI annotations to take precedence.

Related issues:
- #11
- crossplane/crossplane#7282

Awesome work on the CLI and DevEx tooling by the way!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.