v1alpha1

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the cosmo v1alpha1 API group +kubebuilder:object:generate=true +groupName=cosmo.cosmo-workspace.github.io

Index

Constants

View Source
const (
	// LabelKeyTemplate is a template name label on the resources created by instance
	LabelKeyTemplate = "cosmo/template"
	// TemplateLabelKeyType is a additional type infomartion on template
	TemplateLabelKeyType = "cosmo/type"
	// TemplateAnnKeyDisableNamePrefix is a annotation on template to notify controller not to add name prefix
	TemplateAnnKeyDisableNamePrefix = "cosmo/disable-nameprefix"
	// TemplateAnnKeySkipValidation is a annotation on template to notify webhook not to validate
	TemplateAnnKeySkipValidation = "cosmo/skip-validation"
)
View Source
const (
	// LabelKeyInstance is a instance name label on the each child resources associated with the instance
	LabelKeyInstance = "cosmo/instance"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "cosmo.cosmo-workspace.github.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type ClusterInstance added in v0.5.0

type ClusterInstance struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   InstanceSpec   `json:"spec,omitempty"`
	Status InstanceStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:scope="Cluster",shortName=cinst +kubebuilder:subresource:status +kubebuilder:storageversion +kubebuilder:printcolumn:name="ClusterTemplate",type=string,JSONPath=`.status.templateName` +kubebuilder:printcolumn:name="Applied-Resources",type=string,JSONPath=`.status.lastApplied[*].kind` ClusterInstance is the Schema for the instances API

func (*ClusterInstance) DeepCopy added in v0.5.0

func (in *ClusterInstance) DeepCopy() *ClusterInstance

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

func (*ClusterInstance) DeepCopyInto added in v0.5.0

func (in *ClusterInstance) DeepCopyInto(out *ClusterInstance)

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

func (*ClusterInstance) DeepCopyObject added in v0.5.0

func (in *ClusterInstance) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ClusterInstance) GetScope added in v0.5.0

func (i *ClusterInstance) GetScope() meta.RESTScope

func (*ClusterInstance) GetSpec added in v0.5.0

func (i *ClusterInstance) GetSpec() *InstanceSpec

func (*ClusterInstance) GetStatus added in v0.5.0

func (i *ClusterInstance) GetStatus() *InstanceStatus

type ClusterInstanceList added in v0.5.0

type ClusterInstanceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterInstance `json:"items"`
}

+kubebuilder:object:root=true ClusterInstanceList contains a list of ClusterInstance

func (*ClusterInstanceList) DeepCopy added in v0.5.0

func (in *ClusterInstanceList) DeepCopy() *ClusterInstanceList

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

func (*ClusterInstanceList) DeepCopyInto added in v0.5.0

func (in *ClusterInstanceList) DeepCopyInto(out *ClusterInstanceList)

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

func (*ClusterInstanceList) DeepCopyObject added in v0.5.0

func (in *ClusterInstanceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ClusterInstanceList) InstanceObjects added in v0.7.0

func (l *ClusterInstanceList) InstanceObjects() []InstanceObject

type ClusterTemplate added in v0.5.0

type ClusterTemplate struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec TemplateSpec `json:"spec,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:scope="Cluster",shortName=ctmpl +kubebuilder:storageversion +kubebuilder:printcolumn:name="Required-Vars",type=string,JSONPath=`.spec.requiredVars` ClusterTemplate is the Schema for the Templates API

func (*ClusterTemplate) DeepCopy added in v0.5.0

func (in *ClusterTemplate) DeepCopy() *ClusterTemplate

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

func (*ClusterTemplate) DeepCopyInto added in v0.5.0

func (in *ClusterTemplate) DeepCopyInto(out *ClusterTemplate)

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

func (*ClusterTemplate) DeepCopyObject added in v0.5.0

func (in *ClusterTemplate) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ClusterTemplate) GetScope added in v0.6.0

func (t *ClusterTemplate) GetScope() meta.RESTScope

func (*ClusterTemplate) GetSpec added in v0.5.0

func (t *ClusterTemplate) GetSpec() *TemplateSpec

type ClusterTemplateList added in v0.5.0

type ClusterTemplateList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterTemplate `json:"items"`
}

+kubebuilder:object:root=true ClusterTemplateList contains a list of ClusterTemplate

func (*ClusterTemplateList) DeepCopy added in v0.5.0

func (in *ClusterTemplateList) DeepCopy() *ClusterTemplateList

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

func (*ClusterTemplateList) DeepCopyInto added in v0.5.0

func (in *ClusterTemplateList) DeepCopyInto(out *ClusterTemplateList)

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

func (*ClusterTemplateList) DeepCopyObject added in v0.5.0

func (in *ClusterTemplateList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type IngressOverrideSpec

type IngressOverrideSpec struct {
	TargetName  string              `json:"targetName,omitempty"`
	Annotations map[string]string   `json:"annotations,omitempty"`
	Rules       []netv1.IngressRule `json:"rules,omitempty"`
}

IngressOverrideSpec defines overrides to transform Ingress resources

func (*IngressOverrideSpec) DeepCopy

func (in *IngressOverrideSpec) DeepCopy() *IngressOverrideSpec

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

func (*IngressOverrideSpec) DeepCopyInto

func (in *IngressOverrideSpec) DeepCopyInto(out *IngressOverrideSpec)

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

type Instance

type Instance struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   InstanceSpec   `json:"spec,omitempty"`
	Status InstanceStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:shortName=inst +kubebuilder:subresource:status +kubebuilder:storageversion +kubebuilder:printcolumn:name="Template",type=string,JSONPath=`.status.templateName` +kubebuilder:printcolumn:name="Applied-Resources",type=string,JSONPath=`.status.lastApplied[*].kind` Instance is the Schema for the instances API

func (*Instance) DeepCopy

func (in *Instance) DeepCopy() *Instance

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

func (*Instance) DeepCopyInto

func (in *Instance) DeepCopyInto(out *Instance)

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

func (*Instance) DeepCopyObject

func (in *Instance) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Instance) GetScope added in v0.5.0

func (i *Instance) GetScope() meta.RESTScope

func (*Instance) GetSpec added in v0.5.0

func (i *Instance) GetSpec() *InstanceSpec

func (*Instance) GetStatus added in v0.5.0

func (i *Instance) GetStatus() *InstanceStatus

type InstanceList

type InstanceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Instance `json:"items"`
}

+kubebuilder:object:root=true InstanceList contains a list of Instance

func (*InstanceList) DeepCopy

func (in *InstanceList) DeepCopy() *InstanceList

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

func (*InstanceList) DeepCopyInto

func (in *InstanceList) DeepCopyInto(out *InstanceList)

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

func (*InstanceList) DeepCopyObject

func (in *InstanceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*InstanceList) InstanceObjects added in v0.7.0

func (l *InstanceList) InstanceObjects() []InstanceObject

type InstanceObject added in v0.5.0

type InstanceObject interface {
	metav1.Object
	runtime.Object
	GetSpec() *InstanceSpec
	GetStatus() *InstanceStatus
	GetScope() meta.RESTScope
}

+kubebuilder:object:generate=false

type InstanceSpec

type InstanceSpec struct {
	// +kubebuilder:validation:Required
	Template TemplateRef       `json:"template"`
	Vars     map[string]string `json:"vars,omitempty"`
	Override OverrideSpec      `json:"override,omitempty"`
}

InstanceSpec defines the desired state of Instance

func (*InstanceSpec) DeepCopy

func (in *InstanceSpec) DeepCopy() *InstanceSpec

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

func (*InstanceSpec) DeepCopyInto

func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec)

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

type InstanceStatus

type InstanceStatus struct {
	TemplateName            string      `json:"templateName,omitempty"`
	TemplateResourceVersion string      `json:"templateResourceVersion,omitempty"`
	LastApplied             []ObjectRef `json:"lastApplied,omitempty"`
	LastAppliedObjectsCount int         `json:"lastAppliedObjectsCount,omitempty"`
	TemplateObjectsCount    int         `json:"templateObjectsCount,omitempty"`
}

InstanceStatus has status of Instance

func (*InstanceStatus) DeepCopy

func (in *InstanceStatus) DeepCopy() *InstanceStatus

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

func (*InstanceStatus) DeepCopyInto

func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus)

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

type Json6902

type Json6902 struct {
	Target ObjectRef `json:"target"`
	Patch  string    `json:"patch,omitempty"`
}

Json6902 defines JSONPatch specs.

func (*Json6902) DeepCopy

func (in *Json6902) DeepCopy() *Json6902

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

func (*Json6902) DeepCopyInto

func (in *Json6902) DeepCopyInto(out *Json6902)

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

type NetworkOverrideSpec

type NetworkOverrideSpec struct {
	Ingress []IngressOverrideSpec `json:"ingress,omitempty"`
	Service []ServiceOverrideSpec `json:"service,omitempty"`
}

NetworkOverrideSpec defines overrides to transform network resources

func (*NetworkOverrideSpec) DeepCopy

func (in *NetworkOverrideSpec) DeepCopy() *NetworkOverrideSpec

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

func (*NetworkOverrideSpec) DeepCopyInto

func (in *NetworkOverrideSpec) DeepCopyInto(out *NetworkOverrideSpec)

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

type ObjectRef

type ObjectRef struct {
	corev1.ObjectReference `json:",inline"`
	CreationTimestamp      *metav1.Time `json:"creationTimestamp,omitempty"`
	UpdateTimestamp        *metav1.Time `json:"updateTimestamp,omitempty"`
}

ObjectRef is a reference of resource which is created by the Instance

func (*ObjectRef) DeepCopy

func (in *ObjectRef) DeepCopy() *ObjectRef

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

func (*ObjectRef) DeepCopyInto

func (in *ObjectRef) DeepCopyInto(out *ObjectRef)

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

func (ObjectRef) GetName

func (r ObjectRef) GetName() string

func (ObjectRef) GroupVersionKind

func (r ObjectRef) GroupVersionKind() schema.GroupVersionKind

func (*ObjectRef) SetGroupVersionKind

func (r *ObjectRef) SetGroupVersionKind(gvk schema.GroupVersionKind)

func (*ObjectRef) SetName

func (r *ObjectRef) SetName(name string)

type OverrideSpec

type OverrideSpec struct {
	Scale           []ScalingOverrideSpec `json:"scale,omitempty"`
	Network         *NetworkOverrideSpec  `json:"network,omitempty"`
	PatchesJson6902 []Json6902            `json:"patchesJson6902,omitempty"`
}

OverrideSpec defines overrides to transform built objects

func (*OverrideSpec) DeepCopy

func (in *OverrideSpec) DeepCopy() *OverrideSpec

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

func (*OverrideSpec) DeepCopyInto

func (in *OverrideSpec) DeepCopyInto(out *OverrideSpec)

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

type RequiredVarSpec

type RequiredVarSpec struct {
	Var     string `json:"var"`
	Default string `json:"default,omitempty"`
}

RequiredVarSpec defines a required var spec for template

func (*RequiredVarSpec) DeepCopy

func (in *RequiredVarSpec) DeepCopy() *RequiredVarSpec

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

func (*RequiredVarSpec) DeepCopyInto

func (in *RequiredVarSpec) DeepCopyInto(out *RequiredVarSpec)

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

type ScalingOverrideSpec

type ScalingOverrideSpec struct {
	Target   ObjectRef `json:"target"`
	Replicas int64     `json:"replicas"`
}

ScalingOverrideSpec defines workload scales.

func (*ScalingOverrideSpec) DeepCopy

func (in *ScalingOverrideSpec) DeepCopy() *ScalingOverrideSpec

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

func (*ScalingOverrideSpec) DeepCopyInto

func (in *ScalingOverrideSpec) DeepCopyInto(out *ScalingOverrideSpec)

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

type ServiceOverrideSpec

type ServiceOverrideSpec struct {
	TargetName string               `json:"targetName,omitempty"`
	Ports      []corev1.ServicePort `json:"ports,omitempty"`
}

ServiceOverrideSpec defines overrides to transform Service resources

func (*ServiceOverrideSpec) DeepCopy

func (in *ServiceOverrideSpec) DeepCopy() *ServiceOverrideSpec

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

func (*ServiceOverrideSpec) DeepCopyInto

func (in *ServiceOverrideSpec) DeepCopyInto(out *ServiceOverrideSpec)

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

type Template

type Template struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec TemplateSpec `json:"spec,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:scope="Cluster",shortName=tmpl +kubebuilder:storageversion +kubebuilder:printcolumn:name="Required-Vars",type=string,JSONPath=`.spec.requiredVars` Template is the Schema for the Templates API

func (*Template) DeepCopy

func (in *Template) DeepCopy() *Template

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

func (*Template) DeepCopyInto

func (in *Template) DeepCopyInto(out *Template)

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

func (*Template) DeepCopyObject

func (in *Template) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Template) GetScope added in v0.6.0

func (t *Template) GetScope() meta.RESTScope

func (*Template) GetSpec added in v0.5.0

func (t *Template) GetSpec() *TemplateSpec

type TemplateList

type TemplateList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Template `json:"items"`
}

+kubebuilder:object:root=true TemplateList contains a list of Template

func (*TemplateList) DeepCopy

func (in *TemplateList) DeepCopy() *TemplateList

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

func (*TemplateList) DeepCopyInto

func (in *TemplateList) DeepCopyInto(out *TemplateList)

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

func (*TemplateList) DeepCopyObject

func (in *TemplateList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TemplateObject added in v0.5.0

type TemplateObject interface {
	metav1.Object
	runtime.Object
	SetGroupVersionKind(gvk schema.GroupVersionKind)
	GetSpec() *TemplateSpec
	GetScope() meta.RESTScope
}

+kubebuilder:object:generate=false

type TemplateRef

type TemplateRef struct {
	// +kubebuilder:validation:Required
	Name string `json:"name"`
}

TemplateRef defines template to use in Instance creation

func (*TemplateRef) DeepCopy

func (in *TemplateRef) DeepCopy() *TemplateRef

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

func (*TemplateRef) DeepCopyInto

func (in *TemplateRef) DeepCopyInto(out *TemplateRef)

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

type TemplateSpec

type TemplateSpec struct {
	Description  string            `json:"description,omitempty"`
	RequiredVars []RequiredVarSpec `json:"requiredVars,omitempty"`
	RawYaml      string            `json:"rawYaml,omitempty"`
}

TemplateSpec defines the desired state of Template

func (*TemplateSpec) DeepCopy

func (in *TemplateSpec) DeepCopy() *TemplateSpec

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

func (*TemplateSpec) DeepCopyInto

func (in *TemplateSpec) DeepCopyInto(out *TemplateSpec)

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

Jump to

Keyboard shortcuts

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