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