Documentation
¶
Index ¶
- Constants
- Variables
- func IsConditionTrue(conditions []Condition, condition Condition) bool
- func IsConditionsTrue(conditions []Condition) bool
- func SetConditionError(condition *Condition, reason string, err error)
- func ToAggregate(list []error) utilerrors.Aggregate
- type Action
- type ActionData
- type ActionList
- type ActionOn
- type ActionPhase
- type ActionSpec
- type ActionStatus
- type Condition
- type ContentAndTarget
- type Host
- type Phase
- type SSH
- type SourceAndTarget
- type VirtualMachine
- func (in *VirtualMachine) DeepCopy() *VirtualMachine
- func (in *VirtualMachine) DeepCopyInto(out *VirtualMachine)
- func (in *VirtualMachine) DeepCopyObject() runtime.Object
- func (c *VirtualMachine) GetHostByRole(role string) *Host
- func (c *VirtualMachine) GetHostStatusByName(name string) *VirtualMachineHostStatus
- func (c *VirtualMachine) GetHostStatusByRoleIndex(role string, index int) *VirtualMachineHostStatus
- func (c *VirtualMachine) GetRoles() []string
- type VirtualMachineHostStatus
- type VirtualMachineList
- type VirtualMachineSpec
- type VirtualMachineStatus
Constants ¶
const MultipassType = "Multipass"
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "virtual-machine.sealos.io", 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 )
var ( CPUKey = "cpu" MEMKey = "memory" DISKKey = "disk" )
Functions ¶
func IsConditionTrue ¶
func IsConditionsTrue ¶
func SetConditionError ¶
func ToAggregate ¶
func ToAggregate(list []error) utilerrors.Aggregate
ToAggregate converts the ErrorList into an errors.Aggregate.
Types ¶
type Action ¶
type Action struct {
metav1.TypeMeta `json:",inline"`
Spec ActionSpec `json:"spec,omitempty"`
Status ActionStatus `json:"status,omitempty"`
}
Action is the Schema for the action API
func (*Action) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action.
func (*Action) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Action) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ActionData ¶ added in v0.1.0
type ActionData struct {
// ActionMount mount src:dst
ActionMount *SourceAndTarget `json:"mount,omitempty"`
// ActionUmount umount dst
ActionUmount string `json:"umount,omitempty"`
// ActionExec exec cmd
ActionExec string `json:"exec,omitempty"`
// ActionCopy copy file src:dst
ActionCopy *SourceAndTarget `json:"copy,omitempty"`
// ActionCopyContent copy file content
ActionCopyContent *ContentAndTarget `json:"copyContent,omitempty"`
}
func (*ActionData) DeepCopy ¶ added in v0.1.0
func (in *ActionData) DeepCopy() *ActionData
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionData.
func (*ActionData) DeepCopyInto ¶ added in v0.1.0
func (in *ActionData) DeepCopyInto(out *ActionData)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ActionData) String ¶ added in v0.1.0
func (a *ActionData) String() string
type ActionList ¶
type ActionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Action `json:"items"`
}
ActionList contains a list of Action
func (*ActionList) DeepCopy ¶
func (in *ActionList) DeepCopy() *ActionList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionList.
func (*ActionList) DeepCopyInto ¶
func (in *ActionList) DeepCopyInto(out *ActionList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ActionList) DeepCopyObject ¶
func (in *ActionList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ActionOn ¶ added in v0.1.0
type ActionOn struct {
Role string `json:"role,omitempty"`
Indexes []int32 `json:"indexes,omitempty"`
}
func (*ActionOn) DeepCopy ¶ added in v0.1.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionOn.
func (*ActionOn) DeepCopyInto ¶ added in v0.1.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ActionPhase ¶
type ActionPhase string
const ( ActionPhaseFailed ActionPhase = "Failed" ActionPhaseComplete ActionPhase = "Complete" ActionPhaseInProcess ActionPhase = "InProcess" )
type ActionSpec ¶
type ActionSpec struct {
Ons []ActionOn `json:"ons,omitempty"`
Data []ActionData `json:"data,omitempty"`
}
ActionSpec defines the desired state of Action
func (*ActionSpec) DeepCopy ¶
func (in *ActionSpec) DeepCopy() *ActionSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionSpec.
func (*ActionSpec) DeepCopyInto ¶
func (in *ActionSpec) DeepCopyInto(out *ActionSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ActionStatus ¶
type ActionStatus struct {
Phase ActionPhase `json:"phase,omitempty"`
Message string `json:"message,omitempty"`
}
ActionStatus defines the observed state of Action
func (*ActionStatus) DeepCopy ¶
func (in *ActionStatus) DeepCopy() *ActionStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionStatus.
func (*ActionStatus) DeepCopyInto ¶
func (in *ActionStatus) DeepCopyInto(out *ActionStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Condition ¶
type Condition struct {
Type string `json:"type"`
Status v1.ConditionStatus `json:"status"`
LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime,omitempty"`
// +optional
Reason string `json:"reason,omitempty"`
// +optional
Message string `json:"message,omitempty"`
}
func DeleteCondition ¶
func UpdateCondition ¶
UpdateCondition updates condition in cluster conditions using giving condition adds condition if not existed
func (*Condition) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ContentAndTarget ¶ added in v0.1.0
type ContentAndTarget struct {
Content string `json:"content,omitempty"`
Target string `json:"target,omitempty"`
}
func (*ContentAndTarget) DeepCopy ¶ added in v0.1.0
func (in *ContentAndTarget) DeepCopy() *ContentAndTarget
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContentAndTarget.
func (*ContentAndTarget) DeepCopyInto ¶ added in v0.1.0
func (in *ContentAndTarget) DeepCopyInto(out *ContentAndTarget)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Host ¶
type Host struct {
Role string `json:"roles,omitempty"`
Count int `json:"count,omitempty"`
// key values resources.
// cpu: 2
// memory: 4
// other resources like GPU
Resources map[string]string `json:"resources,omitempty"`
// ecs.t5-lc1m2.large
Image string `json:"image,omitempty"`
}
func (*Host) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Host.
func (*Host) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SSH ¶
type SSH struct {
PublicFile string `json:"publicFile,omitempty"`
PkFile string `json:"pkFile,omitempty"`
PkPasswd string `json:"pkPasswd,omitempty"`
}
func (*SSH) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSH.
func (*SSH) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SourceAndTarget ¶ added in v0.1.0
type SourceAndTarget struct {
Source string `json:"source,omitempty"`
Target string `json:"target,omitempty"`
}
func (*SourceAndTarget) DeepCopy ¶ added in v0.1.0
func (in *SourceAndTarget) DeepCopy() *SourceAndTarget
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceAndTarget.
func (*SourceAndTarget) DeepCopyInto ¶ added in v0.1.0
func (in *SourceAndTarget) DeepCopyInto(out *SourceAndTarget)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VirtualMachine ¶
type VirtualMachine struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec VirtualMachineSpec `json:"spec,omitempty"`
Status VirtualMachineStatus `json:"status,omitempty"`
}
VirtualMachine is the Schema for the infra API
func (*VirtualMachine) DeepCopy ¶
func (in *VirtualMachine) DeepCopy() *VirtualMachine
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachine.
func (*VirtualMachine) DeepCopyInto ¶
func (in *VirtualMachine) DeepCopyInto(out *VirtualMachine)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*VirtualMachine) DeepCopyObject ¶
func (in *VirtualMachine) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*VirtualMachine) GetHostByRole ¶
func (c *VirtualMachine) GetHostByRole(role string) *Host
func (*VirtualMachine) GetHostStatusByName ¶ added in v0.1.0
func (c *VirtualMachine) GetHostStatusByName(name string) *VirtualMachineHostStatus
func (*VirtualMachine) GetHostStatusByRoleIndex ¶
func (c *VirtualMachine) GetHostStatusByRoleIndex(role string, index int) *VirtualMachineHostStatus
func (*VirtualMachine) GetRoles ¶ added in v0.1.0
func (c *VirtualMachine) GetRoles() []string
type VirtualMachineHostStatus ¶
type VirtualMachineHostStatus struct {
State string `json:"state"`
Role string `json:"roles"`
ID string `json:"ID,omitempty"`
//当前主机的所有IP,可能包括公开或者私有的IP
IPs []string `json:"IPs,omitempty"`
ImageID string `json:"imageID,omitempty"`
ImageName string `json:"imageName,omitempty"`
Capacity map[string]string `json:"capacity"`
Used map[string]string `json:"used"`
Mounts map[string]string `json:"mounts,omitempty"`
Index int `json:"index,omitempty"`
}
func (*VirtualMachineHostStatus) DeepCopy ¶
func (in *VirtualMachineHostStatus) DeepCopy() *VirtualMachineHostStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineHostStatus.
func (*VirtualMachineHostStatus) DeepCopyInto ¶
func (in *VirtualMachineHostStatus) DeepCopyInto(out *VirtualMachineHostStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VirtualMachineList ¶
type VirtualMachineList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []VirtualMachine `json:"items"`
}
VirtualMachineList contains a list of VirtualMachine
func (*VirtualMachineList) DeepCopy ¶
func (in *VirtualMachineList) DeepCopy() *VirtualMachineList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineList.
func (*VirtualMachineList) DeepCopyInto ¶
func (in *VirtualMachineList) DeepCopyInto(out *VirtualMachineList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*VirtualMachineList) DeepCopyObject ¶
func (in *VirtualMachineList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type VirtualMachineSpec ¶
type VirtualMachineSpec struct {
Hosts []Host `json:"hosts,omitempty"`
SSH SSH `json:"ssh"`
Type string `json:"provider,omitempty"`
}
VirtualMachineSpec defines the desired state of VirtualMachine
func (*VirtualMachineSpec) DeepCopy ¶
func (in *VirtualMachineSpec) DeepCopy() *VirtualMachineSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineSpec.
func (*VirtualMachineSpec) DeepCopyInto ¶
func (in *VirtualMachineSpec) DeepCopyInto(out *VirtualMachineSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VirtualMachineStatus ¶
type VirtualMachineStatus struct {
Phase Phase `json:"phase,omitempty"`
Hosts []VirtualMachineHostStatus `json:"hosts"`
Conditions []Condition `json:"conditions,omitempty" `
}
VirtualMachineStatus defines the observed state of VirtualMachine
func (*VirtualMachineStatus) DeepCopy ¶
func (in *VirtualMachineStatus) DeepCopy() *VirtualMachineStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineStatus.
func (*VirtualMachineStatus) DeepCopyInto ¶
func (in *VirtualMachineStatus) DeepCopyInto(out *VirtualMachineStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.