Skip to content

Commit

Permalink
add the field selector for the terwayd
Browse files Browse the repository at this point in the history
Signed-off-by: l1b0k <[email protected]>
  • Loading branch information
l1b0k committed Dec 3, 2024
1 parent 9e5b7a1 commit 3b7233e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions pkg/eni/crdv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
k8sErr "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog/v2"
Expand Down Expand Up @@ -75,18 +74,22 @@ func NewCRDV2(nodeName string) *CRDV2 {
DefaultFieldSelector: nil,
DefaultTransform: nil,
ByObject: map[client.Object]cache.ByObject{
&corev1.Node{}: {
Field: fields.SelectorFromSet(map[string]string{
"metadata.name": nodeName,
}),
Transform: nil,
},
&networkv1beta1.Node{}: {
Label: labels.Set(map[string]string{
"name": nodeName,
}).AsSelector(),
Field: nil,
Field: fields.SelectorFromSet(map[string]string{
"metadata.name": nodeName,
}),
Transform: nil,
},
&networkv1beta1.NodeRuntime{}: {
Label: labels.Set(map[string]string{
"name": nodeName,
}).AsSelector(),
Field: nil,
Field: fields.SelectorFromSet(map[string]string{
"metadata.name": nodeName,
}),
Transform: nil,
},
&corev1.Pod{}: {
Expand Down

0 comments on commit 3b7233e

Please sign in to comment.