lifecycle

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	OperatorLifecycle_GetCapabilities_FullMethodName = "/cnpgi.operator_lifecycle.v1.OperatorLifecycle/GetCapabilities"
	OperatorLifecycle_LifecycleHook_FullMethodName   = "/cnpgi.operator_lifecycle.v1.OperatorLifecycle/LifecycleHook"
)

Variables

View Source
var (
	OperatorOperationType_Type_name = map[int32]string{
		0: "TYPE_UNSPECIFIED",
		1: "TYPE_PATCH",
		2: "TYPE_UPDATE",
		3: "TYPE_CREATE",
		4: "TYPE_DELETE",
		5: "TYPE_DEREGISTER",
		6: "TYPE_EVALUATE",
	}
	OperatorOperationType_Type_value = map[string]int32{
		"TYPE_UNSPECIFIED": 0,
		"TYPE_PATCH":       1,
		"TYPE_UPDATE":      2,
		"TYPE_CREATE":      3,
		"TYPE_DELETE":      4,
		"TYPE_DEREGISTER":  5,
		"TYPE_EVALUATE":    6,
	}
)

Enum value maps for OperatorOperationType_Type.

View Source
var File_proto_operator_lifecycle_proto protoreflect.FileDescriptor
View Source
var OperatorLifecycle_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cnpgi.operator_lifecycle.v1.OperatorLifecycle",
	HandlerType: (*OperatorLifecycleServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetCapabilities",
			Handler:    _OperatorLifecycle_GetCapabilities_Handler,
		},
		{
			MethodName: "LifecycleHook",
			Handler:    _OperatorLifecycle_LifecycleHook_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/operator_lifecycle.proto",
}

OperatorLifecycle_ServiceDesc is the grpc.ServiceDesc for OperatorLifecycle service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterOperatorLifecycleServer

func RegisterOperatorLifecycleServer(s grpc.ServiceRegistrar, srv OperatorLifecycleServer)

Types

type OperatorLifecycleCapabilities

type OperatorLifecycleCapabilities struct {

	// The Kubernetes resource group (such as "apps" or empty for core resources)
	Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
	// The Kubernetes Kind name (such as "Cluster" or "Pod")
	Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"`
	// The operation type
	OperationTypes []*OperatorOperationType `protobuf:"bytes,3,rep,name=operation_types,json=operationTypes,proto3" json:"operation_types,omitempty"`
	// contains filtered or unexported fields
}

func (*OperatorLifecycleCapabilities) Descriptor deprecated

func (*OperatorLifecycleCapabilities) Descriptor() ([]byte, []int)

Deprecated: Use OperatorLifecycleCapabilities.ProtoReflect.Descriptor instead.

func (*OperatorLifecycleCapabilities) GetGroup

func (x *OperatorLifecycleCapabilities) GetGroup() string

func (*OperatorLifecycleCapabilities) GetKind

func (*OperatorLifecycleCapabilities) GetOperationTypes

func (x *OperatorLifecycleCapabilities) GetOperationTypes() []*OperatorOperationType

func (*OperatorLifecycleCapabilities) ProtoMessage

func (*OperatorLifecycleCapabilities) ProtoMessage()

func (*OperatorLifecycleCapabilities) ProtoReflect

func (*OperatorLifecycleCapabilities) Reset

func (x *OperatorLifecycleCapabilities) Reset()

func (*OperatorLifecycleCapabilities) String

type OperatorLifecycleCapabilitiesRequest

type OperatorLifecycleCapabilitiesRequest struct {
	// contains filtered or unexported fields
}

func (*OperatorLifecycleCapabilitiesRequest) Descriptor deprecated

func (*OperatorLifecycleCapabilitiesRequest) Descriptor() ([]byte, []int)

Deprecated: Use OperatorLifecycleCapabilitiesRequest.ProtoReflect.Descriptor instead.

func (*OperatorLifecycleCapabilitiesRequest) ProtoMessage

func (*OperatorLifecycleCapabilitiesRequest) ProtoMessage()

func (*OperatorLifecycleCapabilitiesRequest) ProtoReflect

func (*OperatorLifecycleCapabilitiesRequest) Reset

func (*OperatorLifecycleCapabilitiesRequest) String

type OperatorLifecycleCapabilitiesResponse

type OperatorLifecycleCapabilitiesResponse struct {

	// This message is OPTIONAL, containing the list of resources
	// for which the lifecycle hook is called
	LifecycleCapabilities []*OperatorLifecycleCapabilities `protobuf:"bytes,1,rep,name=lifecycle_capabilities,json=lifecycleCapabilities,proto3" json:"lifecycle_capabilities,omitempty"`
	// contains filtered or unexported fields
}

func (*OperatorLifecycleCapabilitiesResponse) Descriptor deprecated

func (*OperatorLifecycleCapabilitiesResponse) Descriptor() ([]byte, []int)

Deprecated: Use OperatorLifecycleCapabilitiesResponse.ProtoReflect.Descriptor instead.

func (*OperatorLifecycleCapabilitiesResponse) GetLifecycleCapabilities

func (*OperatorLifecycleCapabilitiesResponse) ProtoMessage

func (*OperatorLifecycleCapabilitiesResponse) ProtoMessage()

func (*OperatorLifecycleCapabilitiesResponse) ProtoReflect

func (*OperatorLifecycleCapabilitiesResponse) Reset

func (*OperatorLifecycleCapabilitiesResponse) String

type OperatorLifecycleClient

type OperatorLifecycleClient interface {
	// GetCapabilities gets the capabilities of the Lifecycle service
	GetCapabilities(ctx context.Context, in *OperatorLifecycleCapabilitiesRequest, opts ...grpc.CallOption) (*OperatorLifecycleCapabilitiesResponse, error)
	// LifecycleHook allows the plugin to manipulate the Kubernetes resources
	// before the CNPG operator applies them to the Kubernetes cluster.
	LifecycleHook(ctx context.Context, in *OperatorLifecycleRequest, opts ...grpc.CallOption) (*OperatorLifecycleResponse, error)
}

OperatorLifecycleClient is the client API for OperatorLifecycle service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type OperatorLifecycleRequest

type OperatorLifecycleRequest struct {

	// This field is REQUIRED.
	OperationType *OperatorOperationType `protobuf:"bytes,1,opt,name=operation_type,json=operationType,proto3" json:"operation_type,omitempty"`
	// This field is REQUIRED
	ClusterDefinition []byte `protobuf:"bytes,2,opt,name=cluster_definition,json=clusterDefinition,proto3" json:"cluster_definition,omitempty"`
	// This field is REQUIRED.
	ObjectDefinition []byte `protobuf:"bytes,3,opt,name=object_definition,json=objectDefinition,proto3" json:"object_definition,omitempty"`
	// contains filtered or unexported fields
}

func (*OperatorLifecycleRequest) Descriptor deprecated

func (*OperatorLifecycleRequest) Descriptor() ([]byte, []int)

Deprecated: Use OperatorLifecycleRequest.ProtoReflect.Descriptor instead.

func (*OperatorLifecycleRequest) GetClusterDefinition

func (x *OperatorLifecycleRequest) GetClusterDefinition() []byte

func (*OperatorLifecycleRequest) GetObjectDefinition

func (x *OperatorLifecycleRequest) GetObjectDefinition() []byte

func (*OperatorLifecycleRequest) GetOperationType

func (x *OperatorLifecycleRequest) GetOperationType() *OperatorOperationType

func (*OperatorLifecycleRequest) ProtoMessage

func (*OperatorLifecycleRequest) ProtoMessage()

func (*OperatorLifecycleRequest) ProtoReflect

func (x *OperatorLifecycleRequest) ProtoReflect() protoreflect.Message

func (*OperatorLifecycleRequest) Reset

func (x *OperatorLifecycleRequest) Reset()

func (*OperatorLifecycleRequest) String

func (x *OperatorLifecycleRequest) String() string

type OperatorLifecycleResponse

type OperatorLifecycleResponse struct {

	// This field is OPTIONAL.
	JsonPatch []byte `protobuf:"bytes,1,opt,name=json_patch,json=jsonPatch,proto3" json:"json_patch,omitempty"`
	// contains filtered or unexported fields
}

func (*OperatorLifecycleResponse) Descriptor deprecated

func (*OperatorLifecycleResponse) Descriptor() ([]byte, []int)

Deprecated: Use OperatorLifecycleResponse.ProtoReflect.Descriptor instead.

func (*OperatorLifecycleResponse) GetJsonPatch

func (x *OperatorLifecycleResponse) GetJsonPatch() []byte

func (*OperatorLifecycleResponse) ProtoMessage

func (*OperatorLifecycleResponse) ProtoMessage()

func (*OperatorLifecycleResponse) ProtoReflect

func (*OperatorLifecycleResponse) Reset

func (x *OperatorLifecycleResponse) Reset()

func (*OperatorLifecycleResponse) String

func (x *OperatorLifecycleResponse) String() string

type OperatorLifecycleServer

type OperatorLifecycleServer interface {
	// GetCapabilities gets the capabilities of the Lifecycle service
	GetCapabilities(context.Context, *OperatorLifecycleCapabilitiesRequest) (*OperatorLifecycleCapabilitiesResponse, error)
	// LifecycleHook allows the plugin to manipulate the Kubernetes resources
	// before the CNPG operator applies them to the Kubernetes cluster.
	LifecycleHook(context.Context, *OperatorLifecycleRequest) (*OperatorLifecycleResponse, error)
	// contains filtered or unexported methods
}

OperatorLifecycleServer is the server API for OperatorLifecycle service. All implementations must embed UnimplementedOperatorLifecycleServer for forward compatibility.

type OperatorOperationType

type OperatorOperationType struct {
	Type OperatorOperationType_Type `protobuf:"varint,1,opt,name=type,proto3,enum=cnpgi.operator_lifecycle.v1.OperatorOperationType_Type" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*OperatorOperationType) Descriptor deprecated

func (*OperatorOperationType) Descriptor() ([]byte, []int)

Deprecated: Use OperatorOperationType.ProtoReflect.Descriptor instead.

func (*OperatorOperationType) GetType

func (*OperatorOperationType) ProtoMessage

func (*OperatorOperationType) ProtoMessage()

func (*OperatorOperationType) ProtoReflect

func (x *OperatorOperationType) ProtoReflect() protoreflect.Message

func (*OperatorOperationType) Reset

func (x *OperatorOperationType) Reset()

func (*OperatorOperationType) String

func (x *OperatorOperationType) String() string

type OperatorOperationType_Type

type OperatorOperationType_Type int32
const (
	OperatorOperationType_TYPE_UNSPECIFIED OperatorOperationType_Type = 0
	// This is invoked when the operator executes a Patch request on the resource
	OperatorOperationType_TYPE_PATCH OperatorOperationType_Type = 1
	// This is invoked when the operator executes an Update request on the resource
	OperatorOperationType_TYPE_UPDATE OperatorOperationType_Type = 2
	// This is invoked when the operator executes a Create request on the resource
	OperatorOperationType_TYPE_CREATE OperatorOperationType_Type = 3
	// This is invoked when the operator executes a Delete request on the resource
	OperatorOperationType_TYPE_DELETE OperatorOperationType_Type = 4
	// Reserved for future use.
	OperatorOperationType_TYPE_DEREGISTER OperatorOperationType_Type = 5
	// The operator calls this to perform a dry-run evaluation to determine if the plugin
	// would make changes to the resource without actually applying them. This allows for
	// validation and impact assessment before performing actual operations.
	// A positive evaluation (changes that can potentially be applied) triggers calls to the Update, Patch,
	// or Delete verbs.
	// Currently only selected resources have support for this operation type (e.g., pod instances).
	OperatorOperationType_TYPE_EVALUATE OperatorOperationType_Type = 6
)

func (OperatorOperationType_Type) Descriptor

func (OperatorOperationType_Type) Enum

func (OperatorOperationType_Type) EnumDescriptor deprecated

func (OperatorOperationType_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use OperatorOperationType_Type.Descriptor instead.

func (OperatorOperationType_Type) Number

func (OperatorOperationType_Type) String

func (OperatorOperationType_Type) Type

type UnimplementedOperatorLifecycleServer

type UnimplementedOperatorLifecycleServer struct{}

UnimplementedOperatorLifecycleServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedOperatorLifecycleServer) LifecycleHook

type UnsafeOperatorLifecycleServer

type UnsafeOperatorLifecycleServer interface {
	// contains filtered or unexported methods
}

UnsafeOperatorLifecycleServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OperatorLifecycleServer will result in compilation errors.

Jump to

Keyboard shortcuts

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