func (c *Getter) ToRawKubeConfigLoader() clientcmd.ClientConfig {
	return c.c
}
ToRawKubeConfigLoader is part of k8s.io/cli-runtime/pkg/genericclioptions.RESTClientGetter interface.
package client
import (
	"fmt"
	"k8s.io/apimachinery/pkg/api/meta"
	"k8s.io/client-go/discovery"
	"k8s.io/client-go/discovery/cached/memory"
	"k8s.io/client-go/rest"
	"k8s.io/client-go/restmapper"
	"k8s.io/client-go/tools/clientcmd"
)
type Getter struct {
	c clientcmd.ClientConfig
}
func (c *Getter) ToRESTMapper() (meta.RESTMapper, error) {
	d, err := c.ToDiscoveryClient()
	if err != nil {
		return nil, err
	}
	mapper := restmapper.NewDeferredDiscoveryRESTMapper(d)
	expander := restmapper.NewShortcutExpander(mapper, d)
	return expander, nil
}
func (c *Getter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error) {
	cc, err := c.ToRESTConfig()
	if err != nil {
		return nil, fmt.Errorf("getting REST config: %w", err)
	}
	d, err := discovery.NewDiscoveryClientForConfig(cc)
	if err != nil {
		return nil, fmt.Errorf("creating discovery client: %w", err)
	}
	return memory.NewMemCacheClient(d), nil
}