v1alpha1

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 5 Imported by: 3

README

OperatorCommand

The OperatorCommand CRD is designed to enable the execution of various actions within the cluster and reporting their status back to the backend. This CRD serves as a central mechanism for triggering and managing actions, replacing the functionality previously provided by the gateway and kollector.

How it Works

  1. Creation: The backend creates a Command CRD instance, specifying the desired action and any necessary parameters for the action.
  2. Synchronization: The Synchronizer, responsible for two-way communication, receives the Command CRD from the backend and saves it in the cluster.
  3. Execution: The designated component in the cluster, identifies the new command via a watcher on the Kubernetes API, processes the Command CRD and performs the requested action within the cluster.
  4. Status Reporting: Upon completion, the component updates the command CRD resource with the status of the action, providing information about success or failure, any relevant details, and potentially updating the Command CRD. The synchronizer, watching over the command CRD, will send it back to the backend for further processing.

Documentation

Index

Constants

View Source
const (
	OperatorCommandVersion string = "v1alpha1"
)

Variables

View Source
var SchemaGroupVersionResource = schema.GroupVersionResource{
	Group:    types.OperatorCommandGroup,
	Version:  OperatorCommandVersion,
	Resource: types.OperatorCommandPlural,
}

Functions

This section is empty.

Types

type OperatorCommand

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

	Spec   OperatorCommandSpec   `json:"spec,omitempty"`
	Status OperatorCommandStatus `json:"status,omitempty"`
}

type OperatorCommandList

type OperatorCommandList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []OperatorCommand `json:"items"`
}

type OperatorCommandSpec

type OperatorCommandSpec struct {
	GUID           string                         `json:"guid"`                     // GUID is a unique identifier for the command
	CommandType    string                         `json:"commandType"`              // CommandType is the type of the command
	CommandVersion string                         `json:"commandVersion,omitempty"` // CommandVersion is the version of the command
	Designators    []identifiers.PortalDesignator `json:"designators,omitempty"`    // Designators are the designators for the command
	Body           []byte                         `json:"body,omitempty"`           // Body is the body of the command
	TTL            time.Duration                  `json:"ttl,omitempty"`            // TTL is the time to live for the command
	Args           map[string]interface{}         `json:"args,omitempty"`           // Args are the arguments for the command
	CommandIndex   *int                           `json:"commandIndex,omitempty"`   // CommandIndex is the index of the command in the sequence
	CommandCount   *int                           `json:"commandCount,omitempty"`   // CommandCount is the total number of commands in the sequence
}

type OperatorCommandStatus

type OperatorCommandStatus struct {
	Started     bool                        `json:"started"`               // Started indicates if the command has started
	StartedAt   *metav1.Time                `json:"startedAt,omitempty"`   // StartedAt is the time at which the command was started
	Completed   bool                        `json:"completed"`             // Completed indicates if the command has completed
	CompletedAt *metav1.Time                `json:"completedAt,omitempty"` // CompletedAt is the time at which the command was completed
	Executer    string                      `json:"executer,omitempty"`    // Executer is the entity that executed the command
	Error       *OperatorCommandStatusError `json:"error,omitempty"`       // Error is the error that occurred during the execution of the command (if any)
	Payload     []byte                      `json:"payload,omitempty"`     // Payload is the response payload from execution of the command (if any)
}

type OperatorCommandStatusError

type OperatorCommandStatusError struct {
	Reason    string `json:"reason,omitempty"`    // reason for the error (optional)
	Message   string `json:"message,omitempty"`   // error message (optional)
	ErrorCode int    `json:"errorCode,omitempty"` // error code (optional)
}

Jump to

Keyboard shortcuts

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