v1alpha1

package
v0.0.0-...-58d9a08 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the inject v1alpha1 API group +kubebuilder:object:generate=true +groupName=chaosmeta.io

Index

Constants

View Source
const (
	ArgsListSplit  = ","
	LabelListSplit = "="
	FinalizerName  = "chaosmeta/experiment"
	ContainerKey   = "containername"
	FirstContainer = "firstcontainer"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "chaosmeta.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

func ConvertDuration

func ConvertDuration(d string) (time.Duration, error)

Types

type ArgsUnit

type ArgsUnit struct {
	Key       string `json:"key"`
	Value     string `json:"value"`
	ValueType VType  `json:"valueType,omitempty"`
}

func (*ArgsUnit) DeepCopy

func (in *ArgsUnit) DeepCopy() *ArgsUnit

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

func (*ArgsUnit) DeepCopyInto

func (in *ArgsUnit) DeepCopyInto(out *ArgsUnit)

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

type CloudTargetType

type CloudTargetType string
const (
	ClusterCloudTarget     CloudTargetType = "cluster"
	PodCloudTarget         CloudTargetType = "pod"
	NodeCloudTarget        CloudTargetType = "node"
	DeploymentCloudTarget  CloudTargetType = "deployment"
	StatefulsetCloudTarget CloudTargetType = "statefulset"
	DaemonsetCloudTarget   CloudTargetType = "daemonset"
	NamespaceCloudTarget   CloudTargetType = "namespace"
	JobCloudTarget         CloudTargetType = "job"
)

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

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.

func (*Experiment) Default

func (r *Experiment) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*Experiment) SetupWebhookWithManager

func (r *Experiment) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*Experiment) ValidateCreate

func (r *Experiment) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Experiment) ValidateDelete

func (r *Experiment) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*Experiment) ValidateUpdate

func (r *Experiment) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type ExperimentCommon

type ExperimentCommon struct {
	// Duration support "h", "m", "s"
	Duration string     `json:"duration,omitempty"`
	Target   string     `json:"target"`
	Fault    string     `json:"fault"`
	Args     []ArgsUnit `json:"args,omitempty"`
}

func (*ExperimentCommon) DeepCopy

func (in *ExperimentCommon) DeepCopy() *ExperimentCommon

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

func (*ExperimentCommon) DeepCopyInto

func (in *ExperimentCommon) DeepCopyInto(out *ExperimentCommon)

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

type ExperimentDetail

type ExperimentDetail struct {
	Inject  []ExperimentDetailUnit `json:"inject,omitempty"`
	Recover []ExperimentDetailUnit `json:"recover,omitempty"`
}

func (*ExperimentDetail) DeepCopy

func (in *ExperimentDetail) DeepCopy() *ExperimentDetail

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

func (*ExperimentDetail) DeepCopyInto

func (in *ExperimentDetail) DeepCopyInto(out *ExperimentDetail)

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

type ExperimentDetailUnit

type ExperimentDetailUnit struct {
	InjectObjectName string `json:"injectObjectName,omitempty"`
	//InjectObjectInfo string     `json:"injectObjectInfo,omitempty"`
	UID        string     `json:"uid,omitempty"`
	Message    string     `json:"message,omitempty"`
	Status     StatusType `json:"status,omitempty"`
	StartTime  string     `json:"startTime,omitempty"`
	UpdateTime string     `json:"updateTime,omitempty"`
	Backup     string     `json:"backup,omitempty"`
}

func (*ExperimentDetailUnit) DeepCopy

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

func (*ExperimentDetailUnit) DeepCopyInto

func (in *ExperimentDetailUnit) DeepCopyInto(out *ExperimentDetailUnit)

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

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 {

	// Scope Optional: node, pod. type of experiment object
	Scope      ScopeType         `json:"scope"`
	RangeMode  *RangeMode        `json:"rangeMode,omitempty"`
	Experiment *ExperimentCommon `json:"experiment"`
	// Selector The internal part of unit is "AND", and the external part is "OR" and de-duplication
	Selector []SelectorUnit `json:"selector,omitempty"`

	TargetPhase PhaseType `json:"targetPhase"`
}

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 {
	Phase      PhaseType        `json:"phase"`
	Status     StatusType       `json:"status"`
	Message    string           `json:"message"`
	Detail     ExperimentDetail `json:"detail"`
	CreateTime string           `json:"createTime"`
	UpdateTime string           `json:"updateTime"`
}

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 PhaseType

type PhaseType string
const (
	InjectPhaseType  PhaseType = "inject"
	RecoverPhaseType PhaseType = "recover"
)

type RangeMode

type RangeMode struct {
	// Type Optional: all、percent、count
	Type  RangeType `json:"type"`
	Value int       `json:"value,omitempty"`
}

func (*RangeMode) DeepCopy

func (in *RangeMode) DeepCopy() *RangeMode

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

func (*RangeMode) DeepCopyInto

func (in *RangeMode) DeepCopyInto(out *RangeMode)

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

type RangeType

type RangeType string
const (
	AllRangeType     RangeType = "all"
	PercentRangeType RangeType = "percent"
	CountRangeType   RangeType = "count"
)

type ScopeType

type ScopeType string
const (
	PodScopeType        ScopeType = "pod"
	NodeScopeType       ScopeType = "node"
	KubernetesScopeType ScopeType = "kubernetes"
)

type SelectorUnit

type SelectorUnit struct {
	Namespace string            `json:"namespace,omitempty"`
	Name      []string          `json:"name,omitempty"`
	IP        []string          `json:"ip,omitempty"`
	Label     map[string]string `json:"label,omitempty"`
	SubName   string            `json:"subName,omitempty"`
}

func (*SelectorUnit) DeepCopy

func (in *SelectorUnit) DeepCopy() *SelectorUnit

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

func (*SelectorUnit) DeepCopyInto

func (in *SelectorUnit) DeepCopyInto(out *SelectorUnit)

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

type StatusType

type StatusType string
const (
	CreatedStatusType     StatusType = "created"
	SuccessStatusType     StatusType = "success"
	FailedStatusType      StatusType = "failed"
	RunningStatusType     StatusType = "running"
	PartSuccessStatusType StatusType = "partSuccess"
)

type VType

type VType string
const (
	IntVType    VType = "int"
	StringVType VType = "string"
)

Jump to

Keyboard shortcuts

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