diff --git a/go.mod b/go.mod index dd729e49e..4fcdde6fe 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( k8s.io/kubelet v0.32.3 k8s.io/mount-utils v0.32.3 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.0 sigs.k8s.io/yaml v1.4.0 tags.cncf.io/container-device-interface v1.0.1 tags.cncf.io/container-device-interface/specs-go v1.0.0 diff --git a/go.sum b/go.sum index 6d5a9ea65..93e2968f2 100644 --- a/go.sum +++ b/go.sum @@ -226,8 +226,8 @@ sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1 sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= 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.0 h1:LLtMaTph2eavVwKnxsuR/UY85EHX0zmDYSD2EF15fLA= +sigs.k8s.io/node-feature-discovery/api/nfd v0.18.0/go.mod h1:XzGgUqDUyV/X+qkXEwG+CgfTUUeZix5iuobsmLoT0Ck= sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= diff --git a/vendor/modules.txt b/vendor/modules.txt index 82591c679..a2021e60c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -624,7 +624,7 @@ sigs.k8s.io/json/internal/golang/encoding/json 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.0 ## explicit; go 1.23.0 sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1 # sigs.k8s.io/structured-merge-diff/v4 v4.4.2 diff --git a/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/types.go b/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/types.go index 67dfc1b06..41b7e3e90 100644 --- a/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/types.go +++ b/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/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/zz_generated.deepcopy.go index 491d9866c..75d71cbdc 100644 --- a/vendor/sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1/zz_generated.deepcopy.go +++ b/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))