// provide "" (metav1.NamespaceAll) to get a cluster-scoped settings client
provide "" (metav1.NamespaceAll) to get a cluster-scoped settings client
// provide " " ( metav1 . NamespaceAll ) to get a cluster - scoped settings client
func SettingsClient(namespaces []string) (v1.SettingsClient, error) {
	customFactory := getConfigClientFactory()
	if customFactory != nil {
		return v1.NewSettingsClient(customFactory)
	}
	cfg, err := kubeutils.GetConfig("", "")
	if err != nil {
		return nil, errors.Wrapf(err, "getting kube config")
	}
	cache := kube.NewKubeCache(context.TODO())
	settingsClient, err := v1.NewSettingsClient(&factory.KubeResourceClientFactory{
		Crd:                v1.SettingsCrd,
		Cfg:                cfg,
		SharedCache:        cache,
		SkipCrdCreation:    true,
		NamespaceWhitelist: namespaces,
	})
	if err != nil {
		return nil, errors.Wrapf(err, "creating settings client")
	}
	if err := settingsClient.Register(); err != nil {
		return nil, err
	}
	return settingsClient, nil
}
func SettingsClient ( namespaces [ ] string ) ( v1 . SettingsClient , error ) { customFactory := getConfigClientFactory ( ) if customFactory != nil { return v1 . NewSettingsClient ( customFactory ) } cfg , err := kubeutils . GetConfig ( " " , " " ) if err != nil { return nil , errors . Wrapf ( err , " " ) } cache := kube . NewKubeCache ( context . TODO ( ) ) settingsClient , err := v1 . NewSettingsClient ( & factory . KubeResourceClientFactory { Crd : v1 . SettingsCrd , Cfg : cfg , SharedCache : cache , SkipCrdCreation : true , NamespaceWhitelist : namespaces , } ) if err != nil { return nil , errors . Wrapf ( err , " " ) } if err := settingsClient . Register ( ) ; err != nil { return nil , err } return settingsClient , nil }
provide "" (metav1.NamespaceAll) to get a cluster-scoped settings client
provide " " ( metav1 . NamespaceAll ) to get a cluster - scoped settings client