v1alpha1

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 7

Documentation

Overview

Package v1alpha1 contains the v1alpha1 implementation of ExtensionConfig.

Index

Constants

View Source
const (
	// RuntimeExtensionDiscoveredCondition is a condition set on an ExtensionConfig object once it has been discovered by the Runtime SDK client.
	RuntimeExtensionDiscoveredCondition clusterv1.ConditionType = "Discovered"

	// DiscoveryFailedReason documents failure of a Discovery call.
	DiscoveryFailedReason string = "DiscoveryFailed"

	// InjectCAFromSecretAnnotation is the annotation that specifies that an ExtensionConfig
	// object wants injection of CAs. The value is a reference to a Secret
	// as <namespace>/<name>.
	InjectCAFromSecretAnnotation string = "runtime.cluster.x-k8s.io/inject-ca-from-secret"

	// PendingHooksAnnotation is the annotation used to keep track of pending runtime hooks.
	// The annotation will be used to track the intent to call a hook as soon as an operation completes;
	// the intent will be removed as soon as the hook call completes successfully.
	PendingHooksAnnotation string = "runtime.cluster.x-k8s.io/pending-hooks"

	// OkToDeleteAnnotation is the annotation used to indicate if a cluster is ready to be fully deleted.
	// This annotation is added to the cluster after the BeforeClusterDelete hook has passed.
	OkToDeleteAnnotation string = "runtime.cluster.x-k8s.io/ok-to-delete"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "runtime.cluster.x-k8s.io", Version: "v1alpha1"}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = schemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	// url gives the location of the Extension server, in standard URL form
	// (`scheme://host:port/path`).
	// Note: Exactly one of `url` or `service` must be specified.
	//
	// The scheme must be "https".
	//
	// The `host` should not refer to a service running in the cluster; use
	// the `service` field instead.
	//
	// A path is optional, and if present may be any string permissible in
	// a URL. If a path is set it will be used as prefix to the hook-specific path.
	//
	// Attempting to use a user or basic auth e.g. "user:password@" is not
	// allowed. Fragments ("#...") and query parameters ("?...") are not
	// allowed either.
	//
	// +optional
	URL *string `json:"url,omitempty"`

	// service is a reference to the Kubernetes service for the Extension server.
	// Note: Exactly one of `url` or `service` must be specified.
	//
	// If the Extension server is running within a cluster, then you should use `service`.
	//
	// +optional
	Service *ServiceReference `json:"service,omitempty"`

	// caBundle is a PEM encoded CA bundle which will be used to validate the Extension server's server certificate.
	// +optional
	CABundle []byte `json:"caBundle,omitempty"`
}

ClientConfig contains the information to make a client connection with an Extension server.

func (*ClientConfig) DeepCopy

func (in *ClientConfig) DeepCopy() *ClientConfig

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

func (*ClientConfig) DeepCopyInto

func (in *ClientConfig) DeepCopyInto(out *ClientConfig)

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

type ExtensionConfig

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

	// ExtensionConfigSpec is the desired state of the ExtensionConfig
	Spec ExtensionConfigSpec `json:"spec,omitempty"`

	// ExtensionConfigStatus is the current state of the ExtensionConfig
	Status ExtensionConfigStatus `json:"status,omitempty"`
}

ExtensionConfig is the Schema for the ExtensionConfig API.

func (*ExtensionConfig) DeepCopy

func (in *ExtensionConfig) DeepCopy() *ExtensionConfig

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

func (*ExtensionConfig) DeepCopyInto

func (in *ExtensionConfig) DeepCopyInto(out *ExtensionConfig)

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

func (*ExtensionConfig) DeepCopyObject

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

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

func (*ExtensionConfig) GetConditions

func (e *ExtensionConfig) GetConditions() clusterv1.Conditions

GetConditions returns the set of conditions for this object.

func (*ExtensionConfig) SetConditions

func (e *ExtensionConfig) SetConditions(conditions clusterv1.Conditions)

SetConditions sets the conditions on this object.

type ExtensionConfigList

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

ExtensionConfigList contains a list of ExtensionConfig.

func (*ExtensionConfigList) DeepCopy

func (in *ExtensionConfigList) DeepCopy() *ExtensionConfigList

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

func (*ExtensionConfigList) DeepCopyInto

func (in *ExtensionConfigList) DeepCopyInto(out *ExtensionConfigList)

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

func (*ExtensionConfigList) DeepCopyObject

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

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

type ExtensionConfigSpec

type ExtensionConfigSpec struct {
	// clientConfig defines how to communicate with the Extension server.
	ClientConfig ClientConfig `json:"clientConfig"`

	// namespaceSelector decides whether to call the hook for an object based
	// on whether the namespace for that object matches the selector.
	// Defaults to the empty LabelSelector, which matches all objects.
	// +optional
	NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`

	// settings defines key value pairs to be passed to all calls
	// to all supported RuntimeExtensions.
	// Note: Settings can be overridden on the ClusterClass.
	// +optional
	Settings map[string]string `json:"settings,omitempty"`
}

ExtensionConfigSpec defines the desired state of ExtensionConfig.

func (*ExtensionConfigSpec) DeepCopy

func (in *ExtensionConfigSpec) DeepCopy() *ExtensionConfigSpec

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

func (*ExtensionConfigSpec) DeepCopyInto

func (in *ExtensionConfigSpec) DeepCopyInto(out *ExtensionConfigSpec)

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

type ExtensionConfigStatus

type ExtensionConfigStatus struct {
	// handlers defines the current ExtensionHandlers supported by an Extension.
	// +optional
	// +listType=map
	// +listMapKey=name
	Handlers []ExtensionHandler `json:"handlers,omitempty"`

	// conditions define the current service state of the ExtensionConfig.
	// +optional
	Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}

ExtensionConfigStatus defines the observed state of ExtensionConfig.

func (*ExtensionConfigStatus) DeepCopy

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

func (*ExtensionConfigStatus) DeepCopyInto

func (in *ExtensionConfigStatus) DeepCopyInto(out *ExtensionConfigStatus)

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

type ExtensionHandler

type ExtensionHandler struct {
	// name is the unique name of the ExtensionHandler.
	Name string `json:"name"`

	// requestHook defines the versioned runtime hook which this ExtensionHandler serves.
	RequestHook GroupVersionHook `json:"requestHook"`

	// timeoutSeconds defines the timeout duration for client calls to the ExtensionHandler.
	// Defaults to 10 is not set.
	// +optional
	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`

	// failurePolicy defines how failures in calls to the ExtensionHandler should be handled by a client.
	// Defaults to Fail if not set.
	// +optional
	FailurePolicy *FailurePolicy `json:"failurePolicy,omitempty"`
}

ExtensionHandler specifies the details of a handler for a particular runtime hook registered by an Extension server.

func (*ExtensionHandler) DeepCopy

func (in *ExtensionHandler) DeepCopy() *ExtensionHandler

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

func (*ExtensionHandler) DeepCopyInto

func (in *ExtensionHandler) DeepCopyInto(out *ExtensionHandler)

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

type FailurePolicy

type FailurePolicy string

FailurePolicy specifies how unrecognized errors when calling the ExtensionHandler are handled. FailurePolicy helps with extensions not working consistently, e.g. due to an intermittent network issue. The following type of errors are never ignored by FailurePolicy Ignore: - Misconfigurations (e.g. incompatible types) - Extension explicitly returns a Status Failure.

const (
	// FailurePolicyIgnore means that an error when calling the extension is ignored.
	FailurePolicyIgnore FailurePolicy = "Ignore"

	// FailurePolicyFail means that an error when calling the extension is propagated as an error.
	FailurePolicyFail FailurePolicy = "Fail"
)

type GroupVersionHook

type GroupVersionHook struct {
	// apiVersion is the group and version of the Hook.
	APIVersion string `json:"apiVersion"`

	// hook is the name of the hook.
	Hook string `json:"hook"`
}

GroupVersionHook defines the runtime hook when the ExtensionHandler is called.

func (*GroupVersionHook) DeepCopy

func (in *GroupVersionHook) DeepCopy() *GroupVersionHook

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

func (*GroupVersionHook) DeepCopyInto

func (in *GroupVersionHook) DeepCopyInto(out *GroupVersionHook)

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

type ServiceReference

type ServiceReference struct {
	// namespace is the namespace of the service.
	Namespace string `json:"namespace"`

	// name is the name of the service.
	Name string `json:"name"`

	// path is an optional URL path and if present may be any string permissible in
	// a URL. If a path is set it will be used as prefix to the hook-specific path.
	// +optional
	Path *string `json:"path,omitempty"`

	// port is the port on the service that's hosting the Extension server.
	// Defaults to 443.
	// Port should be a valid port number (1-65535, inclusive).
	// +optional
	Port *int32 `json:"port,omitempty"`
}

ServiceReference holds a reference to a Kubernetes Service of an Extension server.

func (*ServiceReference) DeepCopy

func (in *ServiceReference) DeepCopy() *ServiceReference

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

func (*ServiceReference) DeepCopyInto

func (in *ServiceReference) DeepCopyInto(out *ServiceReference)

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