func (o *KubernetesClientOptions) newCRDClient(t Type) (*Client, error) {
	config, scheme, err := createRESTConfig(o.kubeConfig, t)
	if err != nil {
		return nil, err
	}

	if err = registerResource(config, t); err != nil {
		return nil, err
	}
	// creates the client
	var restClient *rest.RESTClient
	restClient, err = rest.RESTClientFor(config)
	if err != nil {
		return nil, err
	}
	rc := Client{cl: restClient, ns: o.namespace, t: t,
		codec: runtime.NewParameterCodec(scheme)}
	return &rc, nil
}
func (o *KubernetesClientOptions) newCRDClient(t Type) (*Client, error) {
	config, scheme, err := createRESTConfig(o.kubeConfig, t)
	if err != nil {
		return nil, err
	}

	if err = registerResource(config, t); err != nil {
		return nil, err
	}
	// creates the client
	var restClient *rest.RESTClient
	restClient, err = rest.RESTClientFor(config)
	if err != nil {
		return nil, err
	}
	rc := Client{cl: restClient, ns: o.namespace, t: t,
		codec: runtime.NewParameterCodec(scheme)}
	return &rc, nil
}
// newClientFromFlags creates a CRD rest client from provided flags.