Documentation ¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the chaosblade v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=chaosblade.io
Package v1alpha1 contains API Schema definitions for the chaosblade v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=chaosblade.io
Index ¶
Constants ¶
const ( PodKind = "pod" ContainerKind = "container" NodeKind = "node" )
const ( SuccessState = "Success" ErrorState = "Error" DestroyedState = "Destroyed" )
Variables ¶
var ( // SchemeGroupVersion is group version used to register these objects SchemeGroupVersion = schema.GroupVersion{Group: "chaosblade.io", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} )
Functions ¶
func GetOpenAPIDefinitions ¶
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition
Types ¶
type ChaosBlade ¶
type ChaosBlade struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ChaosBladeSpec `json:"spec,omitempty"` Status ChaosBladeStatus `json:"status,omitempty"` }
ChaosBlade is the Schema for the chaosblades API +k8s:openapi-gen=true +kubebuilder:subresource:status
func (*ChaosBlade) DeepCopy ¶
func (in *ChaosBlade) DeepCopy() *ChaosBlade
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChaosBlade.
func (*ChaosBlade) DeepCopyInto ¶
func (in *ChaosBlade) DeepCopyInto(out *ChaosBlade)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ChaosBlade) DeepCopyObject ¶
func (in *ChaosBlade) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ChaosBladeList ¶
type ChaosBladeList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []ChaosBlade `json:"items"` }
ChaosBladeList contains a list of ChaosBlade
func (*ChaosBladeList) DeepCopy ¶
func (in *ChaosBladeList) DeepCopy() *ChaosBladeList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChaosBladeList.
func (*ChaosBladeList) DeepCopyInto ¶
func (in *ChaosBladeList) DeepCopyInto(out *ChaosBladeList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ChaosBladeList) DeepCopyObject ¶
func (in *ChaosBladeList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ChaosBladeSpec ¶
type ChaosBladeSpec struct { // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html Experiments []ExperimentSpec `json:"experiments"` }
ChaosBladeSpec defines the desired state of ChaosBlade +k8s:openapi-gen=true
func (*ChaosBladeSpec) DeepCopy ¶
func (in *ChaosBladeSpec) DeepCopy() *ChaosBladeSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChaosBladeSpec.
func (*ChaosBladeSpec) DeepCopyInto ¶
func (in *ChaosBladeSpec) DeepCopyInto(out *ChaosBladeSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ChaosBladeStatus ¶
type ChaosBladeStatus struct { // Phase indicates the state of the experiment // Initial -> Running -> Updating -> Destroying -> Destroyed Phase ClusterPhase `json:"phase,omitempty"` // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html ExpStatuses []ExperimentStatus `json:"expStatuses"` }
ChaosBladeStatus defines the observed state of ChaosBlade +k8s:openapi-gen=true
func (*ChaosBladeStatus) DeepCopy ¶
func (in *ChaosBladeStatus) DeepCopy() *ChaosBladeStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChaosBladeStatus.
func (*ChaosBladeStatus) DeepCopyInto ¶
func (in *ChaosBladeStatus) DeepCopyInto(out *ChaosBladeStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterPhase ¶
type ClusterPhase string
const ( ClusterPhaseInitial ClusterPhase = "" ClusterPhaseInitialized ClusterPhase = "Initialized" ClusterPhaseRunning ClusterPhase = "Running" ClusterPhaseUpdating ClusterPhase = "Updating" ClusterPhaseDestroying ClusterPhase = "Destroying" ClusterPhaseDestroyed ClusterPhase = "Destroyed" ClusterPhaseError ClusterPhase = "Error" )
type ExperimentSpec ¶
type ExperimentSpec struct { // Scope is the area of the experiments, currently support node, pod and container Scope string `json:"scope"` // Target is the experiment target, such as cpu, network Target string `json:"target"` // Action is the experiment scenario of the target, such as delay, load Action string `json:"action"` // Desc is the experiment description Desc string `json:"desc,omitempty"` // Matchers is the experiment rules Matchers []FlagSpec `json:"matchers,omitempty"` }
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 { // experiment scope for cache Scope string `json:"scope"` Target string `json:"target"` Action string `json:"action"` // Success is used to judge the experiment result Success bool `json:"success"` // State is used to describe the experiment result State string `json:"state"` Error string `json:"error,omitempty"` // ResStatuses is the details of the experiment ResStatuses []ResourceStatus `json:"resStatuses,omitempty"` }
func CreateDestroyedExperimentStatus ¶
func CreateDestroyedExperimentStatus(ResStatuses []ResourceStatus) ExperimentStatus
func CreateFailExperimentStatus ¶
func CreateFailExperimentStatus(err string, ResStatuses []ResourceStatus) ExperimentStatus
func CreateSuccessExperimentStatus ¶
func CreateSuccessExperimentStatus(ResStatuses []ResourceStatus) ExperimentStatus
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 FlagSpec ¶
type FlagSpec struct { // Name is the name of flag Name string `json:"name"` // TODO: Temporarily defined as an array for all flags // Value is the value of flag Value []string `json:"value"` }
func (*FlagSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlagSpec.
func (*FlagSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceStatus ¶
type ResourceStatus struct { // experiment uid in chaosblade Id string `json:"id,omitempty"` // experiment state State string `json:"state"` // experiment code Code int32 `json:"code,omitempty"` // experiment error Error string `json:"error,omitempty"` // success Success bool `json:"success"` // Kind Kind string `json:"kind"` // Resource identifier, rules as following: // container: Namespace/NodeName/PodName/ContainerName // pod: Namespace/NodeName/PodName Identifier string `json:"identifier,omitempty"` }
func CreateFailResStatuses ¶ added in v1.2.0
func CreateFailResStatuses(code int32, err, uid string) []ResourceStatus
func (*ResourceStatus) CreateFailResourceStatus ¶
func (in *ResourceStatus) CreateFailResourceStatus(err string, code int32) ResourceStatus
func (*ResourceStatus) CreateSuccessResourceStatus ¶
func (in *ResourceStatus) CreateSuccessResourceStatus() ResourceStatus
func (*ResourceStatus) DeepCopy ¶
func (in *ResourceStatus) DeepCopy() *ResourceStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceStatus.
func (*ResourceStatus) DeepCopyInto ¶
func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.