code: func NewKubeClient(config *KubeClientConfig) (KubeClientInterface, error) {
  	// Use default implementation if no KubernetesGetter is specified
  	if config.KubeRESTAPIGetter == nil {
  		config.KubeRESTAPIGetter = &defaultGetter{}
  	}
  	// Use default implementation if no OpenShiftGetter is specified
  	if config.OpenShiftRESTAPIGetter == nil {
  		config.OpenShiftRESTAPIGetter = &defaultGetter{}
  	}
  	kubeAPI, err := config.GetKubeRESTAPI(config)
  	if err != nil {
  		return nil, err
  	}
  	osAPI, err := config.GetOpenShiftRESTAPI(config)
  	if err != nil {
  		return nil, err
  	}
  	// Use default implementation if no MetricsGetter is specified
  	if config.MetricsGetter == nil {
  		config.MetricsGetter = &defaultGetter{}
  	}
  
  	envMap := config.GetEnvironmentMapping()
  	kubeClient := &kubeClient{
  		config:           config,
  		envMap:           envMap,
  		BaseURLProvider:  config,
  		KubeRESTAPI:      kubeAPI,
  		OpenShiftRESTAPI: osAPI,
  		metricsMap:       make(map[string]Metrics),
  		rulesMap:         make(map[string]*accessRules),
  		MetricsGetter:    config.MetricsGetter,
  	}
  
  	return kubeClient, nil
  }
docs: // NewKubeClient creates a KubeClientInterface given a configuration. The returned
  // KubeClientInterface must be closed using the Close method, when no longer needed.