// NewConfig interacts with the Kubernetes API to find a pod and ports suitable for forwarding.
NewConfig interacts with the Kubernetes API to find a pod and ports suitable for forwarding.
// NewConfig interacts with the Kubernetes API to find a pod and ports suitable for forwarding .
func (c Client) NewConfig(resource string, portMap string) (*Config, error) {
	obj, pod, err := c.AttachablePodForObjectFn(resource, c.Namespace, c.timeout)
	if err != nil {
		return nil, err
	}
	port, err := c.translatePorts(obj, pod, portMap)
	if err != nil {
		return nil, err
	}
	return &Config{
		Pod:  pod,
		Port: port,
	}, nil
}
func ( c Client ) NewConfig ( resource string , portMap string ) ( * Config , error ) { obj , pod , err := c . AttachablePodForObjectFn ( resource , c . Namespace , c . timeout ) if err != nil { return nil , err } port , err := c . translatePorts ( obj , pod , portMap ) if err != nil { return nil , err } return & Config { Pod : pod , Port : port , } , nil }
NewConfig interacts with the Kubernetes API to find a pod and ports suitable for forwarding.
NewConfig interacts with the Kubernetes API to find a pod and ports suitable for forwarding .