// NewForConfig creates a new Clientset for the given config.
// If config's RateLimiter is not set and QPS and Burst are acceptable,
// NewForConfig will generate a rate-limiter in configShallowCopy.
NewForConfig creates a new Clientset for the given config.
If config's RateLimiter is not set and QPS and Burst are acceptable,
NewForConfig will generate a rate-limiter in configShallowCopy.
// NewForConfig creates a new Clientset for the given config . // If config ' s RateLimiter is not set and QPS and Burst are acceptable // NewForConfig will generate a rate - limiter in configShallowCopy .
func NewForConfig(c *rest.Config) (*Clientset, error) {
	configShallowCopy := *c
	if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
		if configShallowCopy.Burst <= 0 {
			return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
		}
		configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
	}
	var cs Clientset
	var err error
	cs.alertV1alpha1, err = alertv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.auditingV1alpha1, err = auditingv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.cloudV1alpha1, err = cloudv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.clusterV1alpha1, err = clusterv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.customV1alpha1, err = customv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.dataV1alpha1, err = datav1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.databaseV1alpha1, err = databasev1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.encryptionV1alpha1, err = encryptionv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.eventV1alpha1, err = eventv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.globalV1alpha1, err = globalv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.ldapV1alpha1, err = ldapv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.maintenanceV1alpha1, err = maintenancev1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.networkV1alpha1, err = networkv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.onlineV1alpha1, err = onlinev1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.privateV1alpha1, err = privatev1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.privatelinkV1alpha1, err = privatelinkv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.projectV1alpha1, err = projectv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.searchV1alpha1, err = searchv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.teamV1alpha1, err = teamv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.teamsV1alpha1, err = teamsv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.thirdV1alpha1, err = thirdv1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.x509V1alpha1, err = x509v1alpha1.NewForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
	if err != nil {
		return nil, err
	}
	return &cs, nil
}
func NewForConfig ( c * rest . Config ) ( * Clientset , error ) { configShallowCopy := * c if configShallowCopy . RateLimiter == nil && configShallowCopy . QPS > 0 { if configShallowCopy . Burst <= 0 { return nil , fmt . Errorf ( " " ) } configShallowCopy . RateLimiter = flowcontrol . NewTokenBucketRateLimiter ( configShallowCopy . QPS , configShallowCopy . Burst ) } var cs Clientset var err error cs . alertV1alpha1 , err = alertv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . auditingV1alpha1 , err = auditingv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . cloudV1alpha1 , err = cloudv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . clusterV1alpha1 , err = clusterv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . customV1alpha1 , err = customv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . dataV1alpha1 , err = datav1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . databaseV1alpha1 , err = databasev1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . encryptionV1alpha1 , err = encryptionv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . eventV1alpha1 , err = eventv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . globalV1alpha1 , err = globalv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . ldapV1alpha1 , err = ldapv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . maintenanceV1alpha1 , err = maintenancev1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . networkV1alpha1 , err = networkv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . onlineV1alpha1 , err = onlinev1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . privateV1alpha1 , err = privatev1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . privatelinkV1alpha1 , err = privatelinkv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . projectV1alpha1 , err = projectv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . searchV1alpha1 , err = searchv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . teamV1alpha1 , err = teamv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . teamsV1alpha1 , err = teamsv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . thirdV1alpha1 , err = thirdv1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . x509V1alpha1 , err = x509v1alpha1 . NewForConfig ( & configShallowCopy ) if err != nil { return nil , err } cs . DiscoveryClient , err = discovery . NewDiscoveryClientForConfig ( & configShallowCopy ) if err != nil { return nil , err } return & cs , nil }
NewForConfig creates a new Clientset for the given config.
NewForConfig creates a new Clientset for the given config .