v1

package
v0.0.0-...-8a20bae Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the hackathon v1 API group +kubebuilder:object:generate=true +groupName=hackathon.kaiyuanshe.cn

Index

Constants

View Source
const (
	ClusterInit         ClusterConditionType = "Init"
	ClusterFirstConnect ClusterConditionType = "FirstConnect"
	ClusterHeartbeat    ClusterConditionType = "Heartbeat"
	ClusterResourceSync ClusterConditionType = "ResourceSync"
	ClusterCommandApply ClusterConditionType = "CommandApply"

	ClusterStatusTrue    ClusterConditionStatus = "True"
	ClusterStatusFalse   ClusterConditionStatus = "False"
	ClusterStatusUnknown ClusterConditionStatus = "Unknown"
)
View Source
const (
	ExperimentIngressSSH = "ssh"
	ExperimentIngressVNC = "vnc"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "hackathon.kaiyuanshe.cn", Version: "v1"}

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

func CheckClusterCondition

func CheckClusterCondition(conditions []ClusterCondition, conditionType ClusterConditionType, status ClusterConditionStatus) bool

func CheckExperimentCondition

func CheckExperimentCondition(conditions []ExperimentCondition, conditionType ExperimentConditionType, status ExperimentConditionStatus) bool

Types

type ClusterCondition

type ClusterCondition struct {
	Type               ClusterConditionType   `json:"type"`
	Status             ClusterConditionStatus `json:"status"`
	Reason             string                 `json:"reason,omitempty"`
	Message            string                 `json:"message,omitempty"`
	LastProbeTime      metav1.Time            `json:"lastProbeTime"`
	LastTransitionTime metav1.Time            `json:"lastTransitionTime"`
}

func NewClusterCondition

func NewClusterCondition(conditionType ClusterConditionType, status ClusterConditionStatus, reason, message string) ClusterCondition

func QueryClusterCondition

func QueryClusterCondition(conditions []ClusterCondition, conditionType ClusterConditionType) *ClusterCondition

func UpdateClusterConditions

func UpdateClusterConditions(conditions []ClusterCondition, condition ClusterCondition) []ClusterCondition

func (*ClusterCondition) DeepCopy

func (in *ClusterCondition) DeepCopy() *ClusterCondition

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

func (*ClusterCondition) DeepCopyInto

func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition)

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

type ClusterConditionStatus

type ClusterConditionStatus string

type ClusterConditionType

type ClusterConditionType string

type ClusterStatus

type ClusterStatus string
const (
	ClusterCreated      ClusterStatus = "Created"
	ClusterReady        ClusterStatus = "Ready"
	ClusterOutOfControl ClusterStatus = "OutOfControl"
	ClusterLost         ClusterStatus = "Lost"
	ClusterUnknown      ClusterStatus = "Unknown"
)

type CustomCluster

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

	Spec   CustomClusterSpec   `json:"spec,omitempty"`
	Status CustomClusterStatus `json:"status,omitempty"`
}

CustomCluster is the Schema for the customclusters API +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.status` +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:subresource:status

func (*CustomCluster) CheckForWarning

func (c *CustomCluster) CheckForWarning() error

func (*CustomCluster) DeepCopy

func (in *CustomCluster) DeepCopy() *CustomCluster

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

func (*CustomCluster) DeepCopyInto

func (in *CustomCluster) DeepCopyInto(out *CustomCluster)

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

func (*CustomCluster) DeepCopyObject

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

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

type CustomClusterList

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

CustomClusterList contains a list of CustomCluster

func (*CustomClusterList) DeepCopy

func (in *CustomClusterList) DeepCopy() *CustomClusterList

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

func (*CustomClusterList) DeepCopyInto

func (in *CustomClusterList) DeepCopyInto(out *CustomClusterList)

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

func (*CustomClusterList) DeepCopyObject

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

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

type CustomClusterSpec

type CustomClusterSpec struct {
	ClusterTimeoutSeconds int      `json:"clusterTimeoutSeconds"`
	PublishIps            []string `json:"publishIPs,omitempty"`
	PrivateIps            []string `json:"privateIPs,omitempty"`
	EnablePrivateIP       bool     `json:"enablePrivateIP"`
}

CustomClusterSpec defines the desired state of CustomCluster

func (*CustomClusterSpec) DeepCopy

func (in *CustomClusterSpec) DeepCopy() *CustomClusterSpec

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

func (*CustomClusterSpec) DeepCopyInto

func (in *CustomClusterSpec) DeepCopyInto(out *CustomClusterSpec)

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

type CustomClusterStatus

type CustomClusterStatus struct {
	Status     ClusterStatus      `json:"status"`
	Conditions []ClusterCondition `json:"conditions,omitempty"`
	ClusterID  string             `json:"clusterId"`
}

CustomClusterStatus defines the observed state of CustomCluster

func (*CustomClusterStatus) DeepCopy

func (in *CustomClusterStatus) DeepCopy() *CustomClusterStatus

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

func (*CustomClusterStatus) DeepCopyInto

func (in *CustomClusterStatus) DeepCopyInto(out *CustomClusterStatus)

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

type Experiment

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

	Spec   ExperimentSpec   `json:"spec,omitempty"`
	Status ExperimentStatus `json:"status,omitempty"`
}

Experiment is the Schema for the experiments API +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.status` +kubebuilder:printcolumn:name="Cluster",type=string,JSONPath=`.status.cluster` +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:subresource:status

func (*Experiment) DeepCopy

func (in *Experiment) DeepCopy() *Experiment

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

func (*Experiment) DeepCopyInto

func (in *Experiment) DeepCopyInto(out *Experiment)

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

func (*Experiment) DeepCopyObject

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

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

type ExperimentCondition

type ExperimentCondition struct {
	Type               ExperimentConditionType   `json:"type"`
	Status             ExperimentConditionStatus `json:"status"`
	Reason             string                    `json:"reason"`
	Message            string                    `json:"message"`
	LastProbeTime      metav1.Time               `json:"lastProbeTime"`
	LastTransitionTime metav1.Time               `json:"lastTransitionTime"`
}

func NewExperimentCondition

func NewExperimentCondition(conditionType ExperimentConditionType, status ExperimentConditionStatus, reason, message string) ExperimentCondition

func QueryExperimentCondition

func QueryExperimentCondition(conditions []ExperimentCondition, conditionType ExperimentConditionType) *ExperimentCondition

func UpdateExperimentConditions

func UpdateExperimentConditions(conditions []ExperimentCondition, condition ExperimentCondition) []ExperimentCondition

func (*ExperimentCondition) DeepCopy

func (in *ExperimentCondition) DeepCopy() *ExperimentCondition

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

func (*ExperimentCondition) DeepCopyInto

func (in *ExperimentCondition) DeepCopyInto(out *ExperimentCondition)

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

type ExperimentConditionStatus

type ExperimentConditionStatus string
const (
	ExperimentConditionTrue    ExperimentConditionStatus = "True"
	ExperimentConditionFalse   ExperimentConditionStatus = "False"
	ExperimentConditionUnknown ExperimentConditionStatus = "Unknown"
)

type ExperimentConditionType

type ExperimentConditionType string
const (
	ExperimentInitialized   ExperimentConditionType = "Initialized"
	ExperimentPodReady      ExperimentConditionType = "PodReady"
	ExperimentVolumeCreated ExperimentConditionType = "VolumeCreated"
	ExperimentReady         ExperimentConditionType = "Ready"
)

type ExperimentEnvStatus

type ExperimentEnvStatus string
const (
	ExperimentCreated ExperimentEnvStatus = "Created"
	ExperimentRunning ExperimentEnvStatus = "Running"
	ExperimentStopped ExperimentEnvStatus = "Stopped"
	ExperimentError   ExperimentEnvStatus = "Error"
)

type ExperimentIngressProtocol

type ExperimentIngressProtocol string

type ExperimentList

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

ExperimentList contains a list of Experiment

func (*ExperimentList) DeepCopy

func (in *ExperimentList) DeepCopy() *ExperimentList

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

func (*ExperimentList) DeepCopyInto

func (in *ExperimentList) DeepCopyInto(out *ExperimentList)

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

func (*ExperimentList) DeepCopyObject

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

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

type ExperimentSpec

type ExperimentSpec struct {
	Pause       bool   `json:"pause"`
	Template    string `json:"template"`
	ClusterName string `json:"clusterName"`
}

ExperimentSpec defines the desired state of Experiment

func (*ExperimentSpec) DeepCopy

func (in *ExperimentSpec) DeepCopy() *ExperimentSpec

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

func (*ExperimentSpec) DeepCopyInto

func (in *ExperimentSpec) DeepCopyInto(out *ExperimentSpec)

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

type ExperimentStatus

type ExperimentStatus struct {
	Status      ExperimentEnvStatus       `json:"status,omitempty"`
	IngressIPs  []string                  `json:"ingressIPs,omitempty"`
	IngressPort int32                     `json:"ingressPort,omitempty"`
	Protocol    ExperimentIngressProtocol `json:"protocol,omitempty"`
	Cluster     string                    `json:"cluster,omitempty"`
	ClusterSync bool                      `json:"clusterSync,omitempty"`
	Conditions  []ExperimentCondition     `json:"conditions,omitempty"`

	VNC *VNCConfig `json:"vnc,omitempty"`
	SSH *SSHConfig `json:"ssh,omitempty"`
}

ExperimentStatus defines the observed state of Experiment

func (*ExperimentStatus) DeepCopy

func (in *ExperimentStatus) DeepCopy() *ExperimentStatus

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

func (*ExperimentStatus) DeepCopyInto

func (in *ExperimentStatus) DeepCopyInto(out *ExperimentStatus)

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

type PodTemplate

type PodTemplate struct {
	Image   string            `json:"image"`
	Env     map[string]string `json:"env,omitempty"`
	Command []string          `json:"command,omitempty"`
}

func (*PodTemplate) DeepCopy

func (in *PodTemplate) DeepCopy() *PodTemplate

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

func (*PodTemplate) DeepCopyInto

func (in *PodTemplate) DeepCopyInto(out *PodTemplate)

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

type SSHConfig

type SSHConfig struct {
	Username string `json:"username"`
	Password string `json:"password,omitempty"`
	Key      string `json:"key,omitempty"`
}

func (*SSHConfig) DeepCopy

func (in *SSHConfig) DeepCopy() *SSHConfig

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

func (*SSHConfig) DeepCopyInto

func (in *SSHConfig) DeepCopyInto(out *SSHConfig)

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

	Data TemplateData `json:"data,omitempty"`
}

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.

type TemplateData

type TemplateData struct {
	Type            TemplateType              `json:"type"`
	PodTemplate     *PodTemplate              `json:"podTemplate"`
	IngressProtocol ExperimentIngressProtocol `json:"ingressProtocol"`
	IngressPort     int32                     `json:"ingressPort"`

	VNC *VNCConfig `json:"vnc,omitempty"`
	SSH *SSHConfig `json:"ssh,omitempty"`
}

TemplateData defines the desired state of Template

func (*TemplateData) DeepCopy

func (in *TemplateData) DeepCopy() *TemplateData

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

func (*TemplateData) DeepCopyInto

func (in *TemplateData) DeepCopyInto(out *TemplateData)

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

type TemplateList

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

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 TemplateType

type TemplateType string
const (
	PodTemplateType TemplateType = "Pod"
)

type VNCConfig

type VNCConfig struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

func (*VNCConfig) DeepCopy

func (in *VNCConfig) DeepCopy() *VNCConfig

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

func (*VNCConfig) DeepCopyInto

func (in *VNCConfig) DeepCopyInto(out *VNCConfig)

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