diff --git a/applyconfigurations/resource/v1/celdeviceselector.go b/applyconfigurations/resource/v1/celdeviceselector.go index 15ec20da4..d5ca19905 100644 --- a/applyconfigurations/resource/v1/celdeviceselector.go +++ b/applyconfigurations/resource/v1/celdeviceselector.go @@ -33,7 +33,7 @@ type CELDeviceSelectorApplyConfiguration struct { // - 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". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -66,6 +66,15 @@ type CELDeviceSelectorApplyConfiguration struct { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // 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: diff --git a/applyconfigurations/resource/v1beta1/celdeviceselector.go b/applyconfigurations/resource/v1beta1/celdeviceselector.go index ba65467ae..40663836d 100644 --- a/applyconfigurations/resource/v1beta1/celdeviceselector.go +++ b/applyconfigurations/resource/v1beta1/celdeviceselector.go @@ -33,7 +33,7 @@ type CELDeviceSelectorApplyConfiguration struct { // - 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". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -66,6 +66,15 @@ type CELDeviceSelectorApplyConfiguration struct { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // 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: diff --git a/applyconfigurations/resource/v1beta2/celdeviceselector.go b/applyconfigurations/resource/v1beta2/celdeviceselector.go index a184590eb..73485f502 100644 --- a/applyconfigurations/resource/v1beta2/celdeviceselector.go +++ b/applyconfigurations/resource/v1beta2/celdeviceselector.go @@ -33,7 +33,7 @@ type CELDeviceSelectorApplyConfiguration struct { // - 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". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -66,6 +66,15 @@ type CELDeviceSelectorApplyConfiguration struct { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // 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: