kubernetes

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigFile

func DefaultConfigFile() string

DefaultConfigFile returns the default kubeconfig file path

func DefaultNamespace

func DefaultNamespace() string

DefaultNamespace returns the default namespace

func GetTargetImage added in v0.2.0

func GetTargetImage(containers map[string]*Container) (string, error)

GetTargetImage returns the unique image name of target containers

func GetTargetRepository added in v0.2.0

func GetTargetRepository(deployments []*Deployment, containers map[string]*Container) (string, error)

GetTargetRepository returns the unique GitHub repository of target containers

Types

type Client

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

Client represents the wrapper of Kubernetes API client

func NewClient

func NewClient(kubeconfig, context string) (*Client, error)

NewClient creates Client object using local kubecfg

func NewClientInCluster

func NewClientInCluster() (*Client, error)

NewClientInCluster creates Client object in Kubernetes cluster

func (*Client) DetectTargetContainer

func (c *Client) DetectTargetContainer(deployment *Deployment, name string) (*Container, error)

DetectTargetContainer returns the matched or the first container

func (*Client) DetectTargetDeployment

func (c *Client) DetectTargetDeployment(namespace, name string) (*Deployment, error)

DetectTargetDeployment returns the matched or the first deployment

func (*Client) GetDeployment

func (c *Client) GetDeployment(namespace, name string) (*Deployment, error)

GetDeployment returns a deployment

func (*Client) ListDeployments added in v0.2.0

func (c *Client) ListDeployments(namespace string) ([]*Deployment, error)

ListDeployments returns the list of deployment

func (*Client) SetImage

func (c *Client) SetImage(deployment *Deployment, container, image, cause string) (*Deployment, error)

SetImage sets new image to the given deployments

type Container added in v0.2.0

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

Container represents the wrapper of Kubernetes Pod container

func NewContainer added in v0.2.0

func NewContainer(raw *v1.Container) *Container

NewContainer creates new Container object

func (*Container) Image added in v0.2.0

func (c *Container) Image() string

Name represents the image name of container

func (*Container) Name added in v0.2.0

func (c *Container) Name() string

Name represents the name of contaienr

type Deployment added in v0.2.0

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

Deployment represents the wrapper of Kubernetes Deployment

func NewDeployment added in v0.2.0

func NewDeployment(raw *v1beta1.Deployment) *Deployment

NewDeployment creates new Deployment object

func (*Deployment) Annotations added in v0.2.0

func (d *Deployment) Annotations() map[string]string

Annotations returns the annotations of Deployment

func (*Deployment) ContainerImage added in v0.2.0

func (d *Deployment) ContainerImage(container string) string

ContainerImage returns image name of the given container

func (*Deployment) Containers added in v0.2.0

func (d *Deployment) Containers() []*Container

Containers returns the containers inside Deployment

func (*Deployment) DeployTargetContainer added in v0.2.0

func (d *Deployment) DeployTargetContainer() (*Container, error)

DeployTargetContainer returns - specified in `deploy/target-container` annotation

func (*Deployment) IsDeployTarget added in v0.2.0

func (d *Deployment) IsDeployTarget() bool

IsDeployTarget returns whether this deployment is deploy target or not - has `deploy/target: 1` or `deploy/target: true` annotation

func (*Deployment) Labels added in v0.2.0

func (d *Deployment) Labels() map[string]string

Labels returns the labels of Deployment

func (*Deployment) Name added in v0.2.0

func (d *Deployment) Name() string

Name returns the name of Deployment

func (*Deployment) Namespace added in v0.2.0

func (d *Deployment) Namespace() string

Namespace returns the namespace of Deployment

func (*Deployment) Repositories added in v0.2.0

func (d *Deployment) Repositories() (map[string]string, error)

Repositories returns the reportories attached by 'github' annotation

Jump to

Keyboard shortcuts

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