Documentation ¶
Index ¶
- Constants
- Variables
- func GetOCIRepository(r cpi.Repository) ocicpi.Repository
- func HandleRef(u *cpi.UniformRepositorySpec) error
- func Logger(ctx logging.ContextProvider, messageContext ...logging.MessageContext) logging.Logger
- func New(prio int) cpi.RepositoryPriorityDecoder
- func NewRepository(ctxp cpi.ContextProvider, meta *ComponentRepositoryMeta, ...) cpi.Repository
- func NewState(mode accessobj.AccessMode, name, version string, access oci.ManifestAccess, ...) (accessobj.State, error)
- func NewStateAccess(access oci.ManifestAccess, compat ...bool) accessobj.StateAccess
- func NewStateHandler(name, version string) accessobj.StateHandler
- func RegisterSpecificationNormalizer(typ string, f SpecificationNormalizer)
- type ArtifactInfo
- type ComponentDescriptorConfig
- type ComponentNameMapping
- type ComponentRepositoryMeta
- type ComponentVersionContainer
- func (c *ComponentVersionContainer) AccessMethod(a cpi.AccessSpec, cv refmgmt.ExtendedAllocatable) (cpi.AccessMethod, error)
- func (c *ComponentVersionContainer) AddBlob(blob cpi.BlobAccess, refName string, global cpi.AccessSpec) (cpi.AccessSpec, error)
- func (c *ComponentVersionContainer) AssureGlobalRef(d digest.Digest, url, name string) (cpi.AccessSpec, error)
- func (c *ComponentVersionContainer) Check() error
- func (c *ComponentVersionContainer) Close() error
- func (c *ComponentVersionContainer) GetBlob(name string) (cpi.DataAccess, error)
- func (c *ComponentVersionContainer) GetContext() cpi.Context
- func (c *ComponentVersionContainer) GetDescriptor() *compdesc.ComponentDescriptor
- func (c *ComponentVersionContainer) GetParentBridge() repocpi.ComponentAccessBridge
- func (c *ComponentVersionContainer) GetStorageContext() cpi.StorageContext
- func (c *ComponentVersionContainer) IsClosed() bool
- func (c *ComponentVersionContainer) IsReadOnly() bool
- func (c *ComponentVersionContainer) Repository() cpi.Repository
- func (c *ComponentVersionContainer) SetBridge(impl repocpi.ComponentVersionAccessBridge)
- func (c *ComponentVersionContainer) SetDescriptor(cd *compdesc.ComponentDescriptor) (bool, error)
- func (c *ComponentVersionContainer) SetReadOnly()
- func (c *ComponentVersionContainer) Update() (bool, error)
- type ComponentVersionInfo
- type LayerAnnotations
- type Normalizers
- type OCIBasedRepository
- type RepositoryImpl
- func (r *RepositoryImpl) Close() error
- func (r *RepositoryImpl) ComponentLister() cpi.ComponentLister
- func (r *RepositoryImpl) ExistsComponentVersion(name string, version string) (bool, error)
- func (r *RepositoryImpl) GetComponents(prefix string, closure bool) ([]string, error)
- func (r *RepositoryImpl) GetConsumerId(uctx ...credentials.UsageContext) credentials.ConsumerIdentity
- func (r *RepositoryImpl) GetContext() cpi.Context
- func (r *RepositoryImpl) GetIdentityMatcher() string
- func (r *RepositoryImpl) GetOCIRepository() oci.Repository
- func (r *RepositoryImpl) GetSpecification() cpi.RepositorySpec
- func (r *RepositoryImpl) IsReadOnly() bool
- func (r *RepositoryImpl) LookupComponent(name string) (*repocpi.ComponentAccessInfo, error)
- func (r *RepositoryImpl) MapComponentNameToNamespace(name string) (string, error)
- func (r *RepositoryImpl) Meta() ComponentRepositoryMeta
- func (r *RepositoryImpl) NumComponents(prefix string) (int, error)
- func (r *RepositoryImpl) OCIRepository() ocicpi.Repository
- func (r *RepositoryImpl) SetBridge(base repocpi.RepositoryBridge)
- func (r *RepositoryImpl) SetReadOnly()
- type RepositorySpec
- func (a *RepositorySpec) AsUniformSpec(cpi.Context) *cpi.UniformRepositorySpec
- func (s *RepositorySpec) GetConsumerId(uctx ...credentials.UsageContext) credentials.ConsumerIdentity
- func (s *RepositorySpec) GetIdentityMatcher() string
- func (a *RepositorySpec) IsIntermediate() bool
- func (u RepositorySpec) MarshalJSON() ([]byte, error)
- func (a *RepositorySpec) PathPrefix() string
- func (s *RepositorySpec) Repository(ctx cpi.Context, creds credentials.Credentials) (cpi.Repository, error)
- func (u *RepositorySpec) UnmarshalJSON(data []byte) error
- func (s *RepositorySpec) Validate(ctx cpi.Context, creds credentials.Credentials, ...) error
- type SpecificationNormalizer
- type StateAccess
- type StateHandler
Constants ¶
const ( OCM_COMPONENTVERSION = "software.ocm.componentversion" OCM_CREATOR = "software.ocm.creator" OCM_ARTIFACT = "software.ocm.artifact" ARTKIND_RESOURCE = "resource" ARTKIND_SOURCE = "source" )
const META_SEPARATOR = ".build-"
Variables ¶
var Excludes = []string{ docker.Type, artifactset.Type, empty.Type, }
var REALM = ocmlog.DefineSubRealm("OCM to OCI Registry Mapping", "oci", "mapping")
var TAG_CDDIFF = logging.DefineTag("cd-diff", "component descriptor modification")
Functions ¶
func GetOCIRepository ¶
func GetOCIRepository(r cpi.Repository) ocicpi.Repository
func HandleRef ¶
func HandleRef(u *cpi.UniformRepositorySpec) error
func Logger ¶
func Logger(ctx logging.ContextProvider, messageContext ...logging.MessageContext) logging.Logger
func New ¶
func New(prio int) cpi.RepositoryPriorityDecoder
func NewRepository ¶
func NewRepository(ctxp cpi.ContextProvider, meta *ComponentRepositoryMeta, ocirepo oci.Repository) cpi.Repository
func NewState ¶
func NewState(mode accessobj.AccessMode, name, version string, access oci.ManifestAccess, compat ...bool) (accessobj.State, error)
func NewStateAccess ¶
func NewStateAccess(access oci.ManifestAccess, compat ...bool) accessobj.StateAccess
func NewStateHandler ¶
func NewStateHandler(name, version string) accessobj.StateHandler
func RegisterSpecificationNormalizer ¶
func RegisterSpecificationNormalizer(typ string, f SpecificationNormalizer)
RegisterSpecificationNormalizer can be used to register OCI repository type specific handlers used to normalize an OCI type based OCM repository spec.
Types ¶
type ArtifactInfo ¶ added in v0.15.0
type ComponentDescriptorConfig ¶
type ComponentDescriptorConfig struct {
ComponentDescriptorLayer *ociv1.Descriptor `json:"componentDescriptorLayer,omitempty"`
}
ComponentDescriptorConfig is a Component-Descriptor OCI configuration that is used to store the reference to the (pseudo-)layer used to store the Component-Descriptor in.
type ComponentNameMapping ¶
type ComponentNameMapping string
ComponentNameMapping describes the method that is used to map the "Component Name", "Component Version"-tuples to OCI Image References.
const ( Type = ocireg.Type OCIRegistryURLPathMapping ComponentNameMapping = "urlPath" OCIRegistryDigestMapping ComponentNameMapping = "sha256-digest" )
type ComponentRepositoryMeta ¶
type ComponentRepositoryMeta struct { // ComponentNameMapping describes the method that is used to map the "Component Name", "Component Version"-tuples // to OCI Image References. ComponentNameMapping ComponentNameMapping `json:"componentNameMapping,omitempty"` SubPath string `json:"subPath,omitempty"` }
ComponentRepositoryMeta describes config special for a mapping of a component repository to an oci registry. It is parsed in addition to an OCI based specification.
func DefaultComponentRepositoryMeta ¶
func DefaultComponentRepositoryMeta(meta *ComponentRepositoryMeta) *ComponentRepositoryMeta
func NewComponentRepositoryMeta ¶
func NewComponentRepositoryMeta(subPath string, mapping ComponentNameMapping) *ComponentRepositoryMeta
type ComponentVersionContainer ¶
type ComponentVersionContainer struct {
// contains filtered or unexported fields
}
func (*ComponentVersionContainer) AccessMethod ¶
func (c *ComponentVersionContainer) AccessMethod(a cpi.AccessSpec, cv refmgmt.ExtendedAllocatable) (cpi.AccessMethod, error)
func (*ComponentVersionContainer) AddBlob ¶
func (c *ComponentVersionContainer) AddBlob(blob cpi.BlobAccess, refName string, global cpi.AccessSpec) (cpi.AccessSpec, error)
func (*ComponentVersionContainer) AssureGlobalRef ¶
func (c *ComponentVersionContainer) AssureGlobalRef(d digest.Digest, url, name string) (cpi.AccessSpec, error)
AssureGlobalRef provides a global manifest for a local OCI Artifact.
func (*ComponentVersionContainer) Check ¶
func (c *ComponentVersionContainer) Check() error
func (*ComponentVersionContainer) Close ¶
func (c *ComponentVersionContainer) Close() error
func (*ComponentVersionContainer) GetBlob ¶
func (c *ComponentVersionContainer) GetBlob(name string) (cpi.DataAccess, error)
func (*ComponentVersionContainer) GetContext ¶
func (c *ComponentVersionContainer) GetContext() cpi.Context
func (*ComponentVersionContainer) GetDescriptor ¶
func (c *ComponentVersionContainer) GetDescriptor() *compdesc.ComponentDescriptor
func (*ComponentVersionContainer) GetParentBridge ¶
func (c *ComponentVersionContainer) GetParentBridge() repocpi.ComponentAccessBridge
func (*ComponentVersionContainer) GetStorageContext ¶
func (c *ComponentVersionContainer) GetStorageContext() cpi.StorageContext
func (*ComponentVersionContainer) IsClosed ¶
func (c *ComponentVersionContainer) IsClosed() bool
func (*ComponentVersionContainer) IsReadOnly ¶
func (c *ComponentVersionContainer) IsReadOnly() bool
func (*ComponentVersionContainer) Repository ¶
func (c *ComponentVersionContainer) Repository() cpi.Repository
func (*ComponentVersionContainer) SetBridge ¶
func (c *ComponentVersionContainer) SetBridge(impl repocpi.ComponentVersionAccessBridge)
func (*ComponentVersionContainer) SetDescriptor ¶
func (c *ComponentVersionContainer) SetDescriptor(cd *compdesc.ComponentDescriptor) (bool, error)
func (*ComponentVersionContainer) SetReadOnly ¶
func (c *ComponentVersionContainer) SetReadOnly()
func (*ComponentVersionContainer) Update ¶
func (c *ComponentVersionContainer) Update() (bool, error)
type ComponentVersionInfo ¶
type ComponentVersionInfo struct { Error string `json:"error,omitempty"` Description string `json:"description"` Unparsed string `json:"unparsed,omitempty"` Descriptor json.RawMessage `json:"descriptor,omitempty"` }
type LayerAnnotations ¶ added in v0.15.0
type LayerAnnotations []ArtifactInfo
type Normalizers ¶
type Normalizers struct {
// contains filtered or unexported fields
}
func (*Normalizers) Get ¶
func (n *Normalizers) Get(typ string) []SpecificationNormalizer
func (*Normalizers) Normalize ¶
func (n *Normalizers) Normalize(s *RepositorySpec) *RepositorySpec
func (*Normalizers) Register ¶
func (n *Normalizers) Register(typ string, f SpecificationNormalizer)
type OCIBasedRepository ¶
type OCIBasedRepository interface {
OCIRepository() ocicpi.Repository
}
type RepositoryImpl ¶
type RepositoryImpl struct {
// contains filtered or unexported fields
}
func (*RepositoryImpl) Close ¶
func (r *RepositoryImpl) Close() error
func (*RepositoryImpl) ComponentLister ¶
func (r *RepositoryImpl) ComponentLister() cpi.ComponentLister
func (*RepositoryImpl) ExistsComponentVersion ¶
func (r *RepositoryImpl) ExistsComponentVersion(name string, version string) (bool, error)
func (*RepositoryImpl) GetComponents ¶
func (r *RepositoryImpl) GetComponents(prefix string, closure bool) ([]string, error)
func (*RepositoryImpl) GetConsumerId ¶
func (r *RepositoryImpl) GetConsumerId(uctx ...credentials.UsageContext) credentials.ConsumerIdentity
func (*RepositoryImpl) GetContext ¶
func (r *RepositoryImpl) GetContext() cpi.Context
func (*RepositoryImpl) GetIdentityMatcher ¶
func (r *RepositoryImpl) GetIdentityMatcher() string
func (*RepositoryImpl) GetOCIRepository ¶
func (r *RepositoryImpl) GetOCIRepository() oci.Repository
func (*RepositoryImpl) GetSpecification ¶
func (r *RepositoryImpl) GetSpecification() cpi.RepositorySpec
func (*RepositoryImpl) IsReadOnly ¶
func (r *RepositoryImpl) IsReadOnly() bool
func (*RepositoryImpl) LookupComponent ¶
func (r *RepositoryImpl) LookupComponent(name string) (*repocpi.ComponentAccessInfo, error)
func (*RepositoryImpl) MapComponentNameToNamespace ¶
func (r *RepositoryImpl) MapComponentNameToNamespace(name string) (string, error)
func (*RepositoryImpl) Meta ¶
func (r *RepositoryImpl) Meta() ComponentRepositoryMeta
func (*RepositoryImpl) NumComponents ¶
func (r *RepositoryImpl) NumComponents(prefix string) (int, error)
func (*RepositoryImpl) OCIRepository ¶
func (r *RepositoryImpl) OCIRepository() ocicpi.Repository
func (*RepositoryImpl) SetBridge ¶
func (r *RepositoryImpl) SetBridge(base repocpi.RepositoryBridge)
func (*RepositoryImpl) SetReadOnly ¶
func (r *RepositoryImpl) SetReadOnly()
type RepositorySpec ¶
type RepositorySpec struct { oci.RepositorySpec ComponentRepositoryMeta }
func NewRepositorySpec ¶
func NewRepositorySpec(spec oci.RepositorySpec, meta *ComponentRepositoryMeta) *RepositorySpec
func (*RepositorySpec) AsUniformSpec ¶
func (a *RepositorySpec) AsUniformSpec(cpi.Context) *cpi.UniformRepositorySpec
func (*RepositorySpec) GetConsumerId ¶
func (s *RepositorySpec) GetConsumerId(uctx ...credentials.UsageContext) credentials.ConsumerIdentity
func (*RepositorySpec) GetIdentityMatcher ¶
func (s *RepositorySpec) GetIdentityMatcher() string
func (*RepositorySpec) IsIntermediate ¶
func (a *RepositorySpec) IsIntermediate() bool
func (RepositorySpec) MarshalJSON ¶
func (u RepositorySpec) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom json unmarshal method for an unstructured type. The oci.RepositorySpec object might already implement json.Marshaler, which would be inherited and omit marshaling the addend attributes of a cpi.RepositorySpec.
func (*RepositorySpec) PathPrefix ¶
func (a *RepositorySpec) PathPrefix() string
func (*RepositorySpec) Repository ¶
func (s *RepositorySpec) Repository(ctx cpi.Context, creds credentials.Credentials) (cpi.Repository, error)
func (*RepositorySpec) UnmarshalJSON ¶
func (u *RepositorySpec) UnmarshalJSON(data []byte) error
func (*RepositorySpec) Validate ¶
func (s *RepositorySpec) Validate(ctx cpi.Context, creds credentials.Credentials, uctx ...credentials.UsageContext) error
type SpecificationNormalizer ¶
type SpecificationNormalizer func(s *RepositorySpec)
type StateAccess ¶
type StateAccess struct {
// contains filtered or unexported fields
}
StateAccess handles the component descriptor persistence in an OCI Manifest.
func (StateAccess) Digest ¶
func (s StateAccess) Digest() digest.Digest
func (*StateAccess) Get ¶
func (s *StateAccess) Get() (blobaccess.BlobAccess, error)
func (*StateAccess) Put ¶
func (s *StateAccess) Put(data []byte) error
type StateHandler ¶
type StateHandler struct {
// contains filtered or unexported fields
}
StateHandler handles the encoding of a component descriptor.
func (StateHandler) Decode ¶
func (i StateHandler) Decode(data []byte) (interface{}, error)
Decode always accepts a yaml representation, and therefore json, also.
func (StateHandler) Encode ¶
func (i StateHandler) Encode(d interface{}) ([]byte, error)
Encode always provides a yaml representation.
func (StateHandler) Equivalent ¶
func (i StateHandler) Equivalent(a, b interface{}) bool
func (StateHandler) Initial ¶
func (i StateHandler) Initial() interface{}