Show / Hide Table of Contents

Class V1beta2DeviceDerivedAttribute

DeviceDerivedAttribute defines a derived attribute computed via CEL.

Inheritance
object
V1beta2DeviceDerivedAttribute
Implements
IEquatable<V1beta2DeviceDerivedAttribute>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: k8s.Models
Assembly: KubernetesClient.dll
Syntax
public record V1beta2DeviceDerivedAttribute : IEquatable<V1beta2DeviceDerivedAttribute>

Constructors

V1beta2DeviceDerivedAttribute()

Declaration
public V1beta2DeviceDerivedAttribute()

V1beta2DeviceDerivedAttribute(V1beta2DeviceDerivedAttribute)

Declaration
protected V1beta2DeviceDerivedAttribute(V1beta2DeviceDerivedAttribute original)
Parameters
Type Name Description
V1beta2DeviceDerivedAttribute original

Properties

EqualityContract

Declaration
protected virtual Type EqualityContract { get; }
Property Value
Type Description
Type

Expression

Expression is a CEL expression evaluated against each candidate device. The expression must evaluate to a primitive scalar (string, integer, boolean, or semver) or a list of these scalars ([]string, []int64, []bool, []semver) to act as a virtual grouping key. Any other return type is an error and causes CEL evaluation for the device to fail.

The expression's input is an object named "device", which carries the same properties as in a CELDeviceSelector.

When pod scheduling encounters CEL runtime errors (such as looking up an attribute that isn't defined) for some devices, it will abort allocation and fail scheduling for the Pod. Surfacing evaluation errors immediately prevents silent topology matching failures that are extremely hard to detect. A robust expression should, for example, check for the existence of attributes before referencing them to avoid runtime evaluation errors.

The expression gets evaluated after a device has passed the other selector expressions for the request in which this expression is used. This allows writing expressions that are tailored towards the specific devices being requested (for example, by assuming the device is from a certain vendor and skipping those checks).

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; the combined cost of all derived attributes in a claim is capped by a shared CEL cost budget.

Declaration
[JsonPropertyName("expression")]
public string Expression { get; set; }
Property Value
Type Description
string

Name

Name is the identifier for this derived attribute, used in constraints.

It must be a DNS subdomain followed by a slash ("/") followed by a C identifier (e.g. "example.com/numaNode" or "derived/numaNode").

If the chosen name matches an existing physical attribute from a driver, the derived attribute's expression will shadow the physical attribute, and its evaluated value will be used in constraints instead. When the goal is to define a derived attribute that is only used within the ResourceClaim and not meant to shadow an existing attribute, use a domain prefix that no DRA driver should be using (e.g. "derived/myAttribute").

It is not valid to define a derived attribute that isn't used in at least one constraint.

Declaration
[JsonPropertyName("name")]
public string Name { get; set; }
Property Value
Type Description
string

Methods

Equals(object?)

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool
Overrides
object.Equals(object)

Equals(V1beta2DeviceDerivedAttribute?)

Declaration
public virtual bool Equals(V1beta2DeviceDerivedAttribute? other)
Parameters
Type Name Description
V1beta2DeviceDerivedAttribute other
Returns
Type Description
bool

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
object.GetHashCode()

PrintMembers(StringBuilder)

Declaration
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
Type Name Description
StringBuilder builder
Returns
Type Description
bool

ToString()

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()

Operators

operator ==(V1beta2DeviceDerivedAttribute?, V1beta2DeviceDerivedAttribute?)

Declaration
public static bool operator ==(V1beta2DeviceDerivedAttribute? left, V1beta2DeviceDerivedAttribute? right)
Parameters
Type Name Description
V1beta2DeviceDerivedAttribute left
V1beta2DeviceDerivedAttribute right
Returns
Type Description
bool

operator !=(V1beta2DeviceDerivedAttribute?, V1beta2DeviceDerivedAttribute?)

Declaration
public static bool operator !=(V1beta2DeviceDerivedAttribute? left, V1beta2DeviceDerivedAttribute? right)
Parameters
Type Name Description
V1beta2DeviceDerivedAttribute left
V1beta2DeviceDerivedAttribute right
Returns
Type Description
bool

Implements

IEquatable<T>
In this article
Back to top Generated by DocFX