remote

package
v0.0.0-...-77b1a84 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SepAt     = "@"
	SepHyphen = "-"
	SepColon  = ":"

	DefaultRemotePort = 6443
)
View Source
const (
	// DefaultHost is the host used to represent remote master locally
	DefaultHost = "kubernetes"
)
View Source
const (
	// DefaultKubeConfigPath is default kubeconfig path on remote host.
	DefaultKubeConfigPath = "~/.kube/config"
)

Variables

View Source
var (
	ErrRemoteInvalidUser = errors.New("cube: user in remote kubeconfig is invalid")
	ErrRemoteInvalidCert = errors.New("cube: cert in remote kubeconfig is invalid")
	ErrConfigInvalid     = errors.New("cube: remote kubeconfig must have only one cluster")
)

Functions

func GetOccupiedLocalPort

func GetOccupiedLocalPort(srv string) (host string, port int, err error)

func LocalCachePath

func LocalCachePath(remoteAddr string) string

LocalCachePath returns cache path for remote kubectl config by convention. that's, `~/.config/cube/cache/$HOST`.

func NewLister

func NewLister() kube.Lister

func NewMerger

func NewMerger(opts MergeOptions) kube.Merger

func ParseContext

func ParseContext(kc *clientcmdapi.Config, ctxName string) (*model.ClusterInfo, error)

Types

type DownloadResult

type DownloadResult struct {
	ClusterName string               // matched cluster name
	Kc          *clientcmdapi.Config // remote kubectl config

}

DownloadResult represents the download status

type Downloader

type Downloader struct {
	// contains filtered or unexported fields
}

Downloader download kubernetes config for remote cluster. also download cert files if necessary.

func NewDownloader

func NewDownloader(remoteAddr string) *Downloader

NewDownloader create a new remote config downloader.

func (*Downloader) Download

func (d *Downloader) Download() (DownloadResult, error)

Download fetches config and cert files.

type MergeOptions

type MergeOptions struct {
	RemoteAddr string
	NameSuffix string
	LocalPort  int
	Force      bool
}

MergeOptions represents options for merge

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL