Skip to content

Commit

Permalink
operator: fix nodes informer
Browse files Browse the repository at this point in the history
Commit 6d44f4c replaced the informer feeding nodes to kvstore
from using corev1.Nodes to CiliumNodes, but the object type
passed to informer isn't updated accordingly, which prevents the
controller from collecting nodes:
```
cilium-operator level=error msg=k8sError error="github.com/cilium/cilium/operator/k8s_node.go:96: expected type *v1.Node, but watch event object had type *v2.CiliumNode" subsys=k8s
```

Note for the longer term: the operator already has a
v2.CiliumNode informer (in operator/cilium_node.go),
maybe k8s_node should use that too.

Signed-off-by: Benjamin Pineau <benjamin.pineau@datadoghq.com>
  • Loading branch information
bpineau authored and aanm committed Jun 23, 2020
1 parent 178d749 commit 3f5c6c5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions operator/k8s_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
cilium_v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2"
v2 "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2"
"github.com/cilium/cilium/pkg/k8s/informer"
slim_corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/core/v1"
v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/meta/v1"
"github.com/cilium/cilium/pkg/k8s/utils"
k8sversion "github.com/cilium/cilium/pkg/k8s/version"
Expand Down Expand Up @@ -60,7 +59,7 @@ func runNodeWatcher(nodeManager *allocator.NodeEventHandler) error {
k8sNodeStore, nodeController := informer.NewInformer(
cache.NewListWatchFromClient(k8s.CiliumClient().CiliumV2().RESTClient(),
"ciliumnodes", v1.NamespaceAll, fields.Everything()),
&slim_corev1.Node{},
&cilium_v2.CiliumNode{},
0,
cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
Expand Down

0 comments on commit 3f5c6c5

Please sign in to comment.