diff --git a/tests/go.mod b/tests/go.mod index 8d6bc5a05..ac8ce5426 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -14,7 +14,7 @@ require ( k8s.io/client-go v0.33.3 k8s.io/klog/v2 v2.130.1 sigs.k8s.io/node-feature-discovery v0.17.3 - sigs.k8s.io/node-feature-discovery/api/nfd v0.17.3 + sigs.k8s.io/node-feature-discovery/api/nfd v0.18.2 sigs.k8s.io/yaml v1.5.0 ) diff --git a/tests/go.sum b/tests/go.sum index 2c93932be..17c9be7ab 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -535,8 +535,8 @@ sigs.k8s.io/kustomize/kyaml v0.19.0 h1:RFge5qsO1uHhwJsu3ipV7RNolC7Uozc0jUBC/61XS sigs.k8s.io/kustomize/kyaml v0.19.0/go.mod h1:FeKD5jEOH+FbZPpqUghBP8mrLjJ3+zD3/rf9NNu1cwY= sigs.k8s.io/node-feature-discovery v0.17.3 h1:CArk8De9LBP5bj3Z6Bz/mpnC8kDNfBhDAu0xJp4u/A8= sigs.k8s.io/node-feature-discovery v0.17.3/go.mod h1:N7lJLSoLzbTbliRtfBLXf12av2MjBiFM8dEaq8FESag= -sigs.k8s.io/node-feature-discovery/api/nfd v0.17.3 h1:BJMNJ5ggnmlvzsANrxk6xPZISw1HSY0o7gL55EYu4Xc= -sigs.k8s.io/node-feature-discovery/api/nfd v0.17.3/go.mod h1:XzGgUqDUyV/X+qkXEwG+CgfTUUeZix5iuobsmLoT0Ck= +sigs.k8s.io/node-feature-discovery/api/nfd v0.18.2 h1:K1tEFsNBTkNMyIUfhLZXNC63tdHdy8zX+4hwNRZR+Ew= +sigs.k8s.io/node-feature-discovery/api/nfd v0.18.2/go.mod h1:XzGgUqDUyV/X+qkXEwG+CgfTUUeZix5iuobsmLoT0Ck= sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= diff --git a/tests/vendor/modules.txt b/tests/vendor/modules.txt index 1962cf050..20ab8265d 100644 --- a/tests/vendor/modules.txt +++ b/tests/vendor/modules.txt @@ -1192,7 +1192,7 @@ sigs.k8s.io/kustomize/kyaml/yaml/walk sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned/scheme sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned/typed/nfd/v1alpha1 -# sigs.k8s.io/node-feature-discovery/api/nfd v0.17.3 +# sigs.k8s.io/node-feature-discovery/api/nfd v0.18.2 ## explicit; go 1.23.0 sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1 # sigs.k8s.io/randfill v1.0.0 diff --git a/tests/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/types.go b/tests/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/types.go index 67dfc1b06..41b7e3e90 100644 --- a/tests/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/types.go +++ b/tests/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/types.go @@ -183,6 +183,17 @@ type GroupRule struct { // Name of the rule. Name string `json:"name"` + // Vars is the variables to store if the rule matches. Variables can be + // referenced from other rules enabling more complex rule hierarchies. + // +optional + Vars map[string]string `json:"vars"` + + // VarsTemplate specifies a template to expand for dynamically generating + // multiple variables. Data (after template expansion) must be keys with an + // optional value ([=]) separated by newlines. + // +optional + VarsTemplate string `json:"varsTemplate"` + // MatchFeatures specifies a set of matcher terms all of which must match. // +optional MatchFeatures FeatureMatcher `json:"matchFeatures"` @@ -285,16 +296,34 @@ type MatchExpression struct { // In other cases Value should contain at least one element. // +optional Value MatchValue `json:"value,omitempty"` + + // Type defines the value type for specific operators. + // The currently supported type is 'version' for Gt,Ge,Lt,Le,GtLt,GeLe operators. + // +optional + Type ValueType `json:"type,omitempty"` } // MatchOp is the match operator that is applied on values when evaluating a // MatchExpression. -// +kubebuilder:validation:Enum="In";"NotIn";"InRegexp";"Exists";"DoesNotExist";"Gt";"Lt";"GtLt";"IsTrue";"IsFalse" +// +kubebuilder:validation:Enum="In";"NotIn";"InRegexp";"Exists";"DoesNotExist";"Gt";"Ge";"Lt";"Le";"GtLt";"GeLe";"IsTrue";"IsFalse" type MatchOp string // MatchValue is the list of values associated with a MatchExpression. type MatchValue []string +// ValueType represents the type of value in the expression. +type ValueType string + +const ( + // TypeEmpty is a default value for the expression type. + TypeEmpty ValueType = "" + // TypeVersion represents a version with the following supported formats (major.minor.patch): + // %d.%d.%d (e.g., 1.2.3), + // %d.%d (e.g., 1.2), + // %d (e.g., 1) + TypeVersion ValueType = "version" +) + const ( // MatchAny returns always true. MatchAny MatchOp = "" @@ -318,16 +347,31 @@ const ( // Both the input and value must be integer numbers, otherwise an error is // returned. MatchGt MatchOp = "Gt" + // MatchGe returns true if the input is greater than or equal to the value of the + // expression (number of values in the expression must be exactly one). + // Both the input and value must be integer numbers, otherwise an error is + // returned. + MatchGe MatchOp = "Ge" // MatchLt returns true if the input is less than the value of the // expression (number of values in the expression must be exactly one). // Both the input and value must be integer numbers, otherwise an error is // returned. MatchLt MatchOp = "Lt" + // MatchLe returns true if the input is less than or equal to the value of the + // expression (number of values in the expression must be exactly one). + // Both the input and value must be integer numbers, otherwise an error is + // returned. + MatchLe MatchOp = "Le" // MatchGtLt returns true if the input is between two values, i.e. greater // than the first value and less than the second value of the expression // (number of values in the expression must be exactly two). Both the input // and values must be integer numbers, otherwise an error is returned. MatchGtLt MatchOp = "GtLt" + // MatchGeLe returns true if the input is between two values including the boundary values, + // i.e. greater than or equal to the first value and less than or equal to the second value + // of the expression (number of values in the expression must be exactly two). Both the input + // and values must be integer numbers, otherwise an error is returned. + MatchGeLe MatchOp = "GeLe" // MatchIsTrue returns true if the input holds the value "true". The // expression must not have any values. MatchIsTrue MatchOp = "IsTrue" diff --git a/tests/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/zz_generated.deepcopy.go b/tests/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/zz_generated.deepcopy.go index 491d9866c..75d71cbdc 100644 --- a/tests/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/zz_generated.deepcopy.go +++ b/tests/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2024 The Kubernetes Authors. +Copyright 2025 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -190,6 +190,13 @@ func (in *FlagFeatureSet) DeepCopy() *FlagFeatureSet { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GroupRule) DeepCopyInto(out *GroupRule) { *out = *in + if in.Vars != nil { + in, out := &in.Vars, &out.Vars + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } if in.MatchFeatures != nil { in, out := &in.MatchFeatures, &out.MatchFeatures *out = make(FeatureMatcher, len(*in))