kdk

package
v0.0.0-...-ab6e412 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "undefined"
	Port    = strconv.Itoa(utils.GetPort())
)

Functions

func Destroy

func Destroy(cfg KdkEnvConfig, force bool) error

func Kubesync

func Kubesync(cfg KdkEnvConfig)

func Provision

func Provision(cfg KdkEnvConfig) error

func Prune

func Prune(cfg KdkEnvConfig) error

func Pull

func Pull(cfg *KdkEnvConfig, force bool) error

func Restart

func Restart(cfg KdkEnvConfig)

func Snapshot

func Snapshot(cfg KdkEnvConfig) (string, error)

func Ssh

func Ssh(cfg KdkEnvConfig)

func Up

func Up(cfg KdkEnvConfig) (err error)

func Update

func Update(cfg *KdkEnvConfig)

func WarnIfUpdateAvailable

func WarnIfUpdateAvailable(cfg *KdkEnvConfig)

Types

type AppConfig

type AppConfig struct {
	Name            string
	Port            string
	ImageRepository string
	ImageTag        string
	DotfilesRepo    string
	Shell           string
	SocksPort       string
}

type KdkEnvConfig

type KdkEnvConfig struct {
	DockerClient *client.Client
	Ctx          context.Context
	ConfigFile   configFile
	SocksPort    string
}

func (*KdkEnvConfig) ConfigDir

func (c *KdkEnvConfig) ConfigDir() (out string)

kdk container config dir (~/.kdk/<KDK_NAME>)

func (*KdkEnvConfig) ConfigPath

func (c *KdkEnvConfig) ConfigPath() (out string)

kdk container config path (~/.kdk/<KDK_NAME>/config.yaml)

func (*KdkEnvConfig) ConfigRootDir

func (c *KdkEnvConfig) ConfigRootDir() (out string)

kdk root config path (~/.kdk)

func (*KdkEnvConfig) CreateKdkConfig

func (c *KdkEnvConfig) CreateKdkConfig() (err error)

func (*KdkEnvConfig) CreateKdkSshKeyPair

func (c *KdkEnvConfig) CreateKdkSshKeyPair() (err error)

Creates KDK ssh keypair

func (*KdkEnvConfig) Exec

func (c *KdkEnvConfig) Exec(command string) error

Executes a command on the KDK container

func (*KdkEnvConfig) Home

func (c *KdkEnvConfig) Home() (out string)

users home directory

func (*KdkEnvConfig) ImageCoordinates

func (c *KdkEnvConfig) ImageCoordinates() (out string)

kdk image coordinates (ciscosso/kdk:debian-latest)

func (*KdkEnvConfig) Init

func (c *KdkEnvConfig) Init()

create docker client and context for easy reuse

func (*KdkEnvConfig) IsRunning

func (c *KdkEnvConfig) IsRunning() bool

Checks that KDK container is running

func (*KdkEnvConfig) KeypairDir

func (c *KdkEnvConfig) KeypairDir() (out string)

kdk keypair path path (~/.kdk/ssh)

func (*KdkEnvConfig) PrivateKeyPath

func (c *KdkEnvConfig) PrivateKeyPath() (out string)

kdk private key path (~/.kdk/ssh/id_rsa)

func (*KdkEnvConfig) PublicKeyPath

func (c *KdkEnvConfig) PublicKeyPath() (out string)

kdk public key path (~/.kdk/ssh/id_rsa.pub)

func (*KdkEnvConfig) SCPCommandString

func (c *KdkEnvConfig) SCPCommandString() string

Returns SCP command string

func (*KdkEnvConfig) SCPTo

func (c *KdkEnvConfig) SCPTo(hostPath, kdkPath string) error

SCP's a file into the KDK container

func (*KdkEnvConfig) SSHCommandString

func (c *KdkEnvConfig) SSHCommandString() string

Returns SSH command string

func (*KdkEnvConfig) SSHConnectionString

func (c *KdkEnvConfig) SSHConnectionString() string

Returns SSH connection string

func (*KdkEnvConfig) Start

func (c *KdkEnvConfig) Start()

If KDK container is not running, start it and provision KDK user.

func (*KdkEnvConfig) User

func (c *KdkEnvConfig) User() (out string)

current username

type ProgressDetail

type ProgressDetail struct {
	Current int `json:"current"`
	Total   int `json:"total"`
}

type ProgressMessage

type ProgressMessage struct {
	ID             string         `json:"id"`
	Progress       string         `json:"progress"`
	ProgressDetail ProgressDetail `json:"progressDetail"`
	Status         string         `json:"status"`
}

Jump to

Keyboard shortcuts

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