func (p *Provider) ListInternalNodes(name string) ([]nodes.Node, error) {
	n, err := p.provider.ListNodes(name)
	if err != nil {
		return nil, err
	}
	return nodeutils.InternalNodes(n)
}
ListInternalNodes returns the list of container IDs for the "nodes" in the cluster
that are not external
package cluster
import (
	"io/ioutil"
	"os"
	"path/filepath"
	"sort"
	"sigs.k8s.io/kind/pkg/cmd/kind/version"
	"sigs.k8s.io/kind/pkg/cluster/constants"
	"sigs.k8s.io/kind/pkg/cluster/nodes"
	"sigs.k8s.io/kind/pkg/cluster/nodeutils"
	"sigs.k8s.io/kind/pkg/errors"
	"sigs.k8s.io/kind/pkg/log"
	internalcreate "sigs.k8s.io/kind/pkg/cluster/internal/create"
	internaldelete "sigs.k8s.io/kind/pkg/cluster/internal/delete"
	"sigs.k8s.io/kind/pkg/cluster/internal/kubeconfig"
	internalproviders "sigs.k8s.io/kind/pkg/cluster/internal/providers"
	"sigs.k8s.io/kind/pkg/cluster/internal/providers/docker"
	"sigs.k8s.io/kind/pkg/cluster/internal/providers/podman"
)
const DefaultName = constants.DefaultClusterName
func defaultName(name string) string {
	if name == "" {
		name = DefaultName
	}
	return name
}
type Provider struct {
	provider internalproviders.Provider
	logger   log.Logger
}
func NewProvider(options ...ProviderOption) *Provider {
	p := &Provider{
		logger: log.NoopLogger{},
	}
	sort.SliceStable(options, func(i, j int) bool {
		_, iIsLogger := options[i].(providerLoggerOption)
		_, jIsLogger := options[j].(providerLoggerOption)
		return iIsLogger && !jIsLogger
	})
	for _, o := range options {
		if o != nil {
			o.apply(p)
		}
	}
	if p.provider == nil {
		providerOpt, _ := DetectNodeProvider()
		if providerOpt == nil {
			providerOpt = ProviderWithDocker()
		}
		providerOpt.apply(p)
	}
	return p
}
var NoNodeProviderDetectedError = errors.NewWithoutStack("failed to detect any supported node provider")
func DetectNodeProvider() (ProviderOption, error) {
	if docker.IsAvailable() {
		return ProviderWithDocker(), nil
	}
	if podman.IsAvailable() {
		return ProviderWithPodman(), nil
	}
	return nil, errors.WithStack(NoNodeProviderDetectedError)
}
type ProviderOption interface {
	apply(p *Provider)
}
type providerLoggerOption func(p *Provider)
func (a providerLoggerOption) apply(p *Provider) {
	a(p)
}
var _ ProviderOption = providerLoggerOption(nil)
func ProviderWithLogger(logger log.Logger) ProviderOption {
	return providerLoggerOption(func(p *Provider) {
		p.logger = logger
	})
}
type providerRuntimeOption func(p *Provider)
func (a providerRuntimeOption) apply(p *Provider) {
	a(p)
}
var _ ProviderOption = providerRuntimeOption(nil)
func ProviderWithDocker() ProviderOption {
	return providerRuntimeOption(func(p *Provider) {
		p.provider = docker.NewProvider(p.logger)
	})
}
func ProviderWithPodman() ProviderOption {
	return providerRuntimeOption(func(p *Provider) {
		p.provider = podman.NewProvider(p.logger)
	})
}
func (p *Provider) Create(name string, options ...CreateOption) error {
	opts := &internalcreate.ClusterOptions{
		NameOverride: name,
	}
	for _, o := range options {
		if err := o.apply(opts); err != nil {
			return err
		}
	}
	return internalcreate.Cluster(p.logger, p.provider, opts)
}
func (p *Provider) Delete(name, explicitKubeconfigPath string) error {
	return internaldelete.Cluster(p.logger, p.provider, defaultName(name), explicitKubeconfigPath)
}
func (p *Provider) List() ([]string, error) {
	return p.provider.ListClusters()
}
func (p *Provider) KubeConfig(name string, internal bool) (string, error) {
	return kubeconfig.Get(p.provider, defaultName(name), !internal)
}
func (p *Provider) ExportKubeConfig(name string, explicitPath string) error {
	return kubeconfig.Export(p.provider, defaultName(name), explicitPath)
}
func (p *Provider) ListNodes(name string) ([]nodes.Node, error) {
	return p.provider.ListNodes(defaultName(name))
}