func (n *Node) PatchCLIConnOpen(ns string) error {
	t, ok := n.cliConn.Transport.Impl.(scraplitransport.SystemTransport)
	if !ok {
		return ErrIncompatibleCliConn
	}
	t.SetExecCmd("kubectl")
	t.SetOpenCmd([]string{"exec", "-it", "-n", ns, n.Name(), "--", "cli", "-c"})
	return nil
}
PatchCLIConnOpen sets the OpenCmd and ExecCmd of system transport to work with `kubectl exec` terminal.
package cptx
import (
	"context"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"time"
	tpb "github.com/google/kne/proto/topo"
	"github.com/google/kne/topo/node"
	scraplicfg "github.com/scrapli/scrapligo/cfg"
	scraplibase "github.com/scrapli/scrapligo/driver/base"
	scraplicore "github.com/scrapli/scrapligo/driver/core"
	scraplinetwork "github.com/scrapli/scrapligo/driver/network"
	scraplitransport "github.com/scrapli/scrapligo/transport"
	scraplitest "github.com/scrapli/scrapligo/util/testhelper"
	log "github.com/sirupsen/logrus"
	"google.golang.org/protobuf/proto"
)
var ErrIncompatibleCliConn = errors.New("incompatible cli connection in use")
const timeout = 500
func New(impl *node.Impl) (node.Node, error) {
	cfg := defaults(impl.Proto)
	proto.Merge(cfg, impl.Proto)
	node.FixServices(cfg)
	n := &Node{
		Impl: impl,
	}
	proto.Merge(n.Impl.Proto, cfg)
	return n, nil
}
type Node struct {
	*node.Impl
	cliConn *scraplinetwork.Driver
}
var (
	_ node.ConfigPusher = (*Node)(nil)
)
func (n *Node) WaitCLIReady(ctx context.Context) error {
	var err error
	sleep := 1 * time.Second
	for {
		select {
		case <-ctx.Done():
			log.Debugf("%s - Timed out - cli still not ready.", n.Name())
			return fmt.Errorf("context cancelled for target %q with cli not ready: %w", n.Name(), err)
		default:
		}
		err = n.cliConn.Open()
		if err == nil {
			log.Debugf("%s - cli ready.", n.Name())
			return nil
		}
		log.Debugf("%s - cli not ready - waiting %d seconds.", n.Name(), sleep)
		time.Sleep(sleep)
		sleep *= 2
	}
}