func NewTunnelForConfig(
	c *rest.Config,
	kind TunnelKind,
	namespace,
	target,
	remotePort string) (*Tunnel, error) {

	config := *c
	gv := corev1.SchemeGroupVersion
	config.GroupVersion = &gv
	config.APIPath = "/api"
	config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()

	client, err := rest.RESTClientFor(&config)
	if err != nil {
		return nil, fmt.Errorf("failed creating kubernetes rest client for tunnel: %w", err)
	}

	return NewTunnel(client, &config, kind, namespace, target, remotePort), nil
}
// NewTunnelForConfig constructs a new tunnel from the provided rest config
NewTunnelForConfig constructs a new tunnel from the provided rest config
// NewTunnelForConfig constructs a new tunnel from the provided rest config
func NewTunnelForConfig(
	c *rest.Config,
	kind TunnelKind,
	namespace,
	target,
	remotePort string) (*Tunnel, error) {
	config := *c
	gv := corev1.SchemeGroupVersion
	config.GroupVersion = &gv
	config.APIPath = "/api"
	config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
	client, err := rest.RESTClientFor(&config)
	if err != nil {
		return nil, fmt.Errorf("failed creating kubernetes rest client for tunnel: %w", err)
	}
	return NewTunnel(client, &config, kind, namespace, target, remotePort), nil
}
func NewTunnelForConfig ( c * rest . Config , kind TunnelKind , namespace , target , remotePort string ) ( * Tunnel , error ) { config := * c gv := corev1 . SchemeGroupVersion config . GroupVersion = & gv config . APIPath = " " config . NegotiatedSerializer = scheme . Codecs . WithoutConversion ( ) client , err := rest . RESTClientFor ( & config ) if err != nil { return nil , fmt . Errorf ( " " , err ) } return NewTunnel ( client , & config , kind , namespace , target , remotePort ) , nil }
NewTunnelForConfig constructs a new tunnel from the provided rest config
NewTunnelForConfig constructs a new tunnel from the provided rest config