v3alpha1

package
v2.0.0-...-98cc131 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemIdentityName    = metav1.SystemIdentityName
	SystemIdentityVersion = metav1.SystemIdentityVersion
)
View Source
const (
	SchemaVersion = "v3alpha1"
	GroupVersion  = metav1.GROUP + "/" + SchemaVersion
	Kind          = metav1.KIND
)

Variables

View Source
var CDExcludes = signing.MapExcludes{
	"repositoryContexts": nil,
	"metadata": signing.MapExcludes{
		"labels": signing.LabelExcludes,
	},
	"spec": signing.MapExcludes{
		"resources": signing.ArrayExcludes{
			Continue: signing.MapExcludes{
				"access": nil,
				"srcRef": nil,
				"labels": signing.LabelExcludes,
			},
		},
		"sources": signing.ArrayExcludes{
			Continue: signing.MapExcludes{
				"access": nil,
				"labels": signing.LabelExcludes,
			},
		},
		"references": signing.ArrayExcludes{
			signing.MapExcludes{
				"labels": signing.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.

View Source
var ErrNotFound = errors.New("NotFound")

Functions

func ConvertSourcerefsTo

func ConvertSourcerefsTo(in []SourceRef) []compdesc.SourceRef

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 Validate

func Validate(fldPath *field.Path, component *ComponentDescriptor) field.ErrorList

func ValidateComponentReference

func ValidateComponentReference(fldPath *field.Path, cr Reference) field.ErrorList

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

func ValidateObjectMeta(fldPath *field.Path, om compdesc.ObjectMetaAccessor) field.ErrorList

ValidateObjectMeta Validate the metadata of an object.

func ValidateResource

func ValidateResource(fldPath *field.Path, res Resource, access bool) field.ErrorList

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

func ValidateSource(fldPath *field.Path, src Source, access bool) field.ErrorList

ValidateSource validates the a component's source object.

func ValidateSourceRefs

func ValidateSourceRefs(fldPath *field.Path, srcs []SourceRef) field.ErrorList

func ValidateSources

func ValidateSources(fldPath *field.Path, sources Sources) field.ErrorList

ValidateSources validates a list of sources. It makes sure that no duplicate sources are present.

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

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 (*DescriptorVersion) ConvertTo

func (*DescriptorVersion) Decode

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) 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

func (in *Reference) DeepCopy() *Reference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Reference.

func (*Reference) DeepCopyInto

func (in *Reference) DeepCopyInto(out *Reference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Reference) GetMeta

func (r *Reference) GetMeta() *ElementMeta

type References

type References []Reference

func (References) Get

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"`

	// SourceRef defines a list of source names.
	// These names reference the sources defines in `component.sources`.
	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

func (in *Resource) DeepCopy() *Resource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resource.

func (*Resource) DeepCopyInto

func (in *Resource) DeepCopyInto(out *Resource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Resource) GetMeta

func (r *Resource) GetMeta() *ElementMeta

func (Resource) GetType

func (r Resource) GetType() string

GetType returns the type of the object.

func (*Resource) SetType

func (r *Resource) SetType(ttype string)

SetType sets the type of the object.

type Resources

type Resources []Resource

Resources describes a set of resource specifications.

func (Resources) Get

func (Resources) Len

func (r Resources) Len() int

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

func (in *Source) DeepCopy() *Source

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Source.

func (*Source) DeepCopyInto

func (in *Source) DeepCopyInto(out *Source)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Source) GetMeta

func (s *Source) GetMeta() *ElementMeta

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

func (in *SourceRef) DeepCopy() *SourceRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceRef.

func (*SourceRef) DeepCopyInto

func (in *SourceRef) DeepCopyInto(out *SourceRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Sources

type Sources []Source

Sources describes a set of source specifications.

func (Sources) Get

func (r Sources) Get(i int) ElementMetaAccessor

func (Sources) Len

func (r Sources) Len() int

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

Jump to

Keyboard shortcuts

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