func (r *kubernetesRegistry) CloseAndNilClient() {
	r.client.Close()
	r.client = nil
}
CloseAndNilClient closes listeners and clear client
package kubernetes
import (
	"fmt"
	"path"
	"sync"
	"time"
)
import (
	gxtime "github.com/dubbogo/gost/time"
	perrors "github.com/pkg/errors"
	v1 "k8s.io/api/core/v1"
)
import (
	"dubbo.apache.org/dubbo-go/v3/common"
	"dubbo.apache.org/dubbo-go/v3/common/constant"
	"dubbo.apache.org/dubbo-go/v3/common/extension"
	"dubbo.apache.org/dubbo-go/v3/common/logger"
	"dubbo.apache.org/dubbo-go/v3/registry"
	"dubbo.apache.org/dubbo-go/v3/remoting/kubernetes"
)
const (
	Name         = "kubernetes"
	ConnDelay    = 3
	MaxFailTimes = 15
)
func init() {
	extension.SetRegistry(Name, newKubernetesRegistry)
}
type kubernetesRegistry struct {
	registry.BaseRegistry
	cltLock        sync.RWMutex
	client         *kubernetes.Client
	listenerLock   sync.Mutex
	listener       *kubernetes.EventListener
	dataListener   *dataListener
	configListener *configurationListener
}
func (r *kubernetesRegistry) Client() *kubernetes.Client {
	r.cltLock.RLock()
	client := r.client
	r.cltLock.RUnlock()
	return client
}
func (r *kubernetesRegistry) SetClient(client *kubernetes.Client) {
	r.cltLock.Lock()
	r.client = client
	r.cltLock.Unlock()
}