ociartifact

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

README

Access Method ociArtifact and ociRegistry - OCI Artifact Access

Synopsis
type: ociArtifact/v1

Provided blobs use the following media type:

  • application/vnd.oci.image.manifest.v1+tar+gzip: OCI image manifests
  • application/vnd.oci.image.index.v1+tar.gzip: OCI index manifests

Depending on the repository appropriate docker legacy types might be used.

The artifact content is provided in the Artifact Set Format. The tag is provided as annotation.

Description

This method implements the access of an OCI artifact stored in an OCI registry.

Supported specification version is v1

Specification Versions
Version v1

The type specific specification fields are:

  • imageReference string

    OCI image/artifact reference following the possible docker schemes:

    • <repo>/<artifact>:<tag>@<digest>
    • <host>[<port>]/<repo path>/<artifact>:<tag>@<digest>
Go Bindings

The go binding can be found here

Documentation

Index

Constants

View Source
const (
	Type   = "ociArtifact"
	TypeV1 = Type + runtime.VersionSeparator + "v1"
)

Type is the access type of a oci registry.

View Source
const (
	LegacyType   = "ociRegistry"
	LegacyTypeV1 = LegacyType + runtime.VersionSeparator + "v1"
)

Variables

View Source
var REALM = ocmlog.DefineSubRealm("access method ociArtifact", "accessmethod/ociartifact")

Functions

func AddConfig

func AddConfig(opts flagsets.ConfigOptions, config flagsets.Config) error

func GetOCIArtifactReference added in v0.5.0

func GetOCIArtifactReference(ctx cpi.Context, spec cpi.AccessSpec, cv cpi.ComponentVersionAccess) (string, error)

func Hint added in v0.3.0

func Hint(nv common.NameVersion, locator, repo, version string) string

func Is

func Is(spec accspeccpi.AccessSpec) bool

func Logger added in v0.3.0

func Logger(c ContextProvider, keyValuePairs ...interface{}) logging.Logger

func NewMethod added in v0.3.0

Types

type AccessMethodImpl added in v0.5.0

type AccessMethodImpl = *accessMethod

type AccessSpec

type AccessSpec struct {
	runtime.ObjectVersionedType `json:",inline"`

	// ImageReference is the actual reference to the oci image repository and tag.
	ImageReference string `json:"imageReference"`
}

AccessSpec describes the access for a oci registry.

func New

func New(ref string) *AccessSpec

New creates a new oci registry access spec version v1.

func (*AccessSpec) AccessMethod

func (*AccessSpec) Describe

func (a *AccessSpec) Describe(ctx accspeccpi.Context) string

func (*AccessSpec) Digest added in v0.5.0

func (a *AccessSpec) Digest() digest.Digest

func (*AccessSpec) GetOCIReference added in v0.5.0

func (a *AccessSpec) GetOCIReference(cv accspeccpi.ComponentVersionAccess) (string, error)

func (*AccessSpec) GetReferenceHint

func (a *AccessSpec) GetReferenceHint(cv accspeccpi.ComponentVersionAccess) string

func (*AccessSpec) GetType

func (_ *AccessSpec) GetType() string

func (*AccessSpec) GlobalAccessSpec added in v0.3.0

func (a *AccessSpec) GlobalAccessSpec(ctx accspeccpi.Context) accspeccpi.AccessSpec

func (*AccessSpec) IsLocal

func (_ *AccessSpec) IsLocal(accspeccpi.Context) bool

type ContextProvider added in v0.3.0

type ContextProvider interface {
	GetContext() cpi.Context
}

func WrapContextProvider added in v0.3.0

func WrapContextProvider(ctx cpi.ContextProvider) ContextProvider

type OCIArtifactReferenceProvider added in v0.5.0

type OCIArtifactReferenceProvider interface {
	// GetOCIReference returns the externally usable OCI reference.
	// The component version miggt be nil. If it is required to
	// determine the ref, an appropriate error has to be returned.
	GetOCIReference(cv cpi.ComponentVersionAccess) (string, error)
}

OCIArtifactReferenceProvider should be implemented by access specs providing access to globally retrievable OCI artifacts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL