Documentation
¶
Index ¶
- Constants
- func FilteredNodes(ctx context.Context, runtime runtimes.Runtime, nodes []string) ([]*K3D.Node, error)
- type Config
- func (cfg *Config) CreateNodeWithTimeout(ctx context.Context, runtime runtimes.Runtime, nodes []*Config) error
- func (cfg *Config) CreateNodes(ctx context.Context, runtime runtimes.Runtime, startFrom int) error
- func (cfg *Config) DeleteNodesFromCluster(ctx context.Context, runtime runtimes.Runtime) error
- func (cfg *Config) GetFilteredNodes(ctx context.Context, runtime runtimes.Runtime) ([]*Config, error)
- func (cfg *Config) GetFilteredNodesFromCluster(ctx context.Context, runtime runtimes.Runtime) ([]*Config, error)
- func (cfg *Config) GetNodeFromConfig() *K3D.Node
- func (cfg *Config) GetNodeStatus(ctx context.Context, runtime runtimes.Runtime) ([]*Status, error)
- func (cfg *Config) GetNodesByLabels(ctx context.Context, runtime runtimes.Runtime) ([]*Config, error)
- func (cfg *Config) StartStopNode(ctx context.Context, runtime runtimes.Runtime) error
- type K3DNode
- type Status
Constants ¶
View Source
const (
// K3dClusterNameLabel is the label that holds cluster name in k3d node.
K3dClusterNameLabel = "k3d.cluster"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Name []string `json:"name,omitempty" mapstructure:"name"` Role string `json:"role,omitempty" mapstructure:"role"` ClusterAssociated string `json:"cluster,omitempty" mapstructure:"cluster"` State string `json:"state,omitempty" mapstructure:"state"` Created string `json:"created,omitempty" mapstructure:"created"` Memory string `json:"memory,omitempty" mapstructure:"memory"` Volumes []string `json:"volumes,omitempty" mapstructure:"volumes"` Networks []string `json:"networks,omitempty" mapstructure:"networks"` EnvironmentVariables []string `json:"env,omitempty" mapstructure:"env"` Count int `json:"count,omitempty" mapstructure:"count"` Image string `json:"image,omitempty" mapstructure:"image"` PortMapping map[string]interface{} `json:"port_mappings,omitempty" mapstructure:"port_mappings"` Timeout time.Duration `json:"timeout,omitempty" mapstructure:"timeout"` Wait bool `json:"wait,omitempty" mapstructure:"wait"` All bool `json:"all,omitempty" mapstructure:"all"` Labels map[string]string `json:"labels,omitempty" mapstructure:"labels"` Action string `json:"action,omitempty" mapstructure:"action"` }
Config stores filtered node data of k3d cluster.
func (*Config) CreateNodeWithTimeout ¶
func (cfg *Config) CreateNodeWithTimeout(ctx context.Context, runtime runtimes.Runtime, nodes []*Config) error
CreateNodeWithTimeout creates node by setting timeouts as per input.
func (*Config) CreateNodes ¶
CreateNodes creates number nodes specified in 'replicas', making this startFrom if in case we support update nodes on it.
func (*Config) DeleteNodesFromCluster ¶
DeleteNodesFromCluster deletes the specified node.
func (*Config) GetFilteredNodes ¶
func (cfg *Config) GetFilteredNodes(ctx context.Context, runtime runtimes.Runtime) ([]*Config, error)
GetFilteredNodes returns the fetched list of specified nodes from specified cluster with list of *Config type.
func (*Config) GetFilteredNodesFromCluster ¶
func (cfg *Config) GetFilteredNodesFromCluster(ctx context.Context, runtime runtimes.Runtime) ([]*Config, error)
GetFilteredNodesFromCluster returns the fetched all nodes from a specified cluster with list of *Config type.
func (*Config) GetNodeFromConfig ¶
GetNodeFromConfig returns K3D.Node equivalent for an stance of Config.
func (*Config) GetNodeStatus ¶
GetNodeStatus retrieves the latest state of the nodes.
type K3DNode ¶
type K3DNode interface { CreateNodeWithTimeout(context.Context, runtimes.Runtime, []*Config) error CreateNodes(context.Context, runtimes.Runtime, int) error DeleteNodesFromCluster(context.Context, runtimes.Runtime) error GetFilteredNodesFromCluster(context.Context, runtimes.Runtime) ([]*Config, error) GetFilteredNodes(context.Context, runtimes.Runtime) ([]*Config, error) GetNodesByLabels(context.Context, runtimes.Runtime) ([]*Config, error) GetNodeStatus(context.Context, runtimes.Runtime) ([]*Status, error) GetNodeFromConfig() *K3D.Node StartStopNode(context.Context, runtimes.Runtime) error }
Click to show internal directories.
Click to hide internal directories.