Show / Hide Table of Contents

Class V1alpha3CELDeviceSelector

CELDeviceSelector contains a CEL expression for selecting a device.

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

Constructors

View Source

V1alpha3CELDeviceSelector()

Declaration
public V1alpha3CELDeviceSelector()
View Source

V1alpha3CELDeviceSelector(V1alpha3CELDeviceSelector)

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

Properties

View Source

EqualityContract

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

Expression

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.

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

Methods

View Source

Equals(object?)

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

Equals(V1alpha3CELDeviceSelector?)

Declaration
public virtual bool Equals(V1alpha3CELDeviceSelector? other)
Parameters
Type Name Description
V1alpha3CELDeviceSelector other
Returns
Type Description
bool
View Source

GetHashCode()

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

PrintMembers(StringBuilder)

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

ToString()

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

Operators

View Source

operator ==(V1alpha3CELDeviceSelector?, V1alpha3CELDeviceSelector?)

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

operator !=(V1alpha3CELDeviceSelector?, V1alpha3CELDeviceSelector?)

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

Implements

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