From 43c3e0ab68fc103967bfb9bec0363d42a5964dac Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Wed, 20 Mar 2019 13:32:23 +0000 Subject: [PATCH] plugin/kubernetes: add ready function (#2709) * plugin/kubernetes: add ready function Add ready function as the health function is now gone. Signed-off-by: Miek Gieben * Fix readme Signed-off-by: Miek Gieben --- plugin/kubernetes/README.md | 5 +++++ plugin/kubernetes/ready.go | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 plugin/kubernetes/ready.go diff --git a/plugin/kubernetes/README.md b/plugin/kubernetes/README.md index 672e167df..2c7f9861e 100644 --- a/plugin/kubernetes/README.md +++ b/plugin/kubernetes/README.md @@ -107,6 +107,11 @@ kubernetes [ZONES...] { This allows the querying pod to continue searching for the service in the search path. The search path could, for example, include another Kubernetes cluster. +## Ready + +This plugin reports readiness to the ready plugin. This will happen after it has synced to the +Kubernetes API. + ## Examples Handle all queries in the `cluster.local` zone. Connect to Kubernetes in-cluster. Also handle all diff --git a/plugin/kubernetes/ready.go b/plugin/kubernetes/ready.go new file mode 100644 index 000000000..2625f3b5a --- /dev/null +++ b/plugin/kubernetes/ready.go @@ -0,0 +1,4 @@ +package kubernetes + +// Ready implements the ready.Readiness interface. +func (k *Kubernetes) Ready() bool { return k.APIConn.HasSynced() }