package v1alpha3

import "k8s.io/client-go/applyconfigurations/resource/v1alpha3"

Index

Types

type CELDeviceSelectorApplyConfiguration

type CELDeviceSelectorApplyConfiguration struct {
	// Expression is a CEL expression which evaluates a single device. It
	// must evaluate to true when the device under consideration satisfies
	// the desired criteria, and false when it does not. Any other result
	// is an error and causes allocation of devices to abort.
	//
	// The expression's input is an object named "device", which carries
	// the following properties:
	// - driver (string): the name of the driver which defines this device.
	// - attributes (map[string]object): the device's attributes, grouped by prefix
	// (e.g. device.attributes["dra.example.com"] evaluates to an object with all
	// of the attributes which were prefixed by "dra.example.com".
	// - capacity (map[string]object): the device's capacities, grouped by prefix.
	//
	// Example: Consider a device with driver="dra.example.com", which exposes
	// two attributes named "model" and "ext.example.com/family" and which
	// exposes one capacity named "modules". This input to this expression
	// would have the following fields:
	//
	// device.driver
	// device.attributes["dra.example.com"].model
	// device.attributes["ext.example.com"].family
	// device.capacity["dra.example.com"].modules
	//
	// The device.driver field can be used to check for a specific driver,
	// either as a high-level precondition (i.e. you only want to consider
	// devices from this driver) or as part of a multi-clause expression
	// that is meant to consider devices from different drivers.
	//
	// The value type of each attribute is defined by the device
	// definition, and users who write these expressions must consult the
	// documentation for their specific drivers. The value type of each
	// capacity is Quantity.
	//
	// If an unknown prefix is used as a lookup in either device.attributes
	// or device.capacity, an empty map will be returned. Any reference to
	// an unknown field will cause an evaluation error and allocation to
	// abort.
	//
	// A robust expression should check for the existence of attributes
	// before referencing them.
	//
	// For ease of use, the cel.bind() function is enabled, and can be used
	// to simplify expressions that access multiple attributes with the
	// same domain. For example:
	//
	// cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool)
	//
	// The length of the expression must be smaller or equal to 10 Ki. The
	// cost of evaluating it is also limited based on the estimated number
	// of logical steps.
	Expression *string `json:"expression,omitempty"`
}

CELDeviceSelectorApplyConfiguration represents a declarative configuration of the CELDeviceSelector type for use with apply.

CELDeviceSelector contains a CEL expression for selecting a device.

func CELDeviceSelector

func CELDeviceSelector() *CELDeviceSelectorApplyConfiguration

CELDeviceSelectorApplyConfiguration constructs a declarative configuration of the CELDeviceSelector type for use with apply.

func (*CELDeviceSelectorApplyConfiguration) WithExpression

WithExpression sets the Expression field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Expression field is set to the value of the last call.

type DeviceSelectorApplyConfiguration

type DeviceSelectorApplyConfiguration struct {
	// CEL contains a CEL expression for selecting a device.
	CEL *CELDeviceSelectorApplyConfiguration `json:"cel,omitempty"`
}

DeviceSelectorApplyConfiguration represents a declarative configuration of the DeviceSelector type for use with apply.

DeviceSelector must have exactly one field set.

func DeviceSelector

func DeviceSelector() *DeviceSelectorApplyConfiguration

DeviceSelectorApplyConfiguration constructs a declarative configuration of the DeviceSelector type for use with apply.

func (*DeviceSelectorApplyConfiguration) WithCEL

WithCEL sets the CEL field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the CEL field is set to the value of the last call.

type DeviceTaintApplyConfiguration

type DeviceTaintApplyConfiguration struct {
	// The taint key to be applied to a device.
	// Must be a label name.
	Key *string `json:"key,omitempty"`
	// The taint value corresponding to the taint key.
	// Must be a label value.
	Value *string `json:"value,omitempty"`
	// The effect of the taint on claims that do not tolerate the taint
	// and through such claims on the pods using them.
	// Valid effects are NoSchedule and NoExecute. PreferNoSchedule as used for
	// nodes is not valid here.
	Effect *resourcev1alpha3.DeviceTaintEffect `json:"effect,omitempty"`
	// TimeAdded represents the time at which the taint was added.
	// Added automatically during create or update if not set.
	TimeAdded *v1.Time `json:"timeAdded,omitempty"`
}

DeviceTaintApplyConfiguration represents a declarative configuration of the DeviceTaint type for use with apply.

The device this taint is attached to has the "effect" on any claim which does not tolerate the taint and, through the claim, to pods using the claim.

func DeviceTaint

func DeviceTaint() *DeviceTaintApplyConfiguration

DeviceTaintApplyConfiguration constructs a declarative configuration of the DeviceTaint type for use with apply.

func (*DeviceTaintApplyConfiguration) WithEffect

WithEffect sets the Effect field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Effect field is set to the value of the last call.

func (*DeviceTaintApplyConfiguration) WithKey

WithKey sets the Key field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Key field is set to the value of the last call.

func (*DeviceTaintApplyConfiguration) WithTimeAdded

WithTimeAdded sets the TimeAdded field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the TimeAdded field is set to the value of the last call.

func (*DeviceTaintApplyConfiguration) WithValue

WithValue sets the Value field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Value field is set to the value of the last call.

type DeviceTaintRuleApplyConfiguration

type DeviceTaintRuleApplyConfiguration struct {
	v1.TypeMetaApplyConfiguration `json:",inline"`
	// Standard object metadata
	*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
	// Spec specifies the selector and one taint.
	//
	// Changing the spec automatically increments the metadata.generation number.
	Spec *DeviceTaintRuleSpecApplyConfiguration `json:"spec,omitempty"`
}

DeviceTaintRuleApplyConfiguration represents a declarative configuration of the DeviceTaintRule type for use with apply.

DeviceTaintRule adds one taint to all devices which match the selector. This has the same effect as if the taint was specified directly in the ResourceSlice by the DRA driver.

func DeviceTaintRule

func DeviceTaintRule(name string) *DeviceTaintRuleApplyConfiguration

DeviceTaintRule constructs a declarative configuration of the DeviceTaintRule type for use with apply.

func ExtractDeviceTaintRule

func ExtractDeviceTaintRule(deviceTaintRule *resourcev1alpha3.DeviceTaintRule, fieldManager string) (*DeviceTaintRuleApplyConfiguration, error)

ExtractDeviceTaintRule extracts the applied configuration owned by fieldManager from deviceTaintRule. If no managedFields are found in deviceTaintRule for fieldManager, a DeviceTaintRuleApplyConfiguration is returned with only the Name, Namespace (if applicable), APIVersion and Kind populated. It is possible that no managed fields were found for because other field managers have taken ownership of all the fields previously owned by fieldManager, or because the fieldManager never owned fields any fields. deviceTaintRule must be a unmodified DeviceTaintRule API object that was retrieved from the Kubernetes API. ExtractDeviceTaintRule provides a way to perform a extract/modify-in-place/apply workflow. Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously applied if another fieldManager has updated or force applied any of the previously applied fields.

func ExtractDeviceTaintRuleFrom

func ExtractDeviceTaintRuleFrom(deviceTaintRule *resourcev1alpha3.DeviceTaintRule, fieldManager string, subresource string) (*DeviceTaintRuleApplyConfiguration, error)

ExtractDeviceTaintRuleFrom extracts the applied configuration owned by fieldManager from deviceTaintRule for the specified subresource. Pass an empty string for subresource to extract the main resource. Common subresources include "status", "scale", etc. deviceTaintRule must be a unmodified DeviceTaintRule API object that was retrieved from the Kubernetes API. ExtractDeviceTaintRuleFrom provides a way to perform a extract/modify-in-place/apply workflow. Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously applied if another fieldManager has updated or force applied any of the previously applied fields.

func (*DeviceTaintRuleApplyConfiguration) GetAPIVersion

func (b *DeviceTaintRuleApplyConfiguration) GetAPIVersion() *string

GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.

func (*DeviceTaintRuleApplyConfiguration) GetKind

GetKind retrieves the value of the Kind field in the declarative configuration.

func (*DeviceTaintRuleApplyConfiguration) GetName

GetName retrieves the value of the Name field in the declarative configuration.

func (*DeviceTaintRuleApplyConfiguration) GetNamespace

func (b *DeviceTaintRuleApplyConfiguration) GetNamespace() *string

GetNamespace retrieves the value of the Namespace field in the declarative configuration.

func (DeviceTaintRuleApplyConfiguration) IsApplyConfiguration

func (b DeviceTaintRuleApplyConfiguration) IsApplyConfiguration()

func (*DeviceTaintRuleApplyConfiguration) WithAPIVersion

WithAPIVersion sets the APIVersion field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the APIVersion field is set to the value of the last call.

func (*DeviceTaintRuleApplyConfiguration) WithAnnotations

WithAnnotations puts the entries into the Annotations field in the declarative configuration and returns the receiver, so that objects can be build by chaining "With" function invocations. If called multiple times, the entries provided by each call will be put on the Annotations field, overwriting an existing map entries in Annotations field with the same key.

func (*DeviceTaintRuleApplyConfiguration) WithCreationTimestamp

WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the CreationTimestamp field is set to the value of the last call.

func (*DeviceTaintRuleApplyConfiguration) WithDeletionGracePeriodSeconds

func (b *DeviceTaintRuleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeviceTaintRuleApplyConfiguration

WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.

func (*DeviceTaintRuleApplyConfiguration) WithDeletionTimestamp

WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the DeletionTimestamp field is set to the value of the last call.

func (*DeviceTaintRuleApplyConfiguration) WithFinalizers

WithFinalizers adds the given value to the Finalizers field in the declarative configuration and returns the receiver, so that objects can be build by chaining "With" function invocations. If called multiple times, values provided by each call will be appended to the Finalizers field.

func (*DeviceTaintRuleApplyConfiguration) WithGenerateName

WithGenerateName sets the GenerateName field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the GenerateName field is set to the value of the last call.

func (*DeviceTaintRuleApplyConfiguration) WithGeneration

WithGeneration sets the Generation field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Generation field is set to the value of the last call.

func (*DeviceTaintRuleApplyConfiguration) WithKind

WithKind sets the Kind field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Kind field is set to the value of the last call.

func (*DeviceTaintRuleApplyConfiguration) WithLabels

WithLabels puts the entries into the Labels field in the declarative configuration and returns the receiver, so that objects can be build by chaining "With" function invocations. If called multiple times, the entries provided by each call will be put on the Labels field, overwriting an existing map entries in Labels field with the same key.

func (*DeviceTaintRuleApplyConfiguration) WithName

WithName sets the Name field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Name field is set to the value of the last call.

func (*DeviceTaintRuleApplyConfiguration) WithNamespace

WithNamespace sets the Namespace field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Namespace field is set to the value of the last call.

func (*DeviceTaintRuleApplyConfiguration) WithOwnerReferences

WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration and returns the receiver, so that objects can be build by chaining "With" function invocations. If called multiple times, values provided by each call will be appended to the OwnerReferences field.

func (*DeviceTaintRuleApplyConfiguration) WithResourceVersion

WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the ResourceVersion field is set to the value of the last call.

func (*DeviceTaintRuleApplyConfiguration) WithSpec

WithSpec sets the Spec field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Spec field is set to the value of the last call.

func (*DeviceTaintRuleApplyConfiguration) WithUID

WithUID sets the UID field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the UID field is set to the value of the last call.

type DeviceTaintRuleSpecApplyConfiguration

type DeviceTaintRuleSpecApplyConfiguration struct {
	// DeviceSelector defines which device(s) the taint is applied to.
	// All selector criteria must be satified for a device to
	// match. The empty selector matches all devices. Without
	// a selector, no devices are matches.
	DeviceSelector *DeviceTaintSelectorApplyConfiguration `json:"deviceSelector,omitempty"`
	// The taint that gets applied to matching devices.
	Taint *DeviceTaintApplyConfiguration `json:"taint,omitempty"`
}

DeviceTaintRuleSpecApplyConfiguration represents a declarative configuration of the DeviceTaintRuleSpec type for use with apply.

DeviceTaintRuleSpec specifies the selector and one taint.

func DeviceTaintRuleSpec

func DeviceTaintRuleSpec() *DeviceTaintRuleSpecApplyConfiguration

DeviceTaintRuleSpecApplyConfiguration constructs a declarative configuration of the DeviceTaintRuleSpec type for use with apply.

func (*DeviceTaintRuleSpecApplyConfiguration) WithDeviceSelector

WithDeviceSelector sets the DeviceSelector field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the DeviceSelector field is set to the value of the last call.

func (*DeviceTaintRuleSpecApplyConfiguration) WithTaint

WithTaint sets the Taint field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Taint field is set to the value of the last call.

type DeviceTaintSelectorApplyConfiguration

type DeviceTaintSelectorApplyConfiguration struct {
	// If DeviceClassName is set, the selectors defined there must be
	// satisfied by a device to be selected. This field corresponds
	// to class.metadata.name.
	DeviceClassName *string `json:"deviceClassName,omitempty"`
	// If driver is set, only devices from that driver are selected.
	// This fields corresponds to slice.spec.driver.
	Driver *string `json:"driver,omitempty"`
	// If pool is set, only devices in that pool are selected.
	//
	// Also setting the driver name may be useful to avoid
	// ambiguity when different drivers use the same pool name,
	// but this is not required because selecting pools from
	// different drivers may also be useful, for example when
	// drivers with node-local devices use the node name as
	// their pool name.
	Pool *string `json:"pool,omitempty"`
	// If device is set, only devices with that name are selected.
	// This field corresponds to slice.spec.devices[].name.
	//
	// Setting also driver and pool may be required to avoid ambiguity,
	// but is not required.
	Device *string `json:"device,omitempty"`
	// Selectors contains the same selection criteria as a ResourceClaim.
	// Currently, CEL expressions are supported. All of these selectors
	// must be satisfied.
	Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"`
}

DeviceTaintSelectorApplyConfiguration represents a declarative configuration of the DeviceTaintSelector type for use with apply.

DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to. The empty selector matches all devices. Without a selector, no devices are matched.

func DeviceTaintSelector

func DeviceTaintSelector() *DeviceTaintSelectorApplyConfiguration

DeviceTaintSelectorApplyConfiguration constructs a declarative configuration of the DeviceTaintSelector type for use with apply.

func (*DeviceTaintSelectorApplyConfiguration) WithDevice

WithDevice sets the Device field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Device field is set to the value of the last call.

func (*DeviceTaintSelectorApplyConfiguration) WithDeviceClassName

WithDeviceClassName sets the DeviceClassName field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the DeviceClassName field is set to the value of the last call.

func (*DeviceTaintSelectorApplyConfiguration) WithDriver

WithDriver sets the Driver field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Driver field is set to the value of the last call.

func (*DeviceTaintSelectorApplyConfiguration) WithPool

WithPool sets the Pool field in the declarative configuration to the given value and returns the receiver, so that objects can be built by chaining "With" function invocations. If called multiple times, the Pool field is set to the value of the last call.

func (*DeviceTaintSelectorApplyConfiguration) WithSelectors

WithSelectors adds the given value to the Selectors field in the declarative configuration and returns the receiver, so that objects can be build by chaining "With" function invocations. If called multiple times, values provided by each call will be appended to the Selectors field.

Source Files

celdeviceselector.go deviceselector.go devicetaint.go devicetaintrule.go devicetaintrulespec.go devicetaintselector.go

Version
v0.35.0-alpha.1
Published
Oct 8, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
5 minutes ago

Tools for package owners.