Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertSourcerefsTo(in []SourceRef) []compdesc.SourceRef
- func DefaultResources(component *ComponentDescriptor)
- func Validate(fldPath *field.Path, component *ComponentDescriptor) field.ErrorList
- func ValidateComponentReference(fldPath *field.Path, cr ComponentReference) field.ErrorList
- func ValidateComponentReferences(fldPath *field.Path, refs ComponentReferences) field.ErrorList
- func ValidateObjectMeta(fldPath *field.Path, om compdesc.ObjectMetaAccessor) field.ErrorList
- func ValidateResource(fldPath *field.Path, res Resource, access bool) field.ErrorList
- func ValidateResources(fldPath *field.Path, resources Resources, componentVersion string) field.ErrorList
- func ValidateSource(fldPath *field.Path, src Source, access bool) field.ErrorList
- func ValidateSourceRefs(fldPath *field.Path, srcs []SourceRef) field.ErrorList
- func ValidateSources(fldPath *field.Path, sources Sources) field.ErrorList
- type ComponentDescriptor
- func (in *ComponentDescriptor) DeepCopy() *ComponentDescriptor
- func (in *ComponentDescriptor) DeepCopyInto(out *ComponentDescriptor)
- func (cd *ComponentDescriptor) Default() error
- func (cd *ComponentDescriptor) Normalize(normAlgo string) ([]byte, error)
- func (cd *ComponentDescriptor) SchemaVersion() string
- func (cd *ComponentDescriptor) Validate() error
- type ComponentReference
- type ComponentReferences
- type ComponentSpec
- type DescriptorVersion
- func (v *DescriptorVersion) ConvertFrom(in *compdesc.ComponentDescriptor) (compdesc.ComponentDescriptorVersion, error)
- func (v *DescriptorVersion) ConvertTo(obj compdesc.ComponentDescriptorVersion) (out *compdesc.ComponentDescriptor, err error)
- func (v *DescriptorVersion) Decode(data []byte, opts *compdesc.DecodeOptions) (compdesc.ComponentDescriptorVersion, error)
- func (v *DescriptorVersion) GetVersion() string
- type ElementAccessor
- type ElementMeta
- func (in *ElementMeta) DeepCopy() *ElementMeta
- func (in *ElementMeta) DeepCopyInto(out *ElementMeta)
- func (o *ElementMeta) GetIdentity(accessor ElementAccessor) metav1.Identity
- func (o *ElementMeta) GetIdentityDigest(accessor ElementAccessor) []byte
- func (o ElementMeta) GetLabels() metav1.Labels
- func (o *ElementMeta) GetMeta() *ElementMeta
- func (o *ElementMeta) GetName() string
- func (o *ElementMeta) GetRawIdentity() metav1.Identity
- func (o ElementMeta) GetVersion() string
- func (o *ElementMeta) SetExtraIdentity(identity metav1.Identity)
- func (o *ElementMeta) SetLabels(labels []metav1.Label)
- func (o *ElementMeta) SetName(name string)
- func (o *ElementMeta) SetVersion(version string)
- type ElementMetaAccessor
- type ObjectMeta
- func (in *ObjectMeta) DeepCopy() *ObjectMeta
- func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta)
- func (o ObjectMeta) GetLabels() metav1.Labels
- func (o ObjectMeta) GetName() string
- func (o ObjectMeta) GetVersion() string
- func (o *ObjectMeta) SetLabels(labels []metav1.Label)
- func (o *ObjectMeta) SetName(name string)
- func (o *ObjectMeta) SetVersion(version string)
- type Resource
- type Resources
- type Source
- type SourceMeta
- type SourceRef
- type Sources
Constants ¶
const ( SystemIdentityName = metav1.SystemIdentityName SystemIdentityVersion = metav1.SystemIdentityVersion )
const SchemaVersion = "v2"
Variables ¶
var CDExcludes = signing.MapExcludes{ "component": signing.MapExcludes{ "provider": signing.MapValue{ Mapping: providerMapper, Continue: signing.MapExcludes{ "labels": rules.LabelExcludes, }, }, "labels": rules.LabelExcludes, "repositoryContexts": nil, "resources": signing.DefaultedMapFields{ Next: signing.DynamicArrayExcludes{ ValueMapper: rules.MapResourcesWithNoneAccess, Continue: signing.MapExcludes{ "access": nil, "srcRefs": nil, "labels": rules.LabelExcludes, }, }, }.EnforceNull("extraIdentity"), "sources": nil, "componentReferences": signing.DefaultedMapFields{ Next: signing.ArrayExcludes{ signing.MapExcludes{ "labels": rules.LabelExcludes, }, }, }.EnforceNull("extraIdentity"), }, "signatures": nil, "nestedDigests": nil, }
CDExcludes describes the fields relevant for Signing ATTENTION: if changed, please adapt the HashEqual Functions in the generic part, accordingly.
var ErrNotFound = errors.New("NotFound")
Functions ¶
func ConvertSourcerefsTo ¶
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 ValidateComponentReference ¶
func ValidateComponentReference(fldPath *field.Path, cr ComponentReference) field.ErrorList
ValidateComponentReference validates a component reference.
func ValidateComponentReferences ¶
func ValidateComponentReferences(fldPath *field.Path, refs ComponentReferences) field.ErrorList
ValidateComponentReferences validates a list of component references. It makes sure that no duplicate sources are present.
func ValidateObjectMeta ¶
ValidateObjectMeta Validate the metadata of an object.
func ValidateResource ¶
ValidateResource validates a components resource.
func ValidateResources ¶
func ValidateResources(fldPath *field.Path, resources Resources, componentVersion string) field.ErrorList
ValidateResources validates a list of resources. It makes sure that no duplicate sources are present.
func ValidateSource ¶
ValidateSource validates the a component's source object.
func ValidateSourceRefs ¶
Types ¶
type ComponentDescriptor ¶
type ComponentDescriptor struct { // Metadata specifies the schema version of the component. Metadata metav1.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"` // NestedDigests described digest information of resources in aggregated // omponent versions. 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 (*ComponentDescriptor) DeepCopy ¶
func (in *ComponentDescriptor) DeepCopy() *ComponentDescriptor
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentDescriptor.
func (*ComponentDescriptor) DeepCopyInto ¶
func (in *ComponentDescriptor) DeepCopyInto(out *ComponentDescriptor)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ComponentDescriptor) Default ¶
func (cd *ComponentDescriptor) Default() error
Default applies defaults to a component.
func (*ComponentDescriptor) Normalize ¶
func (cd *ComponentDescriptor) Normalize(normAlgo string) ([]byte, error)
func (*ComponentDescriptor) SchemaVersion ¶
func (cd *ComponentDescriptor) SchemaVersion() string
SchemeVersion returns the actual scheme version of this component descriptor representation.
func (*ComponentDescriptor) Validate ¶
func (cd *ComponentDescriptor) Validate() error
Validate validates a parsed v2 component descriptor.
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 (*ComponentReference) DeepCopy ¶
func (in *ComponentReference) DeepCopy() *ComponentReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentReference.
func (*ComponentReference) DeepCopyInto ¶
func (in *ComponentReference) DeepCopyInto(out *ComponentReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ComponentReferences ¶
type ComponentReferences []ComponentReference
func (ComponentReferences) Get ¶
func (r ComponentReferences) Get(i int) ElementMetaAccessor
func (ComponentReferences) Len ¶
func (r ComponentReferences) Len() int
type ComponentSpec ¶
type ComponentSpec struct { ObjectMeta `json:",inline"` // RepositoryContexts defines the previous repositories of the component RepositoryContexts runtime.UnstructuredTypedObjectList `json:"repositoryContexts"` // Provider defines the provider type of a component. // It can be external or internal. Provider metav1.ProviderName `json:"provider"` // Sources defines sources that produced the component Sources Sources `json:"sources"` // ComponentReferences references component dependencies that can be resolved in the current context. ComponentReferences ComponentReferences `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
func (*ComponentSpec) DeepCopy ¶
func (in *ComponentSpec) DeepCopy() *ComponentSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentSpec.
func (*ComponentSpec) DeepCopyInto ¶
func (in *ComponentSpec) DeepCopyInto(out *ComponentSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DescriptorVersion ¶
type DescriptorVersion struct{}
func (*DescriptorVersion) ConvertFrom ¶
func (v *DescriptorVersion) ConvertFrom(in *compdesc.ComponentDescriptor) (compdesc.ComponentDescriptorVersion, error)
func (*DescriptorVersion) ConvertTo ¶
func (v *DescriptorVersion) ConvertTo(obj compdesc.ComponentDescriptorVersion) (out *compdesc.ComponentDescriptor, err error)
func (*DescriptorVersion) Decode ¶
func (v *DescriptorVersion) Decode(data []byte, opts *compdesc.DecodeOptions) (compdesc.ComponentDescriptorVersion, error)
func (*DescriptorVersion) GetVersion ¶
func (v *DescriptorVersion) GetVersion() string
type ElementAccessor ¶
type ElementAccessor interface { Len() int Get(i int) ElementMetaAccessor }
ElementAccessor provides generic access to list of elements.
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) DeepCopy ¶
func (in *ElementMeta) DeepCopy() *ElementMeta
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ElementMeta.
func (*ElementMeta) DeepCopyInto ¶
func (in *ElementMeta) DeepCopyInto(out *ElementMeta)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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) GetLabels ¶
func (o ElementMeta) GetLabels() metav1.Labels
GetLabels returns the label of the object.
func (*ElementMeta) GetMeta ¶ added in v0.13.0
func (o *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
func (ElementMeta) GetVersion ¶
func (o ElementMeta) GetVersion() string
GetVersion returns the version of the object.
func (*ElementMeta) SetExtraIdentity ¶
func (o *ElementMeta) SetExtraIdentity(identity metav1.Identity)
SetExtraIdentity sets the identity of the object.
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 ElementMetaAccessor ¶
type ElementMetaAccessor interface {
GetMeta() *ElementMeta
}
ElementMetaAccessor provides generic access an elements meta information.
type ObjectMeta ¶
type ObjectMeta 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"` // Labels defines an optional set of additional labels // describing the object. // +optional Labels metav1.Labels `json:"labels,omitempty"` // CreationTime is the creation time of the component version // +optional CreationTime *metav1.Timestamp `json:"creationTime,omitempty"` }
ObjectMeta defines a object that is uniquely identified by its name and version. +k8s:deepcopy-gen=true
func (*ObjectMeta) DeepCopy ¶
func (in *ObjectMeta) DeepCopy() *ObjectMeta
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta.
func (*ObjectMeta) DeepCopyInto ¶
func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (ObjectMeta) GetLabels ¶
func (o ObjectMeta) GetLabels() metav1.Labels
GetLabels returns the label of the object.
func (ObjectMeta) GetName ¶
func (o ObjectMeta) GetName() string
GetName returns the name of the object.
func (ObjectMeta) GetVersion ¶
func (o ObjectMeta) GetVersion() string
GetVersion returns the version of the object.
func (*ObjectMeta) SetLabels ¶
func (o *ObjectMeta) SetLabels(labels []metav1.Label)
SetLabels sets the labels of the object.
func (*ObjectMeta) SetName ¶
func (o *ObjectMeta) SetName(name string)
SetName sets the name of the object.
func (*ObjectMeta) SetVersion ¶
func (o *ObjectMeta) SetVersion(version string)
SetVersion sets the version of the object.
type Resource ¶
type Resource 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 []SourceRef `json:"srcRefs,omitempty"` // SourceRef is for deserialization compatibility, only. // The usage of this field in external formats is deprecated. SourceRef []SourceRef `json:"srcRef,omitempty"` // Access describes the type specific method to // access the defined resource. Access *runtime.UnstructuredTypedObject `json:"access"` // Digest is the optional digest of the referenced resource. // +optional Digest *metav1.DigestSpec `json:"digest,omitempty"` }
Resource describes a resource dependency of a component. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*Resource) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resource.
func (*Resource) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Resources ¶
type Resources []Resource
Resources describes a set of resource specifications.
func (Resources) Get ¶
func (r Resources) Get(i int) ElementMetaAccessor
type Source ¶
type Source struct { SourceMeta `json:",inline"` Access *runtime.UnstructuredTypedObject `json:"access"` }
Source is the definition of a component's source. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*Source) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Source.
func (*Source) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SourceMeta ¶
type SourceMeta struct { ElementMeta `json:",inline"` // 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 (*SourceMeta) DeepCopy ¶
func (in *SourceMeta) DeepCopy() *SourceMeta
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceMeta.
func (*SourceMeta) DeepCopyInto ¶
func (in *SourceMeta) DeepCopyInto(out *SourceMeta)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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.
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
func (*SourceRef) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceRef.
func (*SourceRef) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
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 |