Commit Graph

24 Commits

Author SHA1 Message Date
Phaedrus Leeds
600e18567c Add a vim modeline and .editorconfig
To make indentation work with less effort. The modeline was copied from
libostree with minor modification and the .editorconfig from GLib.

The advantage of having both a modeline and an editorconfig is we can
work out of the box on more editor setups, and the modeline allows us to
specify the style with a lot more fine grained control.
2022-08-22 19:48:10 -07:00
Alexander Larsson
0fdec95fe0 OCI: Also look for the docker media type when looking manifests
We handle both types, so look for both.
2020-06-11 15:57:39 +02:00
Alexander Larsson
3d8ca04565 oci: Add helpers to parse OCI delta index and manifest 2020-06-05 09:35:30 +02:00
Alexander Larsson
90f5fdb44d oci: Add flatpak_oci_image_get_n_layers() helper 2020-06-05 09:35:30 +02:00
Alexander Larsson
01919d251e oci: Use content type from server if not in contents 2020-06-05 09:35:30 +02:00
Alexander Larsson
681ca88547 oci: Fix leak in index handling 2019-12-20 11:15:39 +01:00
Alexander Larsson
7fedf3578f OCI: Only use labels, never annotations
This is a slightly incompatible change, as we now only support
oci images generated with (what was before) build-export --oci-use-labels.
However, there are not a lot of OCI implementations in the wild, and
we can modify the ones in use to ensure there are labels (and
annotations if needed for older flatpak clients).

This also removes the --oci-use-label option from build-bundle --oci as
this is now the default.
2019-12-16 09:23:49 +01:00
Alexander Larsson
618c38245f OCI: Don't crash on mirroring an OCI repo without annotations
If we're using labels the annotations hashtable may be NULL, which
was causing a crash. Just do an early check.

Closes: #2978
Approved by: alexlarsson
2019-09-06 12:49:40 +00:00
Alexander Larsson
51fe0307ef OCI: Handle manifests without annotations in index.json
When we export a manifest to the index, always pass the ref we're
targeting instead of relying on the org.opencontainers.image.ref.name
annotation, because that may not be set if we're using labels instead.

This is no big deal, because we know what ref we're handling anyway.

Closes: #2978
Approved by: alexlarsson
2019-09-06 12:49:40 +00:00
Alexander Larsson
58d9a257aa OCI: Use labels as commit metadata source as well as annotations
We now pull the image config as well as the manifest and fall
back on the labels field if the keys we're looking for are not
in the annotations field.

This lets us support docker manifests too, which don't have
annotations (but do have labels).

Closes: #2978
Approved by: alexlarsson
2019-09-06 12:49:40 +00:00
Alexander Larsson
8cdd3a5e61 OCI: Don't crash if mediaType field missing in flatpak_oci_versioned_from_json
Closes: #2978
Approved by: alexlarsson
2019-09-06 12:49:40 +00:00
Alexander Larsson
79f5f13fec OCI: Add flatpak_oci_registry_load_image_config helper
We can't use load_versioned() for images because in the docker
case there is no mediatype field.

Closes: #2978
Approved by: alexlarsson
2019-09-06 12:49:40 +00:00
Alexander Larsson
45e31735f1 OCI: Accept docker v2 manifests as well as OCI manifests
Closes: #2978
Approved by: alexlarsson
2019-09-06 12:49:40 +00:00
Alexander Larsson
be9961ecf6 oci: Always generate a history, quay needs this
Closes: #2978
Approved by: alexlarsson
2019-09-06 12:49:40 +00:00
Alexander Larsson
2303672458 oci: Add an easy api to set the labels in the image manifest
Closes: #2978
Approved by: alexlarsson
2019-09-06 12:49:40 +00:00
Alexander Larsson
3f4518b15c Run uncrustify
Closes: #1870
Approved by: alexlarsson
2018-07-08 10:05:37 +00:00
Alexander Larsson
960d20448c common: Rename all private headers to *-private.h
This is the start of the merging of lib/* into common/*

Closes: #1706
Approved by: alexlarsson
2018-05-24 11:59:52 +00:00
Alexander Larsson
f7c55b0887 OCI: Drop the last references to org.opencontainers.ref.name
We now only use org.flatpak.ref, except in the index.

Closes: #1171
Approved by: alexlarsson
2017-11-16 20:50:34 +00:00
Alexander Larsson
c3b155b09a Use the new metastore index API for OCI remotes
This means the url of the remote is a service supporting:
 https://github.com/owtaylor/metastore/blob/master/docs/protocol.md

And we use that to find all flatpak images and the repository url
itself.

This also add support for docker-v2 registries that support OCI
images.

Closes: #1171
Approved by: alexlarsson
2017-11-16 20:50:34 +00:00
Alexander Larsson
549250a5f9 Add FlatpakJson subclass for oci indexes
Closes: #1171
Approved by: alexlarsson
2017-11-16 20:50:34 +00:00
Owen W. Taylor
0853089457 OCI: Update org.opencontainers.ref.name to org.opencontainers.image.ref.name
This annotation was changed in later versions of the OCI Image specification.
(See https://github.com/projectatomic/skopeo/issues/369#issuecomment-310158211)
2017-07-06 17:07:08 -04:00
Alexander Larsson
a7216cedd2 OCI: Add json format for atomic-based signatures 2017-03-29 17:14:36 +02:00
Alexander Larsson
49b5304589 Update OCI support to latest version of spec
This is a major change in the OCI support, as the format of the OCI image
registries changed. Instead of now having a "ref" file for each image
in the repo it has a single index json file, where the ref name is now
a per-image annotation.

This allows us to support OCI much better, as we can now use the actual
flatpak ref as the OCI ref name, and we can find all the flatpak refs
in a remote.

So, with this you can just use:
 flatpak remote-add --oci remote-name URL

and then you can use the regular flatpak operations on the remote.
2017-03-13 14:31:36 +01:00
Alexander Larsson
63c1aace83 Import OCI initial support to common/* 2016-12-08 17:43:03 +01:00