From 09977bf937d0968bd3899b70020165dc4ff357c6 Mon Sep 17 00:00:00 2001 From: Gary Franczyk Date: Wed, 4 Nov 2020 23:09:32 -0500 Subject: [PATCH 1/2] Updated to call function with context --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 1c104a7..4c88215 100644 --- a/main.go +++ b/main.go @@ -51,11 +51,11 @@ func main() { &cache.ListWatch{ ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { // list all of the pods (core resource) in the deafult namespace - return client.CoreV1().Pods(meta_v1.NamespaceDefault).List(options) + return client.CoreV1().Pods(meta_v1.NamespaceDefault).List(context.TODO(), options) }, WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { // watch all of the pods (core resource) in the default namespace - return client.CoreV1().Pods(meta_v1.NamespaceDefault).Watch(options) + return client.CoreV1().Pods(meta_v1.NamespaceDefault).Watch(context.TODO(), options) }, }, &api_v1.Pod{}, // the target type (Pod) From 2188534f623afe61a1a7145f2bbbe8767de78168 Mon Sep 17 00:00:00 2001 From: Gary Franczyk Date: Wed, 4 Nov 2020 23:09:55 -0500 Subject: [PATCH 2/2] Documented dependency modules to pull --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0f0a6a1..3886659 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ An example of a custom Kubernetes controller that's only purpose is to watch for ``` $ git clone https://github.com/trstringer/k8s-controller-core-resource $ cd k8s-controller-core-resource +$ go get github.com/Sirupsen/logrus k8s.io/api/core/v1 k8s.io/apimachinery/pkg/apis/meta/v1 k8s.io/apimachinery/pkg/runtime k8s.io/apimachinery/pkg/util/runtime k8s.io/apimachinery/pkg/util/wait k8s.io/apimachinery/pkg/watch k8s.io/client-go/kubernetes k8s.io/client-go/tools/cache k8s.io/client-go/tools/clientcmd k8s.io/client-go/util/workqueue $ go run *.go ```