v1alpha1

package
v0.0.0-...-8ffad75 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API.

Package v1alpha1 contains API Schema definitions for the common v1alpha1 API group +groupName=common.spheric.cloud

Index

Constants

View Source
const (
	// WatchLabel is a label that can be applied to any spheric resource.
	//
	// Provider controllers that allow for selective reconciliation may check this label and proceed
	// with reconciliation of the object only if this label and a configured value are present.
	WatchLabel = "common.spheric.cloud/watch-filter"

	// ReconcileRequestAnnotation is an annotation that requested a reconciliation at a specific time.
	ReconcileRequestAnnotation = "reconcile.common.spheric.cloud/requested-at"

	// ManagedByAnnotation is an annotation that can be applied to resources to signify that
	// some external system is managing the resource.
	ManagedByAnnotation = "common.spheric.cloud/managed-by"

	// EphemeralManagedByAnnotation is an annotation that can be applied to resources to signify that
	// some ephemeral controller is managing the resource.
	EphemeralManagedByAnnotation = "common.spheric.cloud/ephemeral-managed-by"

	// DefaultEphemeralManager is the default spheric ephemeral manager.
	DefaultEphemeralManager = "ephemeral-manager"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "common.spheric.cloud", Version: "v1alpha1"}
)

Functions

func EqualIPPrefixes

func EqualIPPrefixes(a, b IPPrefix) bool

func EqualIPRanges

func EqualIPRanges(a, b IPRange) bool

func EqualIPs

func EqualIPs(a, b IP) bool

func Resource

func Resource(resource string) schema.GroupResource

func TolerateTaints

func TolerateTaints(tolerations []Toleration, taints []Taint) bool

TolerateTaints returns if tolerations tolerate all taints

Types

type ConfigMapKeySelector

type ConfigMapKeySelector struct {
	// Name of the referent.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
	Name string `json:"name,omitempty"`
	// The key of the entry in the ConfigMap resource's `data` field to be used.
	// Some instances of this field may be defaulted, in others it may be
	// required.
	// +optional
	Key string `json:"key,omitempty"`
}

ConfigMapKeySelector is a reference to a specific 'key' within a ConfigMap resource. In some instances, `key` is a required field. +structType=atomic

func (*ConfigMapKeySelector) DeepCopy

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

func (*ConfigMapKeySelector) DeepCopyInto

func (in *ConfigMapKeySelector) DeepCopyInto(out *ConfigMapKeySelector)

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

type IP

type IP struct {
	netip.Addr `json:"-"`
}

IP is an IP address.

func MustParseIP

func MustParseIP(s string) IP

func MustParseIPs

func MustParseIPs(s ...string) []IP

func MustParseNewIP

func MustParseNewIP(s string) *IP

func NewIP

func NewIP(ip netip.Addr) IP

func NewIPPtr

func NewIPPtr(ip netip.Addr) *IP

func ParseIP

func ParseIP(s string) (IP, error)

func ParseIPs

func ParseIPs(s ...string) ([]IP, error)

func ParseNewIP

func ParseNewIP(s string) (*IP, error)

func PtrToIP

func PtrToIP(addr IP) *IP

func (*IP) DeepCopy

func (in *IP) DeepCopy() *IP

func (*IP) DeepCopyInto

func (in *IP) DeepCopyInto(out *IP)

func (IP) Family

func (i IP) Family() corev1.IPFamily

func (IP) GomegaString

func (i IP) GomegaString() string

func (*IP) IsValid

func (i *IP) IsValid() bool

func (*IP) IsZero

func (i *IP) IsZero() bool

func (IP) MarshalJSON

func (i IP) MarshalJSON() ([]byte, error)

func (IP) OpenAPISchemaFormat

func (_ IP) OpenAPISchemaFormat() string

func (IP) OpenAPISchemaType

func (_ IP) OpenAPISchemaType() []string

func (IP) ToUnstructured

func (i IP) ToUnstructured() interface{}

func (*IP) UnmarshalJSON

func (i *IP) UnmarshalJSON(b []byte) error

type IPPrefix

type IPPrefix struct {
	netip.Prefix `json:"-"`
}

IPPrefix represents a network prefix. +nullable

func MustParseIPPrefix

func MustParseIPPrefix(s string) IPPrefix

func MustParseNewIPPrefix

func MustParseNewIPPrefix(s string) *IPPrefix

func NewIPPrefix

func NewIPPrefix(prefix netip.Prefix) *IPPrefix

func ParseIPPrefix

func ParseIPPrefix(s string) (IPPrefix, error)

func ParseNewIPPrefix

func ParseNewIPPrefix(s string) (*IPPrefix, error)

func PtrToIPPrefix

func PtrToIPPrefix(prefix IPPrefix) *IPPrefix

func (*IPPrefix) DeepCopy

func (in *IPPrefix) DeepCopy() *IPPrefix

func (*IPPrefix) DeepCopyInto

func (in *IPPrefix) DeepCopyInto(out *IPPrefix)

func (IPPrefix) GomegaString

func (i IPPrefix) GomegaString() string

func (IPPrefix) IP

func (i IPPrefix) IP() IP

func (*IPPrefix) IsValid

func (in *IPPrefix) IsValid() bool

func (*IPPrefix) IsZero

func (in *IPPrefix) IsZero() bool

func (IPPrefix) MarshalJSON

func (i IPPrefix) MarshalJSON() ([]byte, error)

func (IPPrefix) OpenAPISchemaFormat

func (_ IPPrefix) OpenAPISchemaFormat() string

func (IPPrefix) OpenAPISchemaType

func (_ IPPrefix) OpenAPISchemaType() []string

func (IPPrefix) ToUnstructured

func (i IPPrefix) ToUnstructured() interface{}

func (*IPPrefix) UnmarshalJSON

func (i *IPPrefix) UnmarshalJSON(b []byte) error

type IPRange

type IPRange struct {
	From IP `json:"from"`
	To   IP `json:"to"`
}

IPRange is an IP range.

func IPRangeFrom

func IPRangeFrom(from IP, to IP) IPRange

func MustParseIPRange

func MustParseIPRange(s string) IPRange

func MustParseNewIPRange

func MustParseNewIPRange(s string) *IPRange

func NewIPRange

func NewIPRange(ipRange netipx.IPRange) IPRange

func NewIPRangePtr

func NewIPRangePtr(ipRange netipx.IPRange) *IPRange

func ParseIPRange

func ParseIPRange(s string) (IPRange, error)

func ParseNewIPRange

func ParseNewIPRange(s string) (*IPRange, error)

func PtrToIPRange

func PtrToIPRange(ipRange IPRange) *IPRange

func (*IPRange) DeepCopy

func (in *IPRange) DeepCopy() *IPRange

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

func (*IPRange) DeepCopyInto

func (in *IPRange) DeepCopyInto(out *IPRange)

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

func (IPRange) GomegaString

func (i IPRange) GomegaString() string

func (*IPRange) IsValid

func (i *IPRange) IsValid() bool

func (*IPRange) IsZero

func (i *IPRange) IsZero() bool

func (*IPRange) Range

func (i *IPRange) Range() netipx.IPRange

func (IPRange) String

func (i IPRange) String() string

type LocalUIDReference

type LocalUIDReference struct {
	// Name is the name of the referenced entity.
	Name string `json:"name"`
	// UID is the UID of the referenced entity.
	UID types.UID `json:"uid"`
}

LocalUIDReference is a reference to another entity including its UID +structType=atomic

func LocalObjUIDRef

func LocalObjUIDRef(obj metav1.Object) LocalUIDReference

func NewLocalObjUIDRef

func NewLocalObjUIDRef(obj metav1.Object) *LocalUIDReference

func (*LocalUIDReference) DeepCopy

func (in *LocalUIDReference) DeepCopy() *LocalUIDReference

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

func (*LocalUIDReference) DeepCopyInto

func (in *LocalUIDReference) DeepCopyInto(out *LocalUIDReference)

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

type SecretKeySelector

type SecretKeySelector struct {
	// Name of the referent.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
	Name string `json:"name,omitempty"`
	// The key of the entry in the Secret resource's `data` field to be used.
	// Some instances of this field may be defaulted, in others it may be
	// required.
	// +optional
	Key string `json:"key,omitempty"`
}

SecretKeySelector is a reference to a specific 'key' within a Secret resource. In some instances, `key` is a required field. +structType=atomic

func (*SecretKeySelector) DeepCopy

func (in *SecretKeySelector) DeepCopy() *SecretKeySelector

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

func (*SecretKeySelector) DeepCopyInto

func (in *SecretKeySelector) DeepCopyInto(out *SecretKeySelector)

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

type Taint

type Taint struct {
	// The taint key to be applied to a resource pool.
	Key string `json:"key"`
	// The taint value corresponding to the taint key.
	Value string `json:"value,omitempty"`
	// The effect of the taint on resources
	// that do not tolerate the taint.
	// Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
	Effect TaintEffect `json:"effect"`
}

The resource pool this Taint is attached to has the "effect" on any resource that does not tolerate the Taint.

func (*Taint) DeepCopy

func (in *Taint) DeepCopy() *Taint

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

func (*Taint) DeepCopyInto

func (in *Taint) DeepCopyInto(out *Taint)

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

type TaintEffect

type TaintEffect string
const (
	// Do not allow new resources to schedule onto the resource pool unless they tolerate the taint,
	// but allow all already-running resources to continue running.
	// Enforced by the scheduler.
	TaintEffectNoSchedule TaintEffect = "NoSchedule"
)

type Toleration

type Toleration struct {
	// Key is the taint key that the toleration applies to. Empty means match all taint keys.
	// If the key is empty, operator must be Exists; this combination means to match all values and all keys.
	Key string `json:"key,omitempty"`
	// Operator represents a key's relationship to the value.
	// Valid operators are Exists and Equal. Defaults to Equal.
	// Exists is equivalent to wildcard for value, so that a resource can
	// tolerate all taints of a particular category.
	Operator TolerationOperator `json:"operator,omitempty"`
	// Value is the taint value the toleration matches to.
	// If the operator is Exists, the value should be empty, otherwise just a regular string.
	Value string `json:"value,omitempty"`
	// Effect indicates the taint effect to match. Empty means match all taint effects.
	// When specified, allowed values are NoSchedule.
	Effect TaintEffect `json:"effect,omitempty"`
}

The resource this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.

func (*Toleration) DeepCopy

func (in *Toleration) DeepCopy() *Toleration

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

func (*Toleration) DeepCopyInto

func (in *Toleration) DeepCopyInto(out *Toleration)

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

func (*Toleration) ToleratesTaint

func (t *Toleration) ToleratesTaint(taint *Taint) bool

From https://pkg.go.dev/k8s.io/api/core/v1#Toleration.ToleratesTaint with our own Toleration and Taint ToleratesTaint checks if the toleration tolerates the taint. The matching follows the rules below: (1) Empty toleration.effect means to match all taint effects,

otherwise taint effect must equal to toleration.effect.

(2) If toleration.operator is 'Exists', it means to match all taint values. (3) Empty toleration.key means to match all taint keys.

If toleration.key is empty, toleration.operator must be 'Exists';
this combination means to match all taint values and all taint keys.

type TolerationOperator

type TolerationOperator string

A toleration operator is the set of operators that can be used in a toleration.

const (
	TolerationOpEqual  TolerationOperator = "Equal"
	TolerationOpExists TolerationOperator = "Exists"
)

type UIDReference

type UIDReference struct {
	// Namespace is the namespace of the referenced entity. If empty,
	// the same namespace as the referring resource is implied.
	Namespace string `json:"namespace,omitempty"`
	// Name is the name of the referenced entity.
	Name string `json:"name"`
	// UID is the UID of the referenced entity.
	UID types.UID `json:"uid,omitempty"`
}

UIDReference is a reference to another entity in a potentially different namespace including its UID. +structType=atomic

func (*UIDReference) DeepCopy

func (in *UIDReference) DeepCopy() *UIDReference

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

func (*UIDReference) DeepCopyInto

func (in *UIDReference) DeepCopyInto(out *UIDReference)

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