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) CurrentContext() (string, error)
- 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) ListReplicaSets(deployment *Deployment) ([]*ReplicaSet, error)
- func (c *Client) ReloadPods(deployment *Deployment, user, signature string) (*Deployment, error)
- func (c *Client) SetImage(deployment *Deployment, container, image, user, 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)
- func (d *Deployment) UID() string
- type ReplicaSet
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) CurrentContext ¶ added in v0.7.0
CurrentContext returns the current cluster name
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) ListReplicaSets ¶ added in v0.6.0
func (c *Client) ListReplicaSets(deployment *Deployment) ([]*ReplicaSet, error)
ListReplicaSets returns the list of ReplicaSets
func (*Client) ReloadPods ¶ added in v0.5.0
func (c *Client) ReloadPods(deployment *Deployment, user, signature string) (*Deployment, error)
ReloadPods reloads all Pods in the given deployment by setting new annotation
func (*Client) SetImage ¶
func (c *Client) SetImage(deployment *Deployment, container, image, user, 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(annotationPrefix string, 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
func (*Deployment) UID ¶ added in v0.6.0
func (d *Deployment) UID() string
UID returns the UID of Deployment
type ReplicaSet ¶ added in v0.6.0
type ReplicaSet struct {
// contains filtered or unexported fields
}
ReplicaSet represents the wrapper of Kubernetes ReplicaSet
func NewReplicaSet ¶ added in v0.6.0
func NewReplicaSet(annotationPrefix string, raw *v1beta1.ReplicaSet) *ReplicaSet
NewReplicaSet creates ne ReplicaSet object
func (*ReplicaSet) CreatedAt ¶ added in v0.6.0
func (r *ReplicaSet) CreatedAt() time.Time
CreatedAt returns the creation timestamp
func (*ReplicaSet) DeployUser ¶ added in v0.6.0
func (r *ReplicaSet) DeployUser() string
DeployUser returns the deploy user
func (*ReplicaSet) Images ¶ added in v0.6.0
func (r *ReplicaSet) Images() map[string]string
Images returns the list of deployed images at the moment
func (*ReplicaSet) Name ¶ added in v0.6.0
func (r *ReplicaSet) Name() string
Name returns the name of ReplicaSet
func (*ReplicaSet) Namespace ¶ added in v0.6.0
func (r *ReplicaSet) Namespace() string
Namespace returns the namespace of ReplicaSet
func (*ReplicaSet) Revision ¶ added in v0.6.0
func (r *ReplicaSet) Revision() string
Revision returns the revision signature