kube

package
v0.0.0-...-f7f3288 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StarkBundle string = "StarkBundle"

Functions

func AllStatusesDone

func AllStatusesDone(deploys map[string]*DeploymentStatus) bool

func RunKubectl

func RunKubectl(command string, args []string, input string) error

func RunKubectlWith

func RunKubectlWith(opts *KubectlOpts) error

Types

type Bundle

type Bundle struct {
	Kind      string            `yaml:"kind,omitempty"`
	Metadata  Metadata          `yaml:"metadata"`
	Target    Target            `yaml:"target,omitempty"`
	Labels    map[string]string `yaml:"labels,omitempty"`
	Resources []yaml.Node       `yaml:"resources,omitempty"`
}

func BundlesFromYaml

func BundlesFromYaml(encoded string) ([]Bundle, error)

func (*Bundle) ResourcesTyped

func (b *Bundle) ResourcesTyped() ([]ResourceBase, error)

func (*Bundle) ResourcesYaml

func (b *Bundle) ResourcesYaml() (string, error)

type DeploymentStatus

type DeploymentStatus struct {
	Kind      string
	Name      string
	Namespace string

	UpdatedPods int
	DesiredPods int

	TotalPods int
	ReadyPods int

	Err  error
	Done bool
}

func WatchDeployments

func WatchDeployments(
	ctx context.Context,
	labels map[string]string,
	cfg KubeCfg,
	target Target,
) ([]DeploymentStatus, chan DeploymentStatus, error)

func (*DeploymentStatus) FullName

func (ds *DeploymentStatus) FullName() string

type KubeCfg

type KubeCfg struct {
	Kubeconfig string
	Kubectl    string
	DiffCmd    string
}

type KubectlOpts

type KubectlOpts struct {
	Cfg KubeCfg

	Command string
	Args    []string
	Input   string

	Target Target

	Env map[string]string
}

func (*KubectlOpts) ExternalDiffCmd

func (opts *KubectlOpts) ExternalDiffCmd(cmd string)

func (*KubectlOpts) PrettyDiff

func (opts *KubectlOpts) PrettyDiff(args ...string)

type Metadata

type Metadata struct {
	Name      string `yaml:"name"`
	Namespace string `yaml:"namespace"`
}

type ResourceBase

type ResourceBase struct {
	APIVersion string   `yaml:"apiVersion,omitempty"`
	Kind       string   `yaml:"kind"`
	Metadata   Metadata `yaml:"metadata"`
}

type Target

type Target struct {
	Namespace string `yaml:"namespace,omitempty"`
	Cluster   string `yaml:"cluster,omitempty"`
}

Jump to

Keyboard shortcuts

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