func (l *kubeListener) SetConfig(config common.ServiceConfig) error {
	m := config.ServiceSpecific
	if m["kubernetes_url"] == "" {
		return errors.New("kubernetes_url required")
	}
	l.kubeURL = m["kubernetes_url"].(string)
	if m["namespace_notification_path"] == "" {
		return errors.New("namespace_notification_path required")
	}
	l.namespaceNotificationPath = m["namespace_notification_path"].(string)
	if m["policy_notification_path_prefix"] == "" {
		return errors.New("policy_notification_path_prefix required")
	}
	l.policyNotificationPathPrefix = m["policy_notification_path_prefix"].(string)
	if m["policy_notification_path_postfix"] == "" {
		return errors.New("policy_notification_path_postfix required")
	}
	l.policyNotificationPathPostfix = m["policy_notification_path_postfix"].(string)
	if m["segment_label_name"] == "" {
		return errors.New("segment_label_name required")
	}
	l.segmentLabelName = m["segment_label_name"].(string)
	if m["tenant_label_name"] == "" {
		return errors.New("segment_label_name required")
	}
	l.tenantLabelName = m["tenant_label_name"].(string)
	if m["wait_for_iface_try"] == nil {
		l.namespaceBufferSize = 10
	} else {
		l.namespaceBufferSize = uint64(m["namespace_buffer_size"].(float64))
	}
	l.namespaceBufferSize = 1000
	if m["kubernetes_config"] == nil {
		m["kubernetes_config"] = "/home/ubuntu/.kube/config"
	}
	kubeClientConfig, err := clientcmd.BuildConfigFromFlags("", m["kubernetes_config"].(string))
	if err != nil {
		return errors.New(fmt.Sprintf("Failed to load kubernetes kubeClientConfig %s", err))
	}
	clientset, err := kubernetes.NewForConfig(kubeClientConfig)
	if err != nil {
		return errors.New(fmt.Sprintf("Failed to make kubernetes client %s", err))
	}
	l.kubeClient = clientset
	PTranslator.Init(l.restClient, l.segmentLabelName, l.tenantLabelName)
	tc := PTranslator.GetClient()
	if tc == nil {
		log.Critical("Failed to initialize rest client for policy translator.")
		os.Exit(255)
	}
	return nil
}
SetConfig implements SetConfig function of the Service interface.
package kubernetes
import (
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"os"
	"github.com/romana/core/common"
	"github.com/romana/core/tenant"
	log "github.com/romana/rlog"
	"k8s.io/client-go/1.5/kubernetes"
	"k8s.io/client-go/1.5/tools/cache"
	"k8s.io/client-go/1.5/tools/clientcmd"
)
type networkPolicyAction int
const (
	networkPolicyActionDelete networkPolicyAction = iota
	networkPolicyActionAdd
	networkPolicyActionModify
)
const (
	HttpGetParamWatch           = "watch=true"
	HttpGetParamResourceVersion = "resourceVersion"
)
type kubeListener struct {
	config                        common.ServiceConfig
	restClient                    *common.RestClient
	kubeURL                       string
	namespaceNotificationPath     string
	policyNotificationPathPrefix  string
	policyNotificationPathPostfix string
	segmentLabelName              string
	tenantLabelName               string
	lastEventPerNamespace         map[string]uint64
	namespaceBufferSize           uint64
	kubeClient *kubernetes.Clientset
	Watchers   map[string]cache.ListerWatcher
}
func (l *kubeListener) Routes() common.Routes {
	routes := common.Routes{}
	return routes
}
func (l *kubeListener) Name() string {
	return "kubernetesListener"
}