Documentation ¶
Index ¶
- func DefaultConfigFile() string
- func DefaultNamespace() string
- func GetTargetImage(containers map[string]*Container) (string, error)
- func GetTargetRepository(deployments []*Deployment, containers map[string]*Container) (string, error)
- type Client
- func (c *Client) DetectTargetContainer(deployment *Deployment, name string) (*Container, error)
- func (c *Client) DetectTargetDeployment(namespace, name string) (*Deployment, error)
- func (c *Client) GetDeployment(namespace, name string) (*Deployment, error)
- func (c *Client) ListDeployments(namespace string) ([]*Deployment, error)
- func (c *Client) SetImage(deployment *Deployment, container, image, cause string) (*Deployment, error)
- type Container
- type Deployment
- func (d *Deployment) Annotations() map[string]string
- func (d *Deployment) ContainerImage(container string) string
- func (d *Deployment) Containers() []*Container
- func (d *Deployment) DeployTargetContainer() (*Container, error)
- func (d *Deployment) IsDeployTarget() bool
- func (d *Deployment) Labels() map[string]string
- func (d *Deployment) Name() string
- func (d *Deployment) Namespace() string
- func (d *Deployment) Repositories() (map[string]string, error)
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
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 NewClientInCluster ¶
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
NewContainer creates new Container object
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