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 Reference) field.ErrorList
- func ValidateComponentReferences(fldPath *field.Path, refs References) 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
- type ComponentVersionSpec
- 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) 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 Reference
- type References
- type Resource
- type Resources
- type Source
- type SourceMeta
- type SourceRef
- type Sources
Constants ¶
const ( SystemIdentityName = metav1.SystemIdentityName SystemIdentityVersion = metav1.SystemIdentityVersion )
const ( SchemaVersion = GroupVersion VersionName = "v3alpha1" GroupVersion = metav1.GROUP + "/" + VersionName Kind = metav1.KIND )
Variables ¶
var CDExcludes = signing.MapExcludes{ "repositoryContexts": nil, "metadata": signing.MapExcludes{ "labels": rules.LabelExcludes, }, "spec": signing.MapExcludes{ "provider": signing.MapExcludes{ "labels": rules.LabelExcludes, }, "resources": signing.DynamicArrayExcludes{ ValueMapper: rules.MapResourcesWithNoneAccess, Continue: signing.MapExcludes{ "access": nil, "srcRefs": nil, "labels": rules.LabelExcludes, }, }, "sources": signing.ArrayExcludes{ Continue: signing.MapExcludes{ "access": nil, "labels": rules.LabelExcludes, }, }, "references": signing.ArrayExcludes{ signing.MapExcludes{ "labels": rules.LabelExcludes, }, }, }, "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 ¶
ValidateComponentReference validates a component version reference.
func ValidateComponentReferences ¶
func ValidateComponentReferences(fldPath *field.Path, refs References) field.ErrorList
ValidateComponentReferences validates a list of component version 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 { // TypeMeta specifies the schema version of the component. metav1.TypeMeta `json:",inline"` // Spec contains the specification of the component. metav1.ObjectMeta `json:"metadata"` // RepositoryContexts defines the previous repositories of the component RepositoryContexts runtime.UnstructuredTypedObjectList `json:"repositoryContexts"` Spec ComponentVersionSpec `json:"spec"` // 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.
func (*ComponentDescriptor) Default ¶
func (cd *ComponentDescriptor) Default() error
Default applies defaults to a component.
func (*ComponentDescriptor) GetName ¶
func (cd *ComponentDescriptor) GetName() string
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 ComponentVersionSpec ¶
type ComponentVersionSpec struct { // Sources defines sources that produced the component Sources Sources `json:"sources,omitempty"` // References references component version dependencies that can be resolved in the current context. References References `json:"references,omitempty"` // Resources defines all resources that are created by the component and by a third party. Resources Resources `json:"resources,omitempty"` }
ComponentVersionSpec defines a virtual component with a repository context, source and dependencies. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*ComponentVersionSpec) DeepCopy ¶
func (in *ComponentVersionSpec) DeepCopy() *ComponentVersionSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentVersionSpec.
func (*ComponentVersionSpec) DeepCopyInto ¶
func (in *ComponentVersionSpec) DeepCopyInto(out *ComponentVersionSpec)
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) 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 Reference ¶
type Reference 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"` }
Reference describes the reference to another component in the registry. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*Reference) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Reference.
func (*Reference) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type References ¶
type References []Reference
func (References) Get ¶
func (r References) Get(i int) ElementMetaAccessor
func (References) Len ¶
func (r References) Len() int
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 metadata 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-ocm-v3-schema.yaml
|
Package jsonscheme generated by go-bindata.// sources: ../../../../../../../../resources/component-descriptor-ocm-v3-schema.yaml |