Closed larytet closed 3 years ago
I found this https://github.com/kubernetes/client-go/issues/741 k8s.io/api v0.19.0 solved the problem Now the build https://github.com/spotahome/kooper/blob/master/examples/config-custom-controller/main.go of fails
have ("k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions)
want (context.Context, "k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions)
./ingress-controller.go:53:41: not enough arguments in call to k8scli.CoreV1().Pods("").Watch
have ("k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions)
want (context.Context, "k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions)
Is it Ok to do
diff --git a/ingress-controller.go b/ingress-controller.go
index 861ee60..d62b61b 100644
--- a/ingress-controller.go
+++ b/ingress-controller.go
@@ -25,6 +25,7 @@ import (
)
func run() error {
+ ctx := context.Background()
// Initialize logger.
logger := kooperlogrus.New(logrus.NewEntry(logrus.New())).
WithKV(log.KV{"example": "config-custom-controller"})
@@ -47,10 +48,10 @@ func run() error {
// Create our retriever so the controller knows how to get/listen for pod events.
retr := controller.MustRetrieverFromListerWatcher(&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
- return k8scli.CoreV1().Pods("").List(options)
+ return k8scli.CoreV1().Pods("").List(ctx, options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
- return k8scli.CoreV1().Pods("").Watch(options)
+ return k8scli.CoreV1().Pods("").Watch(ctx, options)
},
})
Hi, I am trying to build the example file https://github.com/spotahome/kooper/blob/master/examples/config-custom-controller/main.go My Dockerfile is
I can not resolve the packages
What am I doing wrong? Thanks