forked from awslabs/soci-snapshotter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SOCI relies on being able to associate an index with an image. This capability was introduced in OCI distribution and image specs version 1.1 as Artifacts and the Referrers API respectively. In order to drive adoption, an OCI 1.0 compatible fallback was added that encodes artifacts as Image Manifests and stores the Referrers API content in an Image Index. This PR adds the ability to serialize and deserialize SOCI indices as either OCI Artifacts or OCI Images. There is no automatic OCI 1.0 fallback when creating images. The user of the CLI/library must explicitly request an OCI 1.0 compatible Image Manifest. The snapshotter will be able to automatically load a SOCI index in either serialized form. Signed-off-by: Kern Walster <walster@amazon.com>
- Loading branch information
Showing
13 changed files
with
373 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
Copyright The Soci Snapshotter Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package internal | ||
|
||
import "github.com/urfave/cli" | ||
|
||
const ( | ||
LegacyRegistryFlagName = "legacy-registry" | ||
) | ||
|
||
var LegacyRegistryFlag = cli.BoolFlag{ | ||
Name: LegacyRegistryFlagName, | ||
Usage: `Whether to create the SOCI index for a legacy registry. OCI 1.1 added support for associating artifacts such as soci indices with images. | ||
There is a mechanism to emulate this behavior with OCI 1.0 registries by pretending that the SOCI index | ||
is itself an image. This option should only be use if the SOCI index will be pushed to a | ||
registry which does not support OCI 1.1 features.`, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.