v1

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 15 Imported by: 10

Documentation

Overview

Package v1 contains API Schema definitions for the diagnosis v1 API group +kubebuilder:object:generate=true +groupName=diagnosis.kubediag.org

Index

Constants

View Source
const (
	// DiagnosisPending means that the diagnosis has been accepted by the system, but no operation has been started.
	DiagnosisPending DiagnosisPhase = "Pending"
	// DiagnosisRunning means the diagnosis has been bound to a node and one of the operations have been started.
	// At least one operation is still running.
	DiagnosisRunning DiagnosisPhase = "Running"
	// DiagnosisSucceeded means that all operations in some path have voluntarily terminated with a response code
	// of 200, and the system is not going to execute rest operations.
	DiagnosisSucceeded DiagnosisPhase = "Succeeded"
	// DiagnosisFailed means that all paths in the graph have terminated, and at least one operation in each path
	// terminated in a failure.
	DiagnosisFailed DiagnosisPhase = "Failed"
	// DiagnosisUnknown means that for some reason the state of the diagnosis could not be obtained, typically due
	// to an error in communicating with the host of the diagnosis.
	DiagnosisUnknown DiagnosisPhase = "Unknown"

	// DiagnosisAccepted means that the diagnosis has been accepted by kubediag agent.
	DiagnosisAccepted DiagnosisConditionType = "Accepted"
	// DiagnosisComplete means the diagnosis has completed its execution.
	DiagnosisComplete DiagnosisConditionType = "Complete"
	// OperationSetChanged means the operation set specification has been changed during diagnosis execution.
	OperationSetChanged DiagnosisConditionType = "OperationSetChanged"
	// OperationSetNotReady means the graph has not been updated according to the latest specification.
	OperationSetNotReady DiagnosisConditionType = "OperationSetNotReady"
	// OperationSetNotFound means the operation set is not found when running Diagnosis.
	OperationSetNotFound DiagnosisConditionType = "OperationSetNotFound"
	// OperationNotFound means the operation is not found when running Diagnosis.
	OperationNotFound DiagnosisConditionType = "OperationNotFound"
)

Variables

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

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	// PathIndex is the index of current path in operation set status.
	PathIndex int `json:"pathIndex"`
	// NodeIndex is the index of current node in path.
	NodeIndex int `json:"nodeIndex"`
}

Checkpoint is the checkpoint for resuming unfinished diagnosis.

func (*Checkpoint) DeepCopy

func (in *Checkpoint) DeepCopy() *Checkpoint

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

func (*Checkpoint) DeepCopyInto

func (in *Checkpoint) DeepCopyInto(out *Checkpoint)

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

type CommonEvent added in v0.3.0

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

	Spec   CommonEventSpec   `json:"spec,omitempty"`
	Status CommonEventStatus `json:"status,omitempty"`
}

CommonEvent is the Schema for the commonevents API.

func (*CommonEvent) DeepCopy added in v0.3.0

func (in *CommonEvent) DeepCopy() *CommonEvent

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

func (*CommonEvent) DeepCopyInto added in v0.3.0

func (in *CommonEvent) DeepCopyInto(out *CommonEvent)

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

func (*CommonEvent) DeepCopyObject added in v0.3.0

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

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

type CommonEventList added in v0.3.0

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

CommonEventList contains a list of CommonEvent.

func (*CommonEventList) DeepCopy added in v0.3.0

func (in *CommonEventList) DeepCopy() *CommonEventList

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

func (*CommonEventList) DeepCopyInto added in v0.3.0

func (in *CommonEventList) DeepCopyInto(out *CommonEventList)

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

func (*CommonEventList) DeepCopyObject added in v0.3.0

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

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

type CommonEventSpec added in v0.3.0

type CommonEventSpec struct {
	Summary       string            `json:"summary"`
	Source        string            `json:"source"`
	Severity      string            `json:"severity"`
	Timestamp     string            `json:"timestamp,omitempty"`
	Class         string            `json:"class,omitempty"`
	Component     string            `json:"component,omitempty"`
	Group         string            `json:"group,omitempty"`
	CustomDetails map[string]string `json:"customDetails,omitempty"`
}

CommonEventSpec defines the desired state of CommonEvent.

func (*CommonEventSpec) DeepCopy added in v0.3.0

func (in *CommonEventSpec) DeepCopy() *CommonEventSpec

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

func (*CommonEventSpec) DeepCopyInto added in v0.3.0

func (in *CommonEventSpec) DeepCopyInto(out *CommonEventSpec)

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

type CommonEventStatus added in v0.3.0

type CommonEventStatus struct {
	Count          int          `json:"count,omitempty"`
	Resolved       bool         `json:"resolved,omitempty"`
	Diagnosed      bool         `json:"diagnosed,omitempty"`
	LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
}

CommonEventStatus defines the observed state of CommonEvent.

func (*CommonEventStatus) DeepCopy added in v0.3.0

func (in *CommonEventStatus) DeepCopy() *CommonEventStatus

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

func (*CommonEventStatus) DeepCopyInto added in v0.3.0

func (in *CommonEventStatus) DeepCopyInto(out *CommonEventStatus)

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

type CommonEventTemplate added in v0.3.1

type CommonEventTemplate struct {
	Regexp CommonEventTemplateRegexp `json:"regexp,omitempty"`
}

CommonEventTemplate specifies the template to create a diagnosis from a common event

func (*CommonEventTemplate) DeepCopy added in v0.3.1

func (in *CommonEventTemplate) DeepCopy() *CommonEventTemplate

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

func (*CommonEventTemplate) DeepCopyInto added in v0.3.1

func (in *CommonEventTemplate) DeepCopyInto(out *CommonEventTemplate)

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

type CommonEventTemplateRegexp added in v0.3.1

type CommonEventTemplateRegexp struct {
	// Source is the regular expression for matching "Source" of common event.
	// +optional
	Source string `json:"source,omitempty"`
	// Severity is the regular expression for matching "Severity" of common event.
	// +optional
	Severity string `json:"severity,omitempty"`
	// Class is the regular expression for matching "Class" of common event.
	// +optional
	Class string `json:"class,omitempty"`
	// Component is the regular expression for matching "Component" of common event.
	// +optional
	Component string `json:"component,omitempty"`
	// Group is the regular expression for matching "Group" of common event.
	// +optional
	Group string `json:"group,omitempty"`
}

CommonEventTemplateRegexp is the regular expression for matching common event template. All regular expressions must be in the syntax accepted by RE2 and described at https://golang.org/s/re2syntax.

func (*CommonEventTemplateRegexp) DeepCopy added in v0.3.1

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

func (*CommonEventTemplateRegexp) DeepCopyInto added in v0.3.1

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

type CronTemplate added in v0.2.2

type CronTemplate struct {
	// Schedule is the schedule in cron format.
	// See https://en.wikipedia.org/wiki/Cron for more details.
	Schedule string `json:"schedule"`
}

CronTemplate specifies the template to create a diagnosis periodically at fixed times.

func (*CronTemplate) DeepCopy added in v0.2.2

func (in *CronTemplate) DeepCopy() *CronTemplate

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

func (*CronTemplate) DeepCopyInto added in v0.2.2

func (in *CronTemplate) DeepCopyInto(out *CronTemplate)

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

type Diagnosis

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

	Spec   DiagnosisSpec   `json:"spec,omitempty"`
	Status DiagnosisStatus `json:"status,omitempty"`
}

Diagnosis is the Schema for the diagnoses API.

func (*Diagnosis) DeepCopy

func (in *Diagnosis) DeepCopy() *Diagnosis

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

func (*Diagnosis) DeepCopyInto

func (in *Diagnosis) DeepCopyInto(out *Diagnosis)

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

func (*Diagnosis) DeepCopyObject

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

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

func (*Diagnosis) Default

func (r *Diagnosis) Default()

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

func (*Diagnosis) SetupWebhookWithManager

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

SetupWebhookWithManager setups the Diagnosis webhook.

func (*Diagnosis) ValidateCreate

func (r *Diagnosis) ValidateCreate() error

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

func (*Diagnosis) ValidateDelete

func (r *Diagnosis) ValidateDelete() error

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

func (*Diagnosis) ValidateUpdate

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

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

type DiagnosisCondition

type DiagnosisCondition struct {
	// Type is the type of the condition.
	Type DiagnosisConditionType `json:"type"`
	// Status is the status of the condition.
	// Can be True, False, Unknown.
	Status corev1.ConditionStatus `json:"status"`
	// LastTransitionTime specifies last time the condition transitioned from one status
	// to another.
	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// Reason is a unique, one-word, CamelCase reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`
	// Message is a human readable message indicating details about last transition.
	// +optional
	Message string `json:"message,omitempty"`
}

DiagnosisCondition contains details for the current condition of this diagnosis.

func (*DiagnosisCondition) DeepCopy

func (in *DiagnosisCondition) DeepCopy() *DiagnosisCondition

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

func (*DiagnosisCondition) DeepCopyInto

func (in *DiagnosisCondition) DeepCopyInto(out *DiagnosisCondition)

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

type DiagnosisConditionType

type DiagnosisConditionType string

DiagnosisConditionType is a valid value for DiagnosisCondition.Type.

type DiagnosisList

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

DiagnosisList contains a list of Diagnosis.

func (*DiagnosisList) DeepCopy

func (in *DiagnosisList) DeepCopy() *DiagnosisList

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

func (*DiagnosisList) DeepCopyInto

func (in *DiagnosisList) DeepCopyInto(out *DiagnosisList)

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

func (*DiagnosisList) DeepCopyObject

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

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

type DiagnosisPhase

type DiagnosisPhase string

DiagnosisPhase is a label for the condition of a diagnosis at the current time.

type DiagnosisSpec

type DiagnosisSpec struct {
	// OperationSet is the name of operation set which represents diagnosis pipeline to be executed.
	OperationSet string `json:"operationSet"`
	// One of NodeName and PodReference must be specified.
	// NodeName is a specific node which the diagnosis is on.
	// +optional
	NodeName string `json:"nodeName,omitempty"`
	// PodReference contains details of the target pod.
	// +optional
	PodReference *PodReference `json:"podReference,omitempty"`
	// Parameters is a set of the parameters to be passed to opreations.
	// Parameters and OperationResults are encoded into a json object and sent to operation processor when
	// running diagnosis.
	// +optional
	Parameters map[string]string `json:"parameters,omitempty"`
}

DiagnosisSpec defines the desired state of Diagnosis.

func (*DiagnosisSpec) DeepCopy

func (in *DiagnosisSpec) DeepCopy() *DiagnosisSpec

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

func (*DiagnosisSpec) DeepCopyInto

func (in *DiagnosisSpec) DeepCopyInto(out *DiagnosisSpec)

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

type DiagnosisStatus

type DiagnosisStatus struct {
	// Phase is a simple, high-level summary of where the diagnosis is in its lifecycle.
	// The conditions array, the reason and message fields contain more detail about the
	// pod's status.
	// There are five possible phase values:
	//
	// DiagnosisPending: The diagnosis has been accepted by the system, but no operation has been started.
	// DiagnosisRunning: The diagnosis has been bound to a node and one of the operations have been started.
	// At least one operation is still running.
	// DiagnosisSucceeded: All operations in some path have voluntarily terminated with a response code
	// of 200, and the system is not going to execute rest operations.
	// DiagnosisFailed: All paths in the graph have terminated, and at least one operation in each path
	// terminated in a failure.
	// DiagnosisUnknown: For some reason the state of the diagnosis could not be obtained, typically due
	// to an error in communicating with the host of the diagnosis.
	// +optional
	Phase DiagnosisPhase `json:"phase,omitempty"`
	// Conditions contains current service state of diagnosis.
	// +optional
	Conditions []DiagnosisCondition `json:"conditions,omitempty"`
	// StartTime is RFC 3339 date and time at which the object was acknowledged by the system.
	// +optional
	StartTime metav1.Time `json:"startTime,omitempty"`
	// FailedPaths contains all failed paths in diagnosis pipeline.
	// The last node in the path is the one which fails to execute operation.
	// +optional
	FailedPaths []Path `json:"failedPaths,omitempty"`
	// SucceededPath is the succeeded paths in diagnosis pipeline.
	// +optional
	SucceededPath Path `json:"succeededPath,omitempty"`
	// OperationResults contains results of operations.
	// Parameters and OperationResults are encoded into a json object and sent to operation processor when
	// running diagnosis.
	// +optional
	OperationResults map[string]string `json:"operationResults,omitempty"`
	// Checkpoint is the checkpoint for resuming unfinished diagnosis.
	// +optional
	Checkpoint *Checkpoint `json:"checkpoint,omitempty"`
}

DiagnosisStatus defines the observed state of Diagnosis.

func (*DiagnosisStatus) DeepCopy

func (in *DiagnosisStatus) DeepCopy() *DiagnosisStatus

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

func (*DiagnosisStatus) DeepCopyInto

func (in *DiagnosisStatus) DeepCopyInto(out *DiagnosisStatus)

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

type Function added in v0.2.2

type Function struct {
	// CodeSource contains the code source files.
	CodeSource map[string]string `json:"codeSource"`
	// Runtime is the language to use for writing a function.
	Runtime FunctionRuntime `json:"runtime"`
}

Function contains the details to run a function as an operation.

func (*Function) DeepCopy added in v0.2.2

func (in *Function) DeepCopy() *Function

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

func (*Function) DeepCopyInto added in v0.2.2

func (in *Function) DeepCopyInto(out *Function)

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

type FunctionRuntime added in v0.2.2

type FunctionRuntime string

FunctionRuntime is a valid value for Function.Runtime.

const (
	// Python3FunctionRuntime is the runtime for running python3 functions
	Python3FunctionRuntime FunctionRuntime = "Python3"
)

type HTTPServer added in v0.2.1

type HTTPServer struct {
	// Address is the serving address of the processor. It must be either an ip or a dns address.
	// Defaults to kubediag agent advertised address if not specified.
	// +optional
	Address *string `json:"address,omitempty"`
	// Port is the serving port of the processor.
	// Defaults to kubediag agent serving port if not specified.
	// +optional
	Port *int32 `json:"port,omitempty"`
	// Path is the serving http path of processor.
	// +optional
	Path *string `json:"path,omitempty"`
	// Scheme is the serving scheme of processor. It must be either http or https.
	// +optional
	Scheme *string `json:"scheme,omitempty"`
}

HTTPServer specifies the http server to do operations.

func (*HTTPServer) DeepCopy added in v0.2.1

func (in *HTTPServer) DeepCopy() *HTTPServer

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

func (*HTTPServer) DeepCopyInto added in v0.2.1

func (in *HTTPServer) DeepCopyInto(out *HTTPServer)

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

type HostPath

type HostPath struct {
	// Path of the directory on the host.
	// Defaults to kubediag agent data root if not specified.
	Path string `json:"path"`
}

HostPath represents a directory on the host.

func (*HostPath) DeepCopy

func (in *HostPath) DeepCopy() *HostPath

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

func (*HostPath) DeepCopyInto

func (in *HostPath) DeepCopyInto(out *HostPath)

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

type KubernetesEventTemplate

type KubernetesEventTemplate struct {
	// Regexp is the regular expression for matching kubernetes event template.
	Regexp KubernetesEventTemplateRegexp `json:"regexp"`
}

KubernetesEventTemplate specifies the template to create a diagnosis from a kubernetes event.

func (*KubernetesEventTemplate) DeepCopy

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

func (*KubernetesEventTemplate) DeepCopyInto

func (in *KubernetesEventTemplate) DeepCopyInto(out *KubernetesEventTemplate)

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

type KubernetesEventTemplateRegexp

type KubernetesEventTemplateRegexp struct {
	// Name is the regular expression for matching "Name" of kubernetes event.
	// +optional
	Name string `json:"name,omitempty"`
	// Namespace is the regular expression for matching "Namespace" of kubernetes event.
	// +optional
	Namespace string `json:"namespace,omitempty"`
	// Reason is the regular expression for matching "Reason" of kubernetes event.
	// +optional
	Reason string `json:"reason,omitempty"`
	// Message is the regular expression for matching "Message" of kubernetes event.
	// +optional
	Message string `json:"message,omitempty"`
	// Source is the regular expression for matching "Source" of kubernetes event.
	// All fields of "Source" are regular expressions.
	// +optional
	Source corev1.EventSource `json:"source,omitempty"`
}

KubernetesEventTemplateRegexp is the regular expression for matching kubernetes event template. All regular expressions must be in the syntax accepted by RE2 and described at https://golang.org/s/re2syntax.

func (*KubernetesEventTemplateRegexp) DeepCopy

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

func (*KubernetesEventTemplateRegexp) DeepCopyInto

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

type NamespacedName

type NamespacedName struct {
	// Namespace specifies the namespace of a kubernetes api resource.
	Namespace string `json:"namespace"`
	// Name specifies the name of a kubernetes api resource.
	Name string `json:"name"`
}

NamespacedName represents a kubernetes api resource.

func (*NamespacedName) DeepCopy

func (in *NamespacedName) DeepCopy() *NamespacedName

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

func (*NamespacedName) DeepCopyInto

func (in *NamespacedName) DeepCopyInto(out *NamespacedName)

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

type Node

type Node struct {
	// ID is the unique identifier of the node.
	// It is identical to node index in adjacency list and set by admission webhook server.
	// +optional
	ID int `json:"id,omitempty"`
	// To is the list of node ids this node links to.
	// +optional
	To NodeSet `json:"to,omitempty"`
	// Operation is the name of operation running on the node.
	// It is empty if the node is the first in the list.
	// +optional
	Operation string `json:"operation,omitempty"`
	// Dependences is the list of depended node ids.
	// +optional
	Dependences NodeSet `json:"dependences,omitempty"`
}

Node is a node in the directed acyclic graph. It contains details of the operation.

func (*Node) DeepCopy

func (in *Node) DeepCopy() *Node

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

func (*Node) DeepCopyInto

func (in *Node) DeepCopyInto(out *Node)

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

type NodeSet

type NodeSet []int

NodeSet is the set of node ids.

func (NodeSet) DeepCopy

func (in NodeSet) DeepCopy() NodeSet

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

func (NodeSet) DeepCopyInto

func (in NodeSet) DeepCopyInto(out *NodeSet)

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

type Operation

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

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

Operation is the Schema for the operations API.

func (*Operation) DeepCopy

func (in *Operation) DeepCopy() *Operation

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

func (*Operation) DeepCopyInto

func (in *Operation) DeepCopyInto(out *Operation)

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

func (*Operation) DeepCopyObject

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

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

func (*Operation) Default

func (r *Operation) Default()

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

func (*Operation) SetupWebhookWithManager

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

SetupWebhookWithManager setups the Operation webhook.

func (*Operation) ValidateCreate

func (r *Operation) ValidateCreate() error

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

func (*Operation) ValidateDelete

func (r *Operation) ValidateDelete() error

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

func (*Operation) ValidateUpdate

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

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

type OperationList

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

OperationList contains a list of Operation.

func (*OperationList) DeepCopy

func (in *OperationList) DeepCopy() *OperationList

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

func (*OperationList) DeepCopyInto

func (in *OperationList) DeepCopyInto(out *OperationList)

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

func (*OperationList) DeepCopyObject

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

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

type OperationSet

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

	Spec   OperationSetSpec   `json:"spec,omitempty"`
	Status OperationSetStatus `json:"status,omitempty"`
}

OperationSet is the Schema for the operationsets API.

func (*OperationSet) DeepCopy

func (in *OperationSet) DeepCopy() *OperationSet

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

func (*OperationSet) DeepCopyInto

func (in *OperationSet) DeepCopyInto(out *OperationSet)

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

func (*OperationSet) DeepCopyObject

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

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

func (*OperationSet) Default

func (r *OperationSet) Default()

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

func (*OperationSet) SetupWebhookWithManager

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

SetupWebhookWithManager setups the OperationSet webhook.

func (*OperationSet) ValidateCreate

func (r *OperationSet) ValidateCreate() error

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

func (*OperationSet) ValidateDelete

func (r *OperationSet) ValidateDelete() error

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

func (*OperationSet) ValidateUpdate

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

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

type OperationSetList

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

OperationSetList contains a list of OperationSet.

func (*OperationSetList) DeepCopy

func (in *OperationSetList) DeepCopy() *OperationSetList

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

func (*OperationSetList) DeepCopyInto

func (in *OperationSetList) DeepCopyInto(out *OperationSetList)

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

func (*OperationSetList) DeepCopyObject

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

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

type OperationSetSpec

type OperationSetSpec struct {
	// AdjacencyList contains all nodes in the directed acyclic graph. The first node in the list represents the
	// start of a diagnosis.
	AdjacencyList []Node `json:"adjacencyList"`
}

OperationSetSpec defines the desired state of OperationSet.

func (*OperationSetSpec) DeepCopy

func (in *OperationSetSpec) DeepCopy() *OperationSetSpec

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

func (*OperationSetSpec) DeepCopyInto

func (in *OperationSetSpec) DeepCopyInto(out *OperationSetSpec)

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

type OperationSetStatus

type OperationSetStatus struct {
	// Paths is the collection of all directed paths of the directed acyclic graph.
	// +optional
	Paths []Path `json:"paths,omitempty"`
	// Specifies whether a valid directed acyclic graph can be generated via provided nodes.
	Ready bool `json:"ready"`
}

OperationSetStatus defines the observed state of OperationSet.

func (*OperationSetStatus) DeepCopy

func (in *OperationSetStatus) DeepCopy() *OperationSetStatus

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

func (*OperationSetStatus) DeepCopyInto

func (in *OperationSetStatus) DeepCopyInto(out *OperationSetStatus)

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

type OperationSpec

type OperationSpec struct {
	// Processor describes how to register a operation processor into kubediag.
	Processor Processor `json:"processor"`
	// Dependences is the list of all depended operations required to be precedently executed.
	// +optional
	Dependences []string `json:"dependences,omitempty"`
	// Storage represents the type of storage for operation results.
	// Operation results will not be stored if nil.
	// +optional
	Storage *Storage `json:"storage,omitempty"`
}

OperationSpec defines the desired state of Operation.

func (*OperationSpec) DeepCopy

func (in *OperationSpec) DeepCopy() *OperationSpec

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

func (*OperationSpec) DeepCopyInto

func (in *OperationSpec) DeepCopyInto(out *OperationSpec)

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

type Path

type Path []Node

Path represents a linear ordering of nodes along the direction of every directed edge.

func (Path) DeepCopy

func (in Path) DeepCopy() Path

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

func (Path) DeepCopyInto

func (in Path) DeepCopyInto(out *Path)

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

type PodReference

type PodReference struct {
	NamespacedName `json:",inline"`
	// Container specifies name of the target container.
	// +optional
	Container string `json:"container,omitempty"`
}

PodReference contains details of the target pod.

func (*PodReference) DeepCopy

func (in *PodReference) DeepCopy() *PodReference

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

func (*PodReference) DeepCopyInto

func (in *PodReference) DeepCopyInto(out *PodReference)

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

type Processor

type Processor struct {
	// One and only one of the following processor should be specified.
	// HTTPServer specifies the http server to do operations.
	// +optional
	HTTPServer *HTTPServer `json:"httpServer,omitempty"`
	// ScriptRunner contains the information to run a script.
	// +optional
	ScriptRunner *ScriptRunner `json:"scriptRunner,omitempty"`
	// Function contains the details to run a function as an operation.
	// +optional
	Function *Function `json:"function,omitempty"`
	// Number of seconds after which the processor times out.
	// Defaults to 30 seconds. Minimum value is 1.
	// +optional
	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
}

Processor describes how to register a operation processor into kubediag.

func (*Processor) DeepCopy

func (in *Processor) DeepCopy() *Processor

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

func (*Processor) DeepCopyInto

func (in *Processor) DeepCopyInto(out *Processor)

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

type PrometheusAlertTemplate

type PrometheusAlertTemplate struct {
	// Regexp is the regular expression for matching prometheus alert template.
	Regexp PrometheusAlertTemplateRegexp `json:"regexp"`
	// NodeNameReferenceLabel specifies the label for setting ".spec.nodeName" of generated diagnosis.
	// The label value will be set as ".spec.nodeName" field.
	// +optional
	NodeNameReferenceLabel model.LabelName `json:"nodeNameReferenceLabel,omitempty"`
	// PodNamespaceReferenceLabel specifies the label for setting ".spec.podReference.namespace" of generated diagnosis.
	// The label value will be set as ".spec.podReference.namespace" field.
	// +optional
	PodNamespaceReferenceLabel model.LabelName `json:"podNamespaceReferenceLabel,omitempty"`
	// PodNameReferenceLabel specifies the label for setting ".spec.podReference.name" of generated diagnosis.
	// The label value will be set as ".spec.podReference.name" field.
	// +optional
	PodNameReferenceLabel model.LabelName `json:"podNameReferenceLabel,omitempty"`
	// ContainerReferenceLabel specifies the label for setting ".spec.podReference.container" of generated diagnosis.
	// The label value will be set as ".spec.podReference.container" field.
	// +optional
	ContainerReferenceLabel model.LabelName `json:"containerReferenceLabel,omitempty"`
	// ParameterInjectionLabels specifies the labels for setting ".spec.parameters" of generated diagnosis.
	// All label names and values will be set as key value pairs in ".spec.parameters" field.
	// +optional
	ParameterInjectionLabels []model.LabelName `json:"parameterInjectionLabels,omitempty"`
}

PrometheusAlertTemplate specifies the template to create a diagnosis from a prometheus alert.

func (*PrometheusAlertTemplate) DeepCopy

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

func (*PrometheusAlertTemplate) DeepCopyInto

func (in *PrometheusAlertTemplate) DeepCopyInto(out *PrometheusAlertTemplate)

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

type PrometheusAlertTemplateRegexp

type PrometheusAlertTemplateRegexp struct {
	// AlertName is the regular expression for matching "AlertName" of prometheus alert.
	// +optional
	AlertName string `json:"alertName,omitempty"`
	// Labels is the regular expression for matching "Labels" of prometheus alert.
	// Only label values are regular expressions while all label names must be identical to the
	// prometheus alert label names.
	// +optional
	Labels model.LabelSet `json:"labels,omitempty"`
	// Annotations is the regular expression for matching "Annotations" of prometheus alert.
	// Only annotation values are regular expressions while all annotation names must be identical to the
	// prometheus alert annotation names.
	// +optional
	Annotations model.LabelSet `json:"annotations,omitempty"`
	// StartsAt is the regular expression for matching "StartsAt" of prometheus alert.
	// +optional
	StartsAt string `json:"startsAt,omitempty"`
	// EndsAt is the regular expression for matching "EndsAt" of prometheus alert.
	// +optional
	EndsAt string `json:"endsAt,omitempty"`
	// GeneratorURL is the regular expression for matching "GeneratorURL" of prometheus alert.
	// +optional
	GeneratorURL string `json:"generatorURL,omitempty"`
}

PrometheusAlertTemplateRegexp is the regular expression for matching prometheus alert template. All regular expressions must be in the syntax accepted by RE2 and described at https://golang.org/s/re2syntax.

func (*PrometheusAlertTemplateRegexp) DeepCopy

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

func (*PrometheusAlertTemplateRegexp) DeepCopyInto

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

type ScriptRunner added in v0.2.1

type ScriptRunner struct {
	// Script is the content of shell script.
	Script string `json:"script"`
	// ArgKeys contains a slice of keys in parameters or operationResults. The script arguments are generated
	// from specified key value pairs.
	// No argument will be passed to the script if not specified.
	// +optional
	ArgKeys []string `json:"argKeys,omitempty"`
	// OperationResultKey is the prefix of keys to store script stdout, stderr or error message in operationResults.
	// Execution results will not be updated if not specified.
	// +optional
	OperationResultKey *string `json:"operationResultKey,omitempty"`
}

ScriptRunner contains the information to run a script.

func (*ScriptRunner) DeepCopy added in v0.2.1

func (in *ScriptRunner) DeepCopy() *ScriptRunner

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

func (*ScriptRunner) DeepCopyInto added in v0.2.1

func (in *ScriptRunner) DeepCopyInto(out *ScriptRunner)

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

type SourceTemplate

type SourceTemplate struct {
	// One and only one of the following source should be specified.
	// PrometheusAlertTemplate specifies the template to create a diagnosis from a prometheus alert.
	// +optional
	PrometheusAlertTemplate *PrometheusAlertTemplate `json:"prometheusAlertTemplate,omitempty"`
	// KubernetesEventTemplate specifies the template to create a diagnosis from a kubernetes event.
	// +optional
	KubernetesEventTemplate *KubernetesEventTemplate `json:"kubernetesEventTemplate,omitempty"`
	// CommonEventTemplate specifies the template to create a diagnosis from a common event.
	// +optional
	CommonEventTemplate *CommonEventTemplate `json:"commonEventTemplate,omitempty"`
	// CronTemplate specifies the template to create a diagnosis periodically at fixed times.
	// +optional
	CronTemplate *CronTemplate `json:"cronTemplate,omitempty"`
}

SourceTemplate describes the information to generate a diagnosis.

func (*SourceTemplate) DeepCopy

func (in *SourceTemplate) DeepCopy() *SourceTemplate

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

func (*SourceTemplate) DeepCopyInto

func (in *SourceTemplate) DeepCopyInto(out *SourceTemplate)

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

type Storage

type Storage struct {
	// HostPath represents a directory on the host.
	// +optional
	HostPath *HostPath `json:"hostPath,omitempty"`
}

Storage represents the type of storage for operation results.

func (*Storage) DeepCopy

func (in *Storage) DeepCopy() *Storage

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

func (*Storage) DeepCopyInto

func (in *Storage) DeepCopyInto(out *Storage)

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

type Trigger

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

	Spec   TriggerSpec   `json:"spec,omitempty"`
	Status TriggerStatus `json:"status,omitempty"`
}

Trigger is the Schema for the triggers API.

func (*Trigger) DeepCopy

func (in *Trigger) DeepCopy() *Trigger

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

func (*Trigger) DeepCopyInto

func (in *Trigger) DeepCopyInto(out *Trigger)

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

func (*Trigger) DeepCopyObject

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

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

func (*Trigger) Default

func (r *Trigger) Default()

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

func (*Trigger) SetupWebhookWithManager

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

SetupWebhookWithManager setups the Trigger webhook.

func (*Trigger) ValidateCreate

func (r *Trigger) ValidateCreate() error

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

func (*Trigger) ValidateDelete

func (r *Trigger) ValidateDelete() error

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

func (*Trigger) ValidateUpdate

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

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

type TriggerList

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

TriggerList contains a list of Trigger.

func (*TriggerList) DeepCopy

func (in *TriggerList) DeepCopy() *TriggerList

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

func (*TriggerList) DeepCopyInto

func (in *TriggerList) DeepCopyInto(out *TriggerList)

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

func (*TriggerList) DeepCopyObject

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

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

type TriggerSpec

type TriggerSpec struct {
	// OperationSet is the name of referenced operation set in the generated diagnosis.
	OperationSet string `json:"operationSet"`
	// Parameters is a set of the parameters to be passed to diagnosis.
	// +optional
	Parameters map[string]string `json:"parameters,omitempty"`
	// NodeName is the default node which the diagnosis is on.
	// +optional
	NodeName string `json:"nodeName,omitempty"`
	// SourceTemplate is the template of trigger.
	SourceTemplate SourceTemplate `json:"sourceTemplate"`
}

TriggerSpec defines the desired state of Trigger.

func (*TriggerSpec) DeepCopy

func (in *TriggerSpec) DeepCopy() *TriggerSpec

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

func (*TriggerSpec) DeepCopyInto

func (in *TriggerSpec) DeepCopyInto(out *TriggerSpec)

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

type TriggerStatus added in v0.2.2

type TriggerStatus struct {
	// LastScheduleTime is the last time the cron was successfully scheduled.
	// +optional
	LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"`
}

TriggerStatus defines the observed state of Trigger.

func (*TriggerStatus) DeepCopy added in v0.2.2

func (in *TriggerStatus) DeepCopy() *TriggerStatus

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

func (*TriggerStatus) DeepCopyInto added in v0.2.2

func (in *TriggerStatus) DeepCopyInto(out *TriggerStatus)

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