Documentation ¶
Index ¶
- Constants
- Variables
- func And[T any](sel ...any) T
- func CatchConversionError(errp *error)
- func DefaultResources(component *ComponentDescriptor)
- func ElementIndex(acc ElementAccessor, metaprovider ElementMetaProvider) int
- func Encode(obj *ComponentDescriptor, opts ...EncodeOption) ([]byte, error)
- func EquivalentElems(a ElementAccessor, b ElementAccessor) equivalent.EqualState
- func GetIndexByIdentity(a ElementAccessor, id metav1.Identity) int
- func Hash(cd *ComponentDescriptor, normAlgo string, hash hash.Hash) (string, error)
- func IsIdentity(s string) bool
- func IsNoneAccess(a AccessSpec) bool
- func IsNoneAccessKind(kind string) bool
- func MapToSelectorElementList(accessor ElementAccessor) accessors.ElementListAccessor
- func MapToSelectorReference(r *ComponentReference) accessors.ReferenceAccessor
- func MapToSelectorResource(r *Resource) accessors.ResourceAccessor
- func MapToSelectorSource(r *Source) accessors.SourceAccessor
- func MatchLabels(labels v1.Labels, sel ...LabelSelector) (bool, error)deprecated
- func MatchReferencesByReferenceSelector(obj ReferenceSelectionContext, resourceSelectors ...ReferenceSelector) (bool, error)deprecated
- func MatchResourceByResourceSelector(obj ResourceSelectionContext, resourceSelectors ...ResourceSelector) (bool, error)deprecated
- func NormHash(cd *ComponentDescriptor, normAlgo string, hash hash.Hash) ([]byte, string, error)
- func Normalize(cd *ComponentDescriptor, normAlgo string) ([]byte, error)
- func Not[T any](sel any) T
- func Or[T any](sel ...any) T
- func RegisterScheme(scheme Scheme)
- func SelectLabels(labels v1.Labels, sel ...LabelSelector) (v1.Labels, error)deprecated
- func Sign(cctx credentials.Context, cd *ComponentDescriptor, ...) error
- func ThrowConversionError(err error)
- func Validate(desc *ComponentDescriptor) error
- func Verify(cd *ComponentDescriptor, registry signing.Registry, signatureName string, ...) error
- func WithSigning(b ...bool)
- func WithVersion(v string)
- type AccessProvider
- type AccessSpec
- type ArtifactAccess
- type ArtifactAccessor
- type ArtifactMetaAccess
- type ArtifactMetaPointer
- type Codec
- type CodecWrapper
- type CompDescDigest
- type CompDescDigests
- type ComponentDescriptor
- func (cd *ComponentDescriptor) AddRepositoryContext(repoCtx runtime.TypedObject) error
- func (cd *ComponentDescriptor) Copy() *ComponentDescriptor
- func (cd *ComponentDescriptor) Equal(obj interface{}) bool
- func (cd *ComponentDescriptor) Equivalent(o *ComponentDescriptor) equivalent.EqualState
- func (cd *ComponentDescriptor) GetComponentReferenceIndex(ref ComponentReference) int
- func (cd *ComponentDescriptor) GetComponentReferences(selectors ...IdentitySelector) ([]ComponentReference, error)
- func (cd *ComponentDescriptor) GetEffectiveRepositoryContext() *runtime.UnstructuredTypedObject
- func (cd *ComponentDescriptor) GetExternalResource(rtype, name, version string) (Resource, error)
- func (cd *ComponentDescriptor) GetExternalResources(rtype, name, version string) (Resources, error)deprecated
- func (cd *ComponentDescriptor) GetLocalResource(rtype, name, version string) (Resource, error)
- func (cd *ComponentDescriptor) GetLocalResources(rtype, name, version string) (Resources, error)
- func (cd *ComponentDescriptor) GetReferenceAccessByIdentity(id v1.Identity) *ComponentReference
- func (cd *ComponentDescriptor) GetReferenceByIdentity(id v1.Identity) (ComponentReference, error)
- func (cd *ComponentDescriptor) GetReferenceIndex(src ElementMetaProvider) int
- func (cd *ComponentDescriptor) GetReferenceIndexByIdentity(id v1.Identity) int
- func (cd *ComponentDescriptor) GetReferences() []ComponentReference
- func (cd *ComponentDescriptor) GetReferencesByIdentitySelectors(selectors ...IdentitySelector) (References, error)
- func (cd *ComponentDescriptor) GetReferencesByName(name string, selectors ...IdentitySelector) (References, error)
- func (cd *ComponentDescriptor) GetReferencesByReferenceSelectors(selectors ...ReferenceSelector) (References, error)
- func (cd *ComponentDescriptor) GetReferencesBySelectors(selectors []IdentitySelector, referenceSelectors []ReferenceSelector) (References, error)
- func (cd *ComponentDescriptor) GetResourceAccessByIdentity(id v1.Identity) *Resourcedeprecated
- func (cd *ComponentDescriptor) GetResourceByDefaultSelector(sel interface{}) (Resources, error)
- func (cd *ComponentDescriptor) GetResourceByIdentity(id v1.Identity) (Resource, error)
- func (cd *ComponentDescriptor) GetResourceByJSONScheme(src interface{}) (Resources, error)
- func (cd *ComponentDescriptor) GetResourceByRegexSelector(sel interface{}) (Resources, error)deprecated
- func (cd *ComponentDescriptor) GetResourceIndex(res *ResourceMeta) int
- func (cd *ComponentDescriptor) GetResourceIndexByIdentity(id v1.Identity) int
- func (cd *ComponentDescriptor) GetResources() []Resource
- func (cd *ComponentDescriptor) GetResourcesByIdentitySelectors(selectors ...IdentitySelector) (Resources, error)
- func (cd *ComponentDescriptor) GetResourcesByName(name string, selectors ...IdentitySelector) (Resources, error)deprecated
- func (cd *ComponentDescriptor) GetResourcesByResourceSelectors(selectors ...ResourceSelector) (Resources, error)deprecated
- func (cd *ComponentDescriptor) GetResourcesBySelectors(selectors []IdentitySelector, resourceSelectors []ResourceSelector) (Resources, error)deprecated
- func (cd *ComponentDescriptor) GetResourcesByType(rtype string, selectors ...IdentitySelector) (Resources, error)deprecated
- func (cd *ComponentDescriptor) GetSignatureIndex(name string) int
- func (cd *ComponentDescriptor) GetSourceAccessByIdentity(id v1.Identity) *Sourcedeprecated
- func (cd *ComponentDescriptor) GetSourceByIdentity(id v1.Identity) (Source, error)
- func (cd *ComponentDescriptor) GetSourceIndex(src *SourceMeta) int
- func (cd *ComponentDescriptor) GetSourceIndexByIdentity(id v1.Identity) int
- func (cd *ComponentDescriptor) GetSources() []Source
- func (cd *ComponentDescriptor) GetSourcesByIdentitySelectors(selectors ...IdentitySelector) (Sources, error)deprecated
- func (cd *ComponentDescriptor) GetSourcesByName(name string, selectors ...IdentitySelector) (Sources, error)deprecated
- func (cd *ComponentDescriptor) HasResourceDigests() bool
- func (cd *ComponentDescriptor) IsNormalizeable() error
- func (cd *ComponentDescriptor) Reset()
- func (cd *ComponentDescriptor) SchemaVersion() string
- func (cd *ComponentDescriptor) SelectReferences(sel ...refsel.Selector) ([]ComponentReference, error)
- func (cd *ComponentDescriptor) SelectResources(sel ...rscsel.Selector) ([]Resource, error)
- func (cd *ComponentDescriptor) SelectSignatureByName(signatureName string) *metav1.Signature
- func (cd *ComponentDescriptor) SelectSources(sel ...srcsel.Selector) ([]Source, error)
- type ComponentDescriptorVersion
- type ComponentReference
- func (r *ComponentReference) Copy() *ComponentReference
- func (r *ComponentReference) Equivalent(e ElementMetaAccessor) equivalent.EqualState
- func (o *ComponentReference) Fresh() *ComponentReference
- func (r *ComponentReference) GetComponentName() string
- func (r *ComponentReference) GetDigest() *metav1.DigestSpec
- func (r *ComponentReference) SetDigest(d *metav1.DigestSpec)
- func (r ComponentReference) String() string
- func (o *ComponentReference) WithExtraIdentity(extras ...string) *ComponentReference
- func (o *ComponentReference) WithVersion(v string) *ComponentReference
- type ComponentSpec
- type DecodeOption
- type DecodeOptions
- type Decoder
- type DecoderFunc
- type DigestSpec
- type DisableValidation
- type ElementAccessor
- type ElementArtifactAccessor
- type ElementBasedSelectordeprecated
- type ElementDigestAccessor
- type ElementMeta
- func (o *ElementMeta) AddExtraIdentity(identity metav1.Identity)
- func (o *ElementMeta) Copy() *ElementMeta
- func (o *ElementMeta) Equivalent(a *ElementMeta) equivalent.EqualState
- func (o *ElementMeta) GetExtraIdentity() metav1.Identity
- func (o *ElementMeta) GetIdentity(accessor ElementAccessor) metav1.Identity
- func (o *ElementMeta) GetIdentityDigest(accessor ElementAccessor) []byte
- func (o *ElementMeta) GetIdentityForContext(accessor accessors.ElementListAccessor) metav1.Identity
- func (o *ElementMeta) GetLabels() metav1.Labels
- func (o *ElementMeta) GetMatchBaseIdentity() metav1.Identity
- func (r *ElementMeta) GetMeta() *ElementMeta
- func (o *ElementMeta) GetName() string
- func (o *ElementMeta) GetRawIdentity() metav1.Identity
- func (o *ElementMeta) GetVersion() string
- func (o *ElementMeta) RemoveLabel(name string) bool
- func (o *ElementMeta) SetExtraIdentity(identity metav1.Identity)
- func (o *ElementMeta) SetLabel(name string, value interface{}, opts ...metav1.LabelOption) error
- func (o *ElementMeta) SetLabels(labels []metav1.Label)
- func (o *ElementMeta) SetName(name string)
- func (o *ElementMeta) SetVersion(version string)
- type ElementMetaAccess
- type ElementMetaAccessor
- type ElementMetaProvider
- type ElementSelectionContextdeprecated
- type ElementSelectordeprecated
- type EncodeOption
- type EncodeOptions
- type Encoder
- type EncoderFunc
- type Identity
- type IdentityBasedSelectordeprecated
- func ByIdentity(name string, extras ...string) IdentityBasedSelectordeprecated
- func ByName(name string) IdentityBasedSelectordeprecated
- func ByPartialIdentity(name string, extras ...string) IdentityBasedSelectordeprecated
- func ByVersion(version string) IdentityBasedSelectordeprecated
- func WithExtraIdentity(args ...string) IdentityBasedSelectordeprecated
- type IdentitySelectordeprecated
- type Label
- type LabelBasedSelectordeprecated
- func ByLabel(sel ...LabelSelector) LabelBasedSelectordeprecated
- func ByLabelName(name string) LabelBasedSelectordeprecated
- func ByLabelValue(value interface{}) LabelBasedSelectordeprecated
- func ByLabelVersion(version string) LabelBasedSelectordeprecated
- func BySignedLabel(flags ...bool) LabelBasedSelectordeprecated
- type LabelOption
- type LabelSelectordeprecated
- type LabelSelectorFuncdeprecated
- type Labels
- type LabelsAccessor
- type Metadata
- type NameAccessor
- type NormalisationAlgorithm
- type Normalization
- type NormalizationAlgorithms
- type ObjectMeta
- type ObjectMetaAccessor
- type Provider
- type ProviderName
- type ReferenceSelectionContextdeprecated
- type ReferenceSelectordeprecated
- type ReferenceSelectorFuncdeprecated
- type References
- type Resource
- func (r *Resource) Copy() *Resource
- func (r *Resource) Equivalent(e ElementMetaAccessor) equivalent.EqualState
- func (r *Resource) GetAccess() AccessSpec
- func (r *Resource) GetDigest() *metav1.DigestSpec
- func (r *Resource) GetRelation() metav1.ResourceRelation
- func (r *Resource) SetAccess(a AccessSpec)
- func (r *Resource) SetDigest(d *metav1.DigestSpec)
- type ResourceMeta
- func (o *ResourceMeta) Copy() *ResourceMeta
- func (o *ResourceMeta) Fresh() *ResourceMeta
- func (o *ResourceMeta) GetType() string
- func (o *ResourceMeta) SetDigest(d *metav1.DigestSpec)
- func (o *ResourceMeta) SetType(ttype string)
- func (o *ResourceMeta) WithExtraIdentity(extras ...string) *ResourceMeta
- func (o *ResourceMeta) WithLabel(l *Label) *ResourceMeta
- func (o *ResourceMeta) WithVersion(v string) *ResourceMeta
- type ResourceRelation
- type ResourceSelectionContextdeprecated
- type ResourceSelectordeprecated
- func AndR(sel ...ResourceSelector) ResourceSelectordeprecated
- func ByAccessMethod(name string) ResourceSelectordeprecated
- func ByResourceType(ttype string) ResourceSelectordeprecated
- func ForExecutable(name string) ResourceSelectordeprecated
- func NotR(sel ResourceSelector) ResourceSelectordeprecated
- func OrR(sel ...ResourceSelector) ResourceSelectordeprecated
- type ResourceSelectorFuncdeprecated
- type Resources
- type SchemaVersion
- type Scheme
- type Schemes
- type Signature
- type SignatureSpec
- type Signatures
- type Source
- type SourceMeta
- type SourceRef
- type SourceRefs
- type Sources
- type StrictDecoder
- type StrictDecoderFunc
- type StrictMode
- type Timestamp
- type VersionAccessor
Constants ¶
const ( SystemIdentityName = metav1.SystemIdentityName SystemIdentityVersion = metav1.SystemIdentityVersion )
const ( LocalRelation = metav1.LocalRelation ExternalRelation = metav1.ExternalRelation NoDigest = metav1.NoDigest )
const ( NoneType = "none" NoneLegacyType = "None" )
Type is the access type for no blob.
const ( KIND_HASH_ALGORITHM = signutils.KIND_HASH_ALGORITHM KIND_SIGN_ALGORITHM = signutils.KIND_SIGN_ALGORITHM KIND_NORM_ALGORITHM = signutils.KIND_NORM_ALGORITHM KIND_VERIFY_ALGORITHM = signutils.KIND_VERIFY_ALGORITHM KIND_PUBLIC_KEY = signutils.KIND_PUBLIC_KEY KIND_PRIVATE_KEY = signutils.KIND_PRIVATE_KEY KIND_SIGNATURE = signutils.KIND_SIGNATURE KIND_DIGEST = signutils.KIND_DIGEST )
const ComponentDescriptorFileName = "component-descriptor.yaml"
const DefaultSchemeVersion = "v2"
const InternalSchemaVersion = "internal"
const KIND_REFERENCE = "component reference"
Variables ¶
var ( REALM = logging.DefineSubRealm("component descriptor handling", "compdesc") Logger = logging.DynamicLogger(REALM) )
var DefaultJSONCodec = CodecWrapper{ Decoder: DecoderFunc(json.Unmarshal), StrictDecoder: StrictDecoderFunc(json.Unmarshal), Encoder: EncoderFunc(json.Marshal), }
DefaultJSONCodec implements Codec interface with the json decoder encoder.
var DefaultSchemes = Schemes{}
var DefaultYAMLCodec = CodecWrapper{ Decoder: DecoderFunc(func(data []byte, obj interface{}) error { return yaml.Unmarshal(data, obj) }), StrictDecoder: StrictDecoderFunc(func(data []byte, obj interface{}) error { return yaml.UnmarshalStrict(data, obj) }), Encoder: EncoderFunc(yaml.Marshal), }
DefaultYAMLCodec implements Codec interface with the yaml decoder encoder.
var Normalizations = NormalizationAlgorithms{/* contains filtered or unexported fields */}
var NotFound = errors.ErrNotFound()
Functions ¶
func CatchConversionError ¶
func CatchConversionError(errp *error)
func DefaultResources ¶
func DefaultResources(component *ComponentDescriptor)
DefaultResources defaults a list of resources. The version of the component is defaulted for local resources that do not contain a version. adds the version as identity if the resource identity would clash otherwise.
func ElementIndex ¶ added in v0.13.0
func ElementIndex(acc ElementAccessor, metaprovider ElementMetaProvider) int
ElementIndex determines the index of an element in the element list for a given ElementMeta. If no element is found -1 is returned.
func Encode ¶
func Encode(obj *ComponentDescriptor, opts ...EncodeOption) ([]byte, error)
Encode encodes a component into the given object. If the serialization version is left blank, the schema version configured in the component descriptor will be used.
func EquivalentElems ¶ added in v0.4.1
func EquivalentElems(a ElementAccessor, b ElementAccessor) equivalent.EqualState
func GetIndexByIdentity ¶ added in v0.4.1
func GetIndexByIdentity(a ElementAccessor, id metav1.Identity) int
func Hash ¶
Hash return the hash for the component-descriptor, if it is normalizeable (= componentReferences and resources contain digest field).
func IsIdentity ¶ added in v0.4.1
func IsNoneAccess ¶ added in v0.4.1
func IsNoneAccess(a AccessSpec) bool
func IsNoneAccessKind ¶ added in v0.4.1
func MapToSelectorElementList ¶ added in v0.13.0
func MapToSelectorElementList(accessor ElementAccessor) accessors.ElementListAccessor
func MapToSelectorReference ¶ added in v0.13.0
func MapToSelectorReference(r *ComponentReference) accessors.ReferenceAccessor
func MapToSelectorResource ¶ added in v0.13.0
func MapToSelectorResource(r *Resource) accessors.ResourceAccessor
func MapToSelectorSource ¶ added in v0.13.0
func MapToSelectorSource(r *Source) accessors.SourceAccessor
func MatchLabels
deprecated
added in
v0.3.0
func MatchLabels(labels v1.Labels, sel ...LabelSelector) (bool, error)
MatchLabels checks whether a set of labels matches the given label selectors.
Deprecated: use package selectors and its sub packages.
func MatchReferencesByReferenceSelector
deprecated
added in
v0.3.0
func MatchReferencesByReferenceSelector(obj ReferenceSelectionContext, resourceSelectors ...ReferenceSelector) (bool, error)
MatchReferencesByReferenceSelector applies all resource selector against the given resource object.
Deprecated: use package selectors and its sub packages.
func MatchResourceByResourceSelector
deprecated
added in
v0.3.0
func MatchResourceByResourceSelector(obj ResourceSelectionContext, resourceSelectors ...ResourceSelector) (bool, error)
MatchResourceByResourceSelector applies all resource selector against the given resource object.
Deprecated: use package selectors and its sub packages.
func RegisterScheme ¶
func RegisterScheme(scheme Scheme)
func SelectLabels
deprecated
added in
v0.3.0
func Sign ¶
func Sign(cctx credentials.Context, cd *ComponentDescriptor, privateKey signutils.GenericPrivateKey, signer signing.Signer, hasher signing.Hasher, signatureName, issuer string) error
Sign signs the given component-descriptor with the signer. The component-descriptor has to contain digests for componentReferences and resources.
func ThrowConversionError ¶
func ThrowConversionError(err error)
func Validate ¶
func Validate(desc *ComponentDescriptor) error
func Verify ¶
func Verify(cd *ComponentDescriptor, registry signing.Registry, signatureName string, rootCA ...signutils.GenericCertificatePool) error
Verify verifies the signature (selected by signatureName) and hash of the component-descriptor (as specified in the signature). Does NOT resolve resources or referenced component-descriptors. Returns error if verification fails.
func WithSigning ¶ added in v0.4.1
func WithSigning(b ...bool)
func WithVersion ¶ added in v0.4.1
func WithVersion(v string)
Types ¶
type AccessProvider ¶ added in v0.4.1
type AccessProvider interface {
GetAccess() AccessSpec
}
AccessProvider provides access to an access specification of elements.
type AccessSpec ¶
type AccessSpec = accessors.AccessSpec
AccessSpec is an abstract specification of an access method The outbound object is typicall a runtime.UnstructuredTypedObject. Inbound any serializable AccessSpec implementation is possible.
func GenericAccessSpec ¶
func GenericAccessSpec(un *runtime.UnstructuredTypedObject) AccessSpec
GenericAccessSpec returns a generic AccessSpec implementation for an unstructured object. It can always be used instead of a dedicated access spec implementation. The core methods will map these spec into effective ones before an access is returned to the caller.
type ArtifactAccess ¶
type ArtifactAccess func(cd *ComponentDescriptor) ArtifactAccessor
ArtifactAccess provides access to a dedicated kind of artifact set in the component descriptor (resources or sources).
type ArtifactAccessor ¶
type ArtifactAccessor interface { ElementAccessor GetArtifact(i int) ElementArtifactAccessor }
ArtifactAccessor provides generic access to list of artifacts. There are resources or sources.
func ResourceArtifacts ¶
func ResourceArtifacts(cd *ComponentDescriptor) ArtifactAccessor
func SourceArtifacts ¶
func SourceArtifacts(cd *ComponentDescriptor) ArtifactAccessor
type ArtifactMetaAccess ¶ added in v0.4.1
type ArtifactMetaAccess interface { ElementMetaAccess GetType() string SetType(string) }
type ArtifactMetaPointer ¶ added in v0.5.0
type ArtifactMetaPointer[P any] interface { ArtifactMetaAccess *P }
ArtifactMetaPointer is a pointer to an artifact meta object.
type Codec ¶
type Codec interface { Decoder StrictDecoder Encoder }
Codec describes an encoding for en object.
type CodecWrapper ¶
type CodecWrapper struct { Decoder StrictDecoder Encoder }
CodecWrapper is a simple struct that implements the Codec interface.
func (CodecWrapper) ApplyDecodeOption ¶
func (o CodecWrapper) ApplyDecodeOption(options *DecodeOptions)
ApplyDecodeOption applies the configured codec.
func (CodecWrapper) ApplyEncodeOption ¶
func (o CodecWrapper) ApplyEncodeOption(options *EncodeOptions)
ApplyEncodeOption applies the configured codec.
type CompDescDigest ¶ added in v0.6.0
type CompDescDigest struct {
// contains filtered or unexported fields
}
type CompDescDigests ¶ added in v0.6.0
type CompDescDigests struct {
// contains filtered or unexported fields
}
func NewCompDescDigests ¶ added in v0.6.0
func NewCompDescDigests(cd *ComponentDescriptor) *CompDescDigests
func (*CompDescDigests) Descriptor ¶ added in v0.6.0
func (d *CompDescDigests) Descriptor() *ComponentDescriptor
type ComponentDescriptor ¶
type ComponentDescriptor struct { // Metadata specifies the schema version of the component. Metadata Metadata `json:"meta"` // Spec contains the specification of the component. ComponentSpec `json:"component"` // Signatures contains a list of signatures for the ComponentDescriptor Signatures metav1.Signatures `json:"signatures,omitempty"` // NestedDigets describe calculated resource digests for aggregated // component versions, which might not be persisted, but incorporated // into signatures of the actual component version NestedDigests metav1.NestedDigests `json:"nestedDigests,omitempty"` }
ComponentDescriptor defines a versioned component with a source and dependencies. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func Decode ¶
func Decode(data []byte, opts ...DecodeOption) (*ComponentDescriptor, error)
Decode decodes a component into the given object.
func DefaultComponent ¶
func DefaultComponent(component *ComponentDescriptor) *ComponentDescriptor
DefaultComponent applies defaults to a component.
func New ¶
func New(name, version string) *ComponentDescriptor
func (*ComponentDescriptor) AddRepositoryContext ¶
func (cd *ComponentDescriptor) AddRepositoryContext(repoCtx runtime.TypedObject) error
AddRepositoryContext appends the given repository context to components descriptor repository history. The context is not appended if the effective repository context already matches the current context.
func (*ComponentDescriptor) Copy ¶
func (cd *ComponentDescriptor) Copy() *ComponentDescriptor
func (*ComponentDescriptor) Equal ¶ added in v0.3.0
func (cd *ComponentDescriptor) Equal(obj interface{}) bool
func (*ComponentDescriptor) Equivalent ¶ added in v0.3.0
func (cd *ComponentDescriptor) Equivalent(o *ComponentDescriptor) equivalent.EqualState
func (*ComponentDescriptor) GetComponentReferenceIndex ¶
func (cd *ComponentDescriptor) GetComponentReferenceIndex(ref ComponentReference) int
GetComponentReferenceIndex returns the index of a given component reference. If the index is not found -1 is returned. Deprecated: use GetReferenceIndex.
func (*ComponentDescriptor) GetComponentReferences ¶
func (cd *ComponentDescriptor) GetComponentReferences(selectors ...IdentitySelector) ([]ComponentReference, error)
GetComponentReferences returns all component references that matches the given selectors.
Deprectated: use GetReferences with appropriate selectors.
func (*ComponentDescriptor) GetEffectiveRepositoryContext ¶
func (cd *ComponentDescriptor) GetEffectiveRepositoryContext() *runtime.UnstructuredTypedObject
GetEffectiveRepositoryContext returns the currently active repository context.
func (*ComponentDescriptor) GetExternalResource ¶
func (cd *ComponentDescriptor) GetExternalResource(rtype, name, version string) (Resource, error)
GetExternalResource returns external resource with the given type, name and version.
If multiple resources match, the first one is returned. Deprecated: use GetResources with appropriate selectors.
func (*ComponentDescriptor) GetExternalResources
deprecated
func (cd *ComponentDescriptor) GetExternalResources(rtype, name, version string) (Resources, error)
GetExternalResources returns external resource with the given type, name and version.
Deprecated: use GetResources with appropriate selectors.
func (*ComponentDescriptor) GetLocalResource ¶
func (cd *ComponentDescriptor) GetLocalResource(rtype, name, version string) (Resource, error)
GetLocalResource returns a local resource with the given type, name and version.
If multiple resources match, the first one is returned. Deprecated: use GetResources with appropriate selectors.
func (*ComponentDescriptor) GetLocalResources ¶
func (cd *ComponentDescriptor) GetLocalResources(rtype, name, version string) (Resources, error)
GetLocalResources returns all local resources with the given type, name and version.
func (*ComponentDescriptor) GetReferenceAccessByIdentity ¶ added in v0.4.1
func (cd *ComponentDescriptor) GetReferenceAccessByIdentity(id v1.Identity) *ComponentReference
GetReferenceAccessByIdentity returns a pointer to the reference that matches the given identity. Deprectated: use GetReferenceByIdentity.
func (*ComponentDescriptor) GetReferenceByIdentity ¶
func (cd *ComponentDescriptor) GetReferenceByIdentity(id v1.Identity) (ComponentReference, error)
GetReferenceByIdentity returns reference that matches the given identity.
func (*ComponentDescriptor) GetReferenceIndex ¶
func (cd *ComponentDescriptor) GetReferenceIndex(src ElementMetaProvider) int
GetReferenceIndex returns the index of a given source. If the index is not found -1 is returned.
func (*ComponentDescriptor) GetReferenceIndexByIdentity ¶ added in v0.4.1
func (cd *ComponentDescriptor) GetReferenceIndexByIdentity(id v1.Identity) int
GetReferenceIndexByIdentity returns the index of the reference that matches the given identity.
func (*ComponentDescriptor) GetReferences ¶ added in v0.13.0
func (cd *ComponentDescriptor) GetReferences() []ComponentReference
func (*ComponentDescriptor) GetReferencesByIdentitySelectors ¶ added in v0.3.0
func (cd *ComponentDescriptor) GetReferencesByIdentitySelectors(selectors ...IdentitySelector) (References, error)
GetReferencesByIdentitySelectors returns resources that match the given identity selectors. Deprectated: use GetReferences with appropriate selectors.
func (*ComponentDescriptor) GetReferencesByName ¶ added in v0.3.0
func (cd *ComponentDescriptor) GetReferencesByName(name string, selectors ...IdentitySelector) (References, error)
GetReferencesByName returns references that match the given name. Deprectated: use GetReferences with appropriate selectors.
func (*ComponentDescriptor) GetReferencesByReferenceSelectors ¶ added in v0.3.0
func (cd *ComponentDescriptor) GetReferencesByReferenceSelectors(selectors ...ReferenceSelector) (References, error)
GetReferencesByReferenceSelectors returns resources that match the given resource selectors. Deprectated: use GetReferences with appropriate selectors.
func (*ComponentDescriptor) GetReferencesBySelectors ¶ added in v0.3.0
func (cd *ComponentDescriptor) GetReferencesBySelectors(selectors []IdentitySelector, referenceSelectors []ReferenceSelector) (References, error)
GetReferencesBySelectors returns resources that match the given selector. Deprectated: use GetReferences with appropriate selectors.
func (*ComponentDescriptor) GetResourceAccessByIdentity
deprecated
added in
v0.4.1
func (cd *ComponentDescriptor) GetResourceAccessByIdentity(id v1.Identity) *Resource
GetResourceAccessByIdentity returns a pointer to the resource that matches the given identity.
Deprecated: use GetResourceByIdentity.
func (*ComponentDescriptor) GetResourceByDefaultSelector ¶
func (cd *ComponentDescriptor) GetResourceByDefaultSelector(sel interface{}) (Resources, error)
GetResourceByDefaultSelector returns resources that match the given selectors.
func (*ComponentDescriptor) GetResourceByIdentity ¶
func (cd *ComponentDescriptor) GetResourceByIdentity(id v1.Identity) (Resource, error)
GetResourceByIdentity returns resource that matches the given identity.
func (*ComponentDescriptor) GetResourceByJSONScheme ¶
func (cd *ComponentDescriptor) GetResourceByJSONScheme(src interface{}) (Resources, error)
GetResourceByJSONScheme returns resources that match the given selectors.
func (*ComponentDescriptor) GetResourceByRegexSelector
deprecated
func (cd *ComponentDescriptor) GetResourceByRegexSelector(sel interface{}) (Resources, error)
GetResourceByRegexSelector returns resources that match the given selectors.
Deprecated: use GetResources with appropriate selectors.
func (*ComponentDescriptor) GetResourceIndex ¶
func (cd *ComponentDescriptor) GetResourceIndex(res *ResourceMeta) int
GetResourceIndex returns the index of a given resource. If the index is not found -1 is returned.
func (*ComponentDescriptor) GetResourceIndexByIdentity ¶ added in v0.4.1
func (cd *ComponentDescriptor) GetResourceIndexByIdentity(id v1.Identity) int
GetResourceIndexByIdentity returns the index of the resource that matches the given identity.
func (*ComponentDescriptor) GetResources ¶ added in v0.13.0
func (cd *ComponentDescriptor) GetResources() []Resource
func (*ComponentDescriptor) GetResourcesByIdentitySelectors ¶ added in v0.3.0
func (cd *ComponentDescriptor) GetResourcesByIdentitySelectors(selectors ...IdentitySelector) (Resources, error)
GetResourcesByIdentitySelectors returns resources that match the given identity selectors. Deprecated: use GetResources with appropriate selectors.
func (*ComponentDescriptor) GetResourcesByName
deprecated
func (cd *ComponentDescriptor) GetResourcesByName(name string, selectors ...IdentitySelector) (Resources, error)
GetResourcesByName returns all local and external resources with a name.
Deprecated: use GetResources with appropriate selectors.
func (*ComponentDescriptor) GetResourcesByResourceSelectors
deprecated
added in
v0.3.0
func (cd *ComponentDescriptor) GetResourcesByResourceSelectors(selectors ...ResourceSelector) (Resources, error)
GetResourcesByResourceSelectors returns resources that match the given resource selectors.
Deprecated: use GetResources with appropriate selectors.
func (*ComponentDescriptor) GetResourcesBySelectors
deprecated
added in
v0.3.0
func (cd *ComponentDescriptor) GetResourcesBySelectors(selectors []IdentitySelector, resourceSelectors []ResourceSelector) (Resources, error)
GetResourcesBySelectors returns resources that match the given selector.
Deprecated: use GetResources with appropriate selectors.
func (*ComponentDescriptor) GetResourcesByType
deprecated
func (cd *ComponentDescriptor) GetResourcesByType(rtype string, selectors ...IdentitySelector) (Resources, error)
GetResourcesByType returns all resources that match the given type and selectors.
Deprecated: use GetResources with appropriate selectors.
func (*ComponentDescriptor) GetSignatureIndex ¶
func (cd *ComponentDescriptor) GetSignatureIndex(name string) int
GetSignatureIndex returns the index of the signature with the given name If the index is not found -1 is returned.
func (*ComponentDescriptor) GetSourceAccessByIdentity
deprecated
added in
v0.4.1
func (cd *ComponentDescriptor) GetSourceAccessByIdentity(id v1.Identity) *Source
GetSourceAccessByIdentity returns a pointer to the source that matches the given identity.
Deprecated: use GetSourceByIdentity.
func (*ComponentDescriptor) GetSourceByIdentity ¶
func (cd *ComponentDescriptor) GetSourceByIdentity(id v1.Identity) (Source, error)
GetSourceByIdentity returns source that match the given identity.
func (*ComponentDescriptor) GetSourceIndex ¶
func (cd *ComponentDescriptor) GetSourceIndex(src *SourceMeta) int
GetSourceIndex returns the index of a given source. If the index is not found -1 is returned.
func (*ComponentDescriptor) GetSourceIndexByIdentity ¶ added in v0.4.1
func (cd *ComponentDescriptor) GetSourceIndexByIdentity(id v1.Identity) int
GetSourceIndexByIdentity returns the index of the source that matches the given identity.
func (*ComponentDescriptor) GetSources ¶ added in v0.13.0
func (cd *ComponentDescriptor) GetSources() []Source
func (*ComponentDescriptor) GetSourcesByIdentitySelectors
deprecated
added in
v0.3.0
func (cd *ComponentDescriptor) GetSourcesByIdentitySelectors(selectors ...IdentitySelector) (Sources, error)
GetSourcesByIdentitySelectors returns references that match the given selector.
Deprecated: use GetSources with appropriate selectors.
func (*ComponentDescriptor) GetSourcesByName
deprecated
added in
v0.13.0
func (cd *ComponentDescriptor) GetSourcesByName(name string, selectors ...IdentitySelector) (Sources, error)
GetSourcesByName returns all sources with a name.
Deprecated: use GetSources with appropriate selectors.
func (*ComponentDescriptor) HasResourceDigests ¶ added in v0.4.1
func (cd *ComponentDescriptor) HasResourceDigests() bool
func (*ComponentDescriptor) IsNormalizeable ¶
func (cd *ComponentDescriptor) IsNormalizeable() error
IsNormalizeable checks if componentReferences and resources contain digest. Resources are allowed to omit the digest, if res.access.type == None or res.access == nil. Does NOT verify if the digests are correct.
func (*ComponentDescriptor) Reset ¶
func (cd *ComponentDescriptor) Reset()
func (*ComponentDescriptor) SchemaVersion ¶
func (cd *ComponentDescriptor) SchemaVersion() string
SchemaVersion returns the scheme version configured in the representation.
func (*ComponentDescriptor) SelectReferences ¶ added in v0.13.0
func (cd *ComponentDescriptor) SelectReferences(sel ...refsel.Selector) ([]ComponentReference, error)
func (*ComponentDescriptor) SelectResources ¶ added in v0.13.0
func (cd *ComponentDescriptor) SelectResources(sel ...rscsel.Selector) ([]Resource, error)
func (*ComponentDescriptor) SelectSignatureByName ¶
func (cd *ComponentDescriptor) SelectSignatureByName(signatureName string) *metav1.Signature
SelectSignatureByName returns the Signature (Digest and SigantureSpec) matching the given name.
func (*ComponentDescriptor) SelectSources ¶ added in v0.13.0
func (cd *ComponentDescriptor) SelectSources(sel ...srcsel.Selector) ([]Source, error)
type ComponentDescriptorVersion ¶
type ComponentDescriptorVersion interface { SchemaVersion() string GetName() string GetVersion() string Normalize(normAlgo string) ([]byte, error) }
func Convert ¶
func Convert(obj *ComponentDescriptor, opts ...EncodeOption) (ComponentDescriptorVersion, error)
Convert converts a component descriptor into a dedicated scheme version. If the serialization version is left blank, the schema version configured in the component descriptor will be used.
type ComponentReference ¶
type ComponentReference struct { ElementMeta `json:",inline"` // ComponentName describes the remote name of the referenced object ComponentName string `json:"componentName"` // Digest is the optional digest of the referenced component. // +optional Digest *metav1.DigestSpec `json:"digest,omitempty"` }
ComponentReference describes the reference to another component in the registry. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func NewComponentReference ¶
func NewComponentReference(name, componentName, version string, extraIdentity metav1.Identity) *ComponentReference
func (*ComponentReference) Copy ¶
func (r *ComponentReference) Copy() *ComponentReference
func (*ComponentReference) Equivalent ¶ added in v0.4.1
func (r *ComponentReference) Equivalent(e ElementMetaAccessor) equivalent.EqualState
func (*ComponentReference) Fresh ¶ added in v0.4.1
func (o *ComponentReference) Fresh() *ComponentReference
Fresh returns a digest-free copy.
func (*ComponentReference) GetComponentName ¶
func (r *ComponentReference) GetComponentName() string
func (*ComponentReference) GetDigest ¶ added in v0.4.1
func (r *ComponentReference) GetDigest() *metav1.DigestSpec
func (*ComponentReference) SetDigest ¶ added in v0.4.1
func (r *ComponentReference) SetDigest(d *metav1.DigestSpec)
func (ComponentReference) String ¶
func (r ComponentReference) String() string
func (*ComponentReference) WithExtraIdentity ¶ added in v0.13.0
func (o *ComponentReference) WithExtraIdentity(extras ...string) *ComponentReference
WithExtraIdentity returns a new reference with a dedicated version.
func (*ComponentReference) WithVersion ¶ added in v0.13.0
func (o *ComponentReference) WithVersion(v string) *ComponentReference
WithVersion returns a new reference with a dedicated version.
type ComponentSpec ¶
type ComponentSpec struct { metav1.ObjectMeta `json:",inline"` // RepositoryContexts defines the previous repositories of the component RepositoryContexts runtime.UnstructuredTypedObjectList `json:"repositoryContexts"` // Sources defines sources that produced the component Sources Sources `json:"sources"` // References references component dependencies that can be resolved in the current context. References References `json:"componentReferences"` // Resources defines all resources that are created by the component and by a third party. Resources Resources `json:"resources"` }
ComponentSpec defines a virtual component with a repository context, source and dependencies. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
type DecodeOption ¶
type DecodeOption interface {
ApplyDecodeOption(options *DecodeOptions)
}
DecodeOption is the interface to specify different cache options.
type DecodeOptions ¶
DecodeOptions defines decode options for the codec.
func (*DecodeOptions) ApplyDecodeOption ¶
func (o *DecodeOptions) ApplyDecodeOption(options *DecodeOptions)
ApplyDecodeOption applies the actual options.
func (*DecodeOptions) ApplyOptions ¶
func (o *DecodeOptions) ApplyOptions(opts []DecodeOption) *DecodeOptions
ApplyOptions applies the given list options on these options, and then returns itself (for convenient chaining).
type DecoderFunc ¶
DecoderFunc is a simple function that implements the Decoder interface.
func (DecoderFunc) Decode ¶
func (e DecoderFunc) Decode(data []byte, obj interface{}) error
Decode is the Decode implementation of the Decoder interface.
type DigestSpec ¶ added in v0.4.1
type DigestSpec = metav1.DigestSpec
func NewExcludeFromSignatureDigest ¶ added in v0.4.1
func NewExcludeFromSignatureDigest() *DigestSpec
type DisableValidation ¶
type DisableValidation bool
DisableValidation enables or disables validation of the component descriptor.
func (DisableValidation) ApplyDecodeOption ¶
func (v DisableValidation) ApplyDecodeOption(options *DecodeOptions)
ApplyDecodeOption applies the validation disable option.
type ElementAccessor ¶
type ElementAccessor interface { Len() int Get(i int) ElementMetaAccessor }
ElementAccessor provides generic access to list of elements.
type ElementArtifactAccessor ¶
type ElementArtifactAccessor interface { ElementMetaAccessor GetType() string GetAccess() AccessSpec SetAccess(a AccessSpec) }
ElementArtifactAccessor provides access to generic artifact information of an element.
type ElementBasedSelector
deprecated
added in
v0.3.0
type ElementBasedSelector interface { ElementSelector ResourceSelector ReferenceSelector }
Deprecated: use package selectors and its sub packages.
type ElementDigestAccessor ¶ added in v0.4.1
type ElementDigestAccessor interface { GetDigest() *metav1.DigestSpec SetDigest(*metav1.DigestSpec) }
type ElementMeta ¶
type ElementMeta struct { // Name is the context unique name of the object. Name string `json:"name"` // Version is the semver version of the object. Version string `json:"version"` // ExtraIdentity is the identity of an object. // An additional label with key "name" ist not allowed ExtraIdentity metav1.Identity `json:"extraIdentity,omitempty"` // Labels defines an optional set of additional labels // describing the object. // +optional Labels metav1.Labels `json:"labels,omitempty"` }
ElementMeta defines a object that is uniquely identified by its identity. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*ElementMeta) AddExtraIdentity ¶ added in v0.13.0
func (o *ElementMeta) AddExtraIdentity(identity metav1.Identity)
func (*ElementMeta) Copy ¶
func (o *ElementMeta) Copy() *ElementMeta
func (*ElementMeta) Equivalent ¶ added in v0.4.1
func (o *ElementMeta) Equivalent(a *ElementMeta) equivalent.EqualState
func (*ElementMeta) GetExtraIdentity ¶ added in v0.5.0
func (o *ElementMeta) GetExtraIdentity() metav1.Identity
GetExtraIdentity returns the extra identity of the object.
func (*ElementMeta) GetIdentity ¶
func (o *ElementMeta) GetIdentity(accessor ElementAccessor) metav1.Identity
GetIdentity returns the identity of the object.
func (*ElementMeta) GetIdentityDigest ¶
func (o *ElementMeta) GetIdentityDigest(accessor ElementAccessor) []byte
GetIdentityDigest returns the digest of the object's identity.
func (*ElementMeta) GetIdentityForContext ¶ added in v0.13.0
func (o *ElementMeta) GetIdentityForContext(accessor accessors.ElementListAccessor) metav1.Identity
GetIdentityForContext returns the identity of the object.
func (*ElementMeta) GetLabels ¶
func (o *ElementMeta) GetLabels() metav1.Labels
GetLabels returns the label of the object.
func (*ElementMeta) GetMatchBaseIdentity ¶
func (o *ElementMeta) GetMatchBaseIdentity() metav1.Identity
GetMatchBaseIdentity returns all possible identity attributes for resource matching.
func (*ElementMeta) GetMeta ¶ added in v0.13.0
func (r *ElementMeta) GetMeta() *ElementMeta
GetMeta returns the element meta.
func (*ElementMeta) GetName ¶
func (o *ElementMeta) GetName() string
GetName returns the name of the object.
func (*ElementMeta) GetRawIdentity ¶
func (o *ElementMeta) GetRawIdentity() metav1.Identity
GetRawIdentity returns the identity plus version.
func (*ElementMeta) GetVersion ¶
func (o *ElementMeta) GetVersion() string
GetVersion returns the version of the object.
func (*ElementMeta) RemoveLabel ¶
func (o *ElementMeta) RemoveLabel(name string) bool
RemoveLabel removes a single label.
func (*ElementMeta) SetExtraIdentity ¶
func (o *ElementMeta) SetExtraIdentity(identity metav1.Identity)
SetExtraIdentity sets the identity of the object.
func (*ElementMeta) SetLabel ¶
func (o *ElementMeta) SetLabel(name string, value interface{}, opts ...metav1.LabelOption) error
SetLabel sets a single label to an effective value. If the value is no byte slice, it is marshaled.
func (*ElementMeta) SetLabels ¶
func (o *ElementMeta) SetLabels(labels []metav1.Label)
SetLabels sets the labels of the object.
func (*ElementMeta) SetName ¶
func (o *ElementMeta) SetName(name string)
SetName sets the name of the object.
func (*ElementMeta) SetVersion ¶
func (o *ElementMeta) SetVersion(version string)
SetVersion sets the version of the object.
type ElementMetaAccess ¶ added in v0.4.1
type ElementMetaAccessor ¶
type ElementMetaAccessor interface { ElementMetaProvider Equivalent(ElementMetaAccessor) equivalent.EqualState }
ElementMetaAccessor provides generic access an elements meta information.
func GetByIdentity ¶ added in v0.4.1
func GetByIdentity(a ElementAccessor, id metav1.Identity) ElementMetaAccessor
type ElementMetaProvider ¶ added in v0.13.0
type ElementMetaProvider interface {
GetMeta() *ElementMeta
}
type ElementSelectionContext
deprecated
added in
v0.3.0
type ElementSelectionContext = *elementSelectionContext
Deprecated: not supported anymore.
func NewElementSelectionContext
deprecated
added in
v0.3.0
func NewElementSelectionContext(index int, elems ElementAccessor) ElementSelectionContext
Deprecated: not supported anymore.
type ElementSelector
deprecated
added in
v0.3.0
type ElementSelector interface {
MatchElement(obj ElementSelectionContext) (bool, error)
}
Deprecated: use package selectors and its sub packages.
type EncodeOption ¶
type EncodeOption interface {
ApplyEncodeOption(options *EncodeOptions)
}
EncodeOption is the interface to specify different encode options.
type EncodeOptions ¶
func (*EncodeOptions) ApplyEncodeOption ¶
func (o *EncodeOptions) ApplyEncodeOption(options *EncodeOptions)
ApplyDecodeOption applies the actual options.
func (*EncodeOptions) ApplyOptions ¶
func (o *EncodeOptions) ApplyOptions(opts []EncodeOption) *EncodeOptions
ApplyOptions applies the given list options on these options, and then returns itself (for convenient chaining).
func (*EncodeOptions) DefaultFor ¶
func (o *EncodeOptions) DefaultFor(cd *ComponentDescriptor) *EncodeOptions
type EncoderFunc ¶
EncoderFunc is a simple function that implements the Encoder interface.
func (EncoderFunc) Encode ¶
func (e EncoderFunc) Encode(obj interface{}) ([]byte, error)
Encode is the Encode implementation of the Encoder interface.
type Identity ¶ added in v0.4.1
func NewExtraIdentity ¶ added in v0.4.1
func NewIdentity ¶ added in v0.4.1
type IdentityBasedSelector
deprecated
added in
v0.3.0
type IdentityBasedSelector interface { IdentitySelector ElementSelector ResourceSelector ReferenceSelector }
Deprecated: use package selectors and its sub packages.
func ByIdentity
deprecated
added in
v0.3.0
func ByIdentity(name string, extras ...string) IdentityBasedSelector
ByIdentity creates a new resource and identity selector that selects a resource based on its identity.
Deprecated: use package selectors and its sub packages.
func ByName
deprecated
added in
v0.3.0
func ByName(name string) IdentityBasedSelector
ByName creates a new selector that selects an element based on its name.
Deprecated: use package selectors and its sub packages.
func ByPartialIdentity
deprecated
added in
v0.3.0
func ByPartialIdentity(name string, extras ...string) IdentityBasedSelector
ByPartialIdentity creates a new resource and identity selector that selects a resource based on its partial identity. All given attributes must match, but potential additional attributes of a resource identity are ignored.
Deprecated: use package selectors and its sub packages.
func ByVersion
deprecated
added in
v0.3.0
func ByVersion(version string) IdentityBasedSelector
ByVersion creates a new selector that selects an element based on its version.
Deprecated: use package selectors and its sub packages.
func WithExtraIdentity
deprecated
added in
v0.3.0
func WithExtraIdentity(args ...string) IdentityBasedSelector
WithExtraIdentity creates a new selector that selects an element based on extra identities.
Deprecated: use package selectors and its sub packages.
type IdentitySelector
deprecated
type LabelBasedSelector
deprecated
added in
v0.3.0
type LabelBasedSelector interface { LabelSelector ElementSelector ResourceSelector ReferenceSelector }
Deprecated: use package selectors and its sub packages.
func ByLabel
deprecated
added in
v0.3.0
func ByLabel(sel ...LabelSelector) LabelBasedSelector
ByLabel matches a resource or element for a list of given label selectors matching the same label. If multiple label related selectors should be used, they should be grouped into a single label selector to be applied in combination. Otherwise, a resource might match if the label selectors all match, but different labels.
Deprecated: use package selectors and its sub packages.
func ByLabelName
deprecated
added in
v0.3.0
func ByLabelName(name string) LabelBasedSelector
ByLabelName matches an element by a label name.
Deprecated: use package selectors and its sub packages.
func ByLabelValue
deprecated
added in
v0.3.0
func ByLabelValue(value interface{}) LabelBasedSelector
ByLabelValue matches a resource or label by a label value. This selector should typically be combined with ByLabelName.
Deprecated: use package selectors and its sub packages.
func ByLabelVersion
deprecated
added in
v0.3.0
func ByLabelVersion(version string) LabelBasedSelector
ByLabelVersion matches a resource or label by a label version. This selector should typically be combined with ByLabelName.
Deprecated: use package selectors and its sub packages.
func BySignedLabel
deprecated
added in
v0.3.0
func BySignedLabel(flags ...bool) LabelBasedSelector
BySignedLabel matches a resource or label by a label indicated to be signed. This selector should typically be combined with ByLabelName.
Deprecated: use package selectors and its sub packages.
type LabelOption ¶ added in v0.4.1
type LabelOption = metav1.LabelOption
type LabelSelector
deprecated
added in
v0.3.0
LabelSelector is used to match a label in a label set.
Deprecated: use package selectors and its sub packages.
func AndL
deprecated
added in
v0.3.0
func AndL(sel ...LabelSelector) LabelSelector
AndL is an AND label selector.
Deprecated: use package selectors and its sub packages.
func NotL
deprecated
added in
v0.3.0
func NotL(sel LabelSelector) LabelSelector
NotL is a negated label selector.
Deprecated: use package selectors and its sub packages.
func OrL
deprecated
added in
v0.3.0
func OrL(sel ...LabelSelector) LabelSelector
OrL is an OR label selector.
Deprecated: use package selectors and its sub packages.
type LabelSelectorFunc
deprecated
added in
v0.3.0
type LabelsAccessor ¶
type LabelsAccessor interface { // GetLabels returns the labels of the object. GetLabels() metav1.Labels // SetLabels sets the labels of the object. SetLabels(labels []metav1.Label) }
LabelsAccessor describes a accessor for a labeled object.
type Metadata ¶
type Metadata struct {
ConfiguredVersion string `json:"configuredSchemaVersion"`
}
Metadata defines the configured metadata of the component descriptor. It is taken from the original serialization format. It can be set to define a default serialization version.
type NameAccessor ¶
type NameAccessor interface { // GetName returns the name of the object. GetName() string // SetName sets the name of the object. SetName(name string) }
NameAccessor describes a accessor for a named object.
type NormalisationAlgorithm ¶
type NormalisationAlgorithm = string
NormalisationAlgorithm types and versions the algorithm used for digest generation.
const ( JsonNormalisationV1 NormalisationAlgorithm = "jsonNormalisation/v1" JsonNormalisationV2 NormalisationAlgorithm = "jsonNormalisation/v2" )
type Normalization ¶
type Normalization interface {
Normalize(cd *ComponentDescriptor) ([]byte, error)
}
type NormalizationAlgorithms ¶
func (*NormalizationAlgorithms) Get ¶
func (n *NormalizationAlgorithms) Get(algo string) Normalization
func (*NormalizationAlgorithms) Names ¶
func (n *NormalizationAlgorithms) Names() []string
func (*NormalizationAlgorithms) Normalize ¶
func (n *NormalizationAlgorithms) Normalize(cd *ComponentDescriptor, algo string) ([]byte, error)
func (*NormalizationAlgorithms) Register ¶
func (n *NormalizationAlgorithms) Register(name string, norm Normalization)
type ObjectMeta ¶
type ObjectMeta = metav1.ObjectMeta
type ObjectMetaAccessor ¶
type ObjectMetaAccessor interface { NameAccessor VersionAccessor LabelsAccessor }
ObjectMetaAccessor describes a accessor for named and versioned object.
type ProviderName ¶ added in v0.4.1
type ProviderName = metav1.ProviderName
type ReferenceSelectionContext
deprecated
added in
v0.3.0
type ReferenceSelectionContext = *referenceSelectionContext
ReferenceSelectionContext describes the selection context for a reference selector. It contains the reference and provides access to its identity in the context of its component descriptor.
Deprecated: use package selectors and its sub packages.
func NewReferenceSelectionContext
deprecated
added in
v0.3.0
func NewReferenceSelectionContext(index int, refs References) ReferenceSelectionContext
Deprecated: use package selectors and its sub packages.
type ReferenceSelector
deprecated
added in
v0.3.0
type ReferenceSelector interface {
MatchReference(obj ReferenceSelectionContext) (bool, error)
}
ReferenceSelector defines a selector based on reference attributes.
Deprecated: use package selectors and its sub packages.
func AndC
deprecated
added in
v0.3.0
func AndC(sel ...ReferenceSelector) ReferenceSelector
AndC is an AND reference selector.
Deprecated: use package selectors and its sub packages.
func ByComponent
deprecated
added in
v0.3.0
func ByComponent(name string) ReferenceSelector
Deprecated: use package selectors and its sub packages.
func NotC
deprecated
added in
v0.3.0
func NotC(sel ReferenceSelector) ReferenceSelector
NotC is a negated resource selector.
Deprecated: use package selectors and its sub packages.
func OrC
deprecated
added in
v0.3.0
func OrC(sel ...ReferenceSelector) ReferenceSelector
OrC is an OR resource selector.
Deprecated: use package selectors and its sub packages.
type ReferenceSelectorFunc
deprecated
added in
v0.3.0
type ReferenceSelectorFunc func(obj ReferenceSelectionContext) (bool, error)
ReferenceSelectorFunc defines a function to filter a resource.
Deprecated: use package selectors and its sub packages.
func (ReferenceSelectorFunc) MatchReference ¶ added in v0.3.0
func (s ReferenceSelectorFunc) MatchReference(obj ReferenceSelectionContext) (bool, error)
type References ¶
type References []ComponentReference
func (References) Copy ¶
func (r References) Copy() References
func (References) Equivalent ¶ added in v0.4.1
func (r References) Equivalent(o References) equivalent.EqualState
func (References) Get ¶
func (r References) Get(i int) ElementMetaAccessor
func (References) Len ¶
func (r References) Len() int
func (References) Less ¶
func (r References) Less(i, j int) bool
func (References) Swap ¶
func (r References) Swap(i, j int)
type Resource ¶
type Resource struct { ResourceMeta `json:",inline"` // Access describes the type specific method to // access the defined resource. Access AccessSpec `json:"access"` }
Resource describes a resource dependency of a component. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*Resource) Equivalent ¶ added in v0.4.1
func (r *Resource) Equivalent(e ElementMetaAccessor) equivalent.EqualState
func (*Resource) GetAccess ¶
func (r *Resource) GetAccess() AccessSpec
func (*Resource) GetDigest ¶ added in v0.4.1
func (r *Resource) GetDigest() *metav1.DigestSpec
func (*Resource) GetRelation ¶ added in v0.13.0
func (r *Resource) GetRelation() metav1.ResourceRelation
func (*Resource) SetAccess ¶ added in v0.4.1
func (r *Resource) SetAccess(a AccessSpec)
func (*Resource) SetDigest ¶ added in v0.4.1
func (r *Resource) SetDigest(d *metav1.DigestSpec)
type ResourceMeta ¶
type ResourceMeta struct { ElementMeta `json:",inline"` // Type describes the type of the object. Type string `json:"type"` // Relation describes the relation of the resource to the component. // Can be a local or external resource Relation metav1.ResourceRelation `json:"relation,omitempty"` // SourceRefs defines a list of source names. // These entries reference the sources defined in the // component.sources. SourceRefs SourceRefs `json:"srcRefs,omitempty"` // Digest is the optional digest of the referenced resource. // +optional Digest *metav1.DigestSpec `json:"digest,omitempty"` }
ResourceMeta describes the meta data of a resource. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func NewResourceMeta ¶ added in v0.3.0
func NewResourceMeta(name string, typ string, relation metav1.ResourceRelation) *ResourceMeta
func (*ResourceMeta) Copy ¶
func (o *ResourceMeta) Copy() *ResourceMeta
Copy copies a resource meta.
func (*ResourceMeta) Fresh ¶ added in v0.4.1
func (o *ResourceMeta) Fresh() *ResourceMeta
Fresh returns a digest-free copy.
func (*ResourceMeta) GetType ¶
func (o *ResourceMeta) GetType() string
GetType returns the type of the object.
func (*ResourceMeta) SetDigest ¶ added in v0.4.1
func (o *ResourceMeta) SetDigest(d *metav1.DigestSpec)
SetDigest sets the digest of the object.
func (*ResourceMeta) SetType ¶
func (o *ResourceMeta) SetType(ttype string)
SetType sets the type of the object.
func (*ResourceMeta) WithExtraIdentity ¶ added in v0.13.0
func (o *ResourceMeta) WithExtraIdentity(extras ...string) *ResourceMeta
func (*ResourceMeta) WithLabel ¶ added in v0.13.0
func (o *ResourceMeta) WithLabel(l *Label) *ResourceMeta
func (*ResourceMeta) WithVersion ¶ added in v0.13.0
func (o *ResourceMeta) WithVersion(v string) *ResourceMeta
type ResourceRelation ¶ added in v0.4.1
type ResourceRelation = metav1.ResourceRelation
type ResourceSelectionContext
deprecated
added in
v0.3.0
type ResourceSelectionContext = *resourceSelectionContext
ResourceSelectionContext describes the selction context for a resource selector. It contains the resource and provides access to its identity in the context of its component descriptor.
Deprecated: use package selectors and its sub packages.
func NewResourceSelectionContext
deprecated
added in
v0.3.0
func NewResourceSelectionContext(index int, rscs Resources) ResourceSelectionContext
Deprecated: use package selectors and its sub packages.
type ResourceSelector
deprecated
added in
v0.3.0
type ResourceSelector interface {
MatchResource(obj ResourceSelectionContext) (bool, error)
}
ResourceSelector defines a selector based on resource attributes.
Deprecated: use package selectors and its sub packages.
func AndR
deprecated
added in
v0.3.0
func AndR(sel ...ResourceSelector) ResourceSelector
AndR is an AND resource selector.
Deprecated: use package labelsel.
func ByAccessMethod
deprecated
added in
v0.3.0
func ByAccessMethod(name string) ResourceSelector
ByAccessMethod creates a new selector that matches a resource access method type.
Deprecated: use package selectors and its sub packages.
func ByResourceType
deprecated
added in
v0.3.0
func ByResourceType(ttype string) ResourceSelector
ByResourceType creates a new resource selector that selects a resource based on its type.
Deprecated: use package selectors and its sub packages.
func ForExecutable
deprecated
added in
v0.3.0
func ForExecutable(name string) ResourceSelector
ForExecutable creates a new selector that matches a resource for an executable.
Deprecated: use package selectors and its sub packages.
func NotR
deprecated
added in
v0.3.0
func NotR(sel ResourceSelector) ResourceSelector
NotR is a negated resource selector.
Deprecated: use package labelsel.
func OrR
deprecated
added in
v0.3.0
func OrR(sel ...ResourceSelector) ResourceSelector
OrR is an OR resource selector.
Deprecated: use package labelsel.
type ResourceSelectorFunc
deprecated
type ResourceSelectorFunc func(obj ResourceSelectionContext) (bool, error)
ResourceSelectorFunc defines a function to filter a resource.
Deprecated: use package selectors and its sub packages.
func ByRelation
deprecated
added in
v0.3.0
func ByRelation(relation v1.ResourceRelation) ResourceSelectorFunc
ByRelation creates a new resource selector that selects a resource based on its relation type.
Deprecated: use package selectors and its sub packages.
func (ResourceSelectorFunc) MatchResource ¶ added in v0.3.0
func (s ResourceSelectorFunc) MatchResource(obj ResourceSelectionContext) (bool, error)
type Resources ¶
type Resources []Resource
Resources describes a set of resource specifications.
func (Resources) Equivalent ¶ added in v0.4.1
func (r Resources) Equivalent(o Resources) equivalent.EqualState
func (Resources) Get ¶
func (r Resources) Get(i int) ElementMetaAccessor
func (Resources) GetArtifact ¶
func (r Resources) GetArtifact(i int) ElementArtifactAccessor
func (Resources) HaveDigests ¶ added in v0.4.1
type SchemaVersion ¶
type SchemaVersion string
SchemaVersion enforces a dedicated schema version .
func (SchemaVersion) ApplyEncodeOption ¶
func (o SchemaVersion) ApplyEncodeOption(options *EncodeOptions)
ApplyEncodeOption applies the configured schema version.
type Scheme ¶
type Scheme interface { GetVersion() string Decode(data []byte, opts *DecodeOptions) (ComponentDescriptorVersion, error) ConvertFrom(desc *ComponentDescriptor) (ComponentDescriptorVersion, error) ConvertTo(ComponentDescriptorVersion) (*ComponentDescriptor, error) }
type SignatureSpec ¶ added in v0.4.1
type SignatureSpec = metav1.SignatureSpec
type Signatures ¶ added in v0.4.1
type Signatures = metav1.Signatures
type Source ¶
type Source struct { SourceMeta `json:",inline"` Access AccessSpec `json:"access"` }
Source is the definition of a component's source. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*Source) Equivalent ¶ added in v0.4.1
func (r *Source) Equivalent(e ElementMetaAccessor) equivalent.EqualState
func (*Source) GetAccess ¶
func (s *Source) GetAccess() AccessSpec
func (*Source) SetAccess ¶ added in v0.4.1
func (r *Source) SetAccess(a AccessSpec)
type SourceMeta ¶
type SourceMeta struct { ElementMeta // Type describes the type of the object. Type string `json:"type"` }
SourceMeta is the definition of the meta data of a source. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func NewSourceMeta ¶ added in v0.5.0
func NewSourceMeta(name, typ string) *SourceMeta
func (*SourceMeta) GetType ¶
func (o *SourceMeta) GetType() string
GetType returns the type of the object.
func (*SourceMeta) SetType ¶
func (o *SourceMeta) SetType(ttype string)
SetType sets the type of the object.
func (*SourceMeta) WithExtraIdentity ¶ added in v0.13.0
func (o *SourceMeta) WithExtraIdentity(extras ...string) *SourceMeta
func (*SourceMeta) WithLabel ¶ added in v0.13.0
func (o *SourceMeta) WithLabel(l *Label) *SourceMeta
func (*SourceMeta) WithVersion ¶ added in v0.13.0
func (o *SourceMeta) WithVersion(v string) *SourceMeta
type SourceRef ¶
type SourceRef struct { // IdentitySelector defines the identity that is used to match a source. IdentitySelector metav1.StringMap `json:"identitySelector,omitempty"` // Labels defines an optional set of additional labels // describing the object. // +optional Labels metav1.Labels `json:"labels,omitempty"` }
SourceRef defines a reference to a source +k8s:deepcopy-gen=true +k8s:openapi-gen=true
type SourceRefs ¶
type SourceRefs []SourceRef
type Sources ¶
type Sources []Source
Sources describes a set of source specifications.
func (Sources) Equivalent ¶ added in v0.4.1
func (r Sources) Equivalent(o Sources) equivalent.EqualState
func (Sources) Get ¶
func (s Sources) Get(i int) ElementMetaAccessor
func (Sources) GetArtifact ¶
func (s Sources) GetArtifact(i int) ElementArtifactAccessor
type StrictDecoder ¶
StrictDecoder defines a decoder for an object.
type StrictDecoderFunc ¶
StrictDecoderFunc is a simple function that implements the StrictDecoder interface.
func (StrictDecoderFunc) DecodeStrict ¶
func (e StrictDecoderFunc) DecodeStrict(data []byte, obj interface{}) error
StrictDecode is the Decode implementation of the Decoder interface.
type StrictMode ¶
type StrictMode bool
StrictMode enables or disables strict mode parsing.
func (StrictMode) ApplyDecodeOption ¶
func (s StrictMode) ApplyDecodeOption(options *DecodeOptions)
ApplyDecodeOption applies the configured strict mode.
type Timestamp ¶ added in v0.4.1
func NewTimestamp ¶ added in v0.4.1
func NewTimestamp() Timestamp
func NewTimestampFor ¶ added in v0.4.1
func NewTimestampP ¶ added in v0.4.1
func NewTimestampP() *Timestamp
func NewTimestampPFor ¶ added in v0.4.1
type VersionAccessor ¶
type VersionAccessor interface { // GetVersion returns the version of the object. GetVersion() string // SetVersion sets the version of the object. SetVersion(version string) }
VersionAccessor describes a accessor for a versioned object.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
meta
|
|
jsonv1
Package jsonv1 provides a normalization which uses schema specific normalizations.
|
Package jsonv1 provides a normalization which uses schema specific normalizations. |
jsonv2
Package jsonv2 provides a normalization which is completely based on the abstract (internal) version of the component descriptor and is therefore agnostic of the final serialization format.
|
Package jsonv2 provides a normalization which is completely based on the abstract (internal) version of the component descriptor and is therefore agnostic of the final serialization format. |
ocm.software/v3alpha1/jsonscheme
Package jsonscheme generated by go-bindata.// sources: ../../../../../../../../resources/component-descriptor-ocm-v3-schema.yaml
|
Package jsonscheme generated by go-bindata.// sources: ../../../../../../../../resources/component-descriptor-ocm-v3-schema.yaml |
v2/jsonscheme
Package jsonscheme generated by go-bindata.// sources: ../../../../../../../resources/component-descriptor-v2-schema.yaml
|
Package jsonscheme generated by go-bindata.// sources: ../../../../../../../resources/component-descriptor-v2-schema.yaml |