Documentation
¶
Index ¶
- func Create(c *client.Client, p *Instance) error
- func CreateWaitRunningState(c *client.Client, p *Instance) error
- func ExecCmd(c *client.Client, podName string, nameSpace string, cmd []string) (bytes.Buffer, bytes.Buffer, error)
- func Exists(c *client.Client, podName string, namespace string) (string, error)
- func FindPodsWithNameContains(c *client.Client, substring string, namespace string) ([]string, int)
- func GetIP(c *client.Client, podName string, nameSpace string) (string, error)
- func GetLastTimeConditionHappened(c *client.Client, condition string, podName string, nameSpace string) (metav1.Time, error)
- func WaitForPodInRunningState(c *client.Client, podname string, namespace string) error
- type Instance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create will create a POD
Args:
- Client struct from client module
- Instance struct from pod module
Return:
- error or nil
func CreateWaitRunningState ¶ added in v0.0.2
CreateWaitRunningState will create a POD and wait the pod be in running state
Args:
- Client struct from client module
- Instance struct from pod module
Return:
- error or nil
func ExecCmd ¶
func ExecCmd(c *client.Client, podName string, nameSpace string, cmd []string) (bytes.Buffer, bytes.Buffer, error)
ExecCmd executes a command inside a POD
Args:
Client - struct from client module podName - The pod name cmd - Array (string)
Returns:
stdout, stderr as bytes.Buffer or error
func Exists ¶
Exists will check if the pod exists or not
Args:
- Pointer to a Client struct
Returns:
string (namespace name) OR error type
func FindPodsWithNameContains ¶
FindPodsWithNameContains will find pods with substring provided
Args:
- Client struct from client module
- substring to be found
- namespace
Return:
- error or nil
func GetIP ¶
GetIP will return the pod IP address
Args:
- Client struct from client module
- pod name
- namespace
Returns:
- the IP as string or error
func GetLastTimeConditionHappened ¶ added in v0.0.2
func GetLastTimeConditionHappened(c *client.Client, condition string, podName string, nameSpace string) (metav1.Time, error)
GetLastTimeConditionHappened Get the last time a condition happened in a pod
Conditions:
PodScheduled: the Pod has been scheduled to a node. ContainersReady: all containers in the Pod are ready. Initialized: all init containers have started successfully. Ready: the Pod is able to serve requests and should be added to the load balancing pools of all matching
Args:
- Client struct from client module
- pod name
- namespace
Returns:
- the IP as string or error
Types ¶
Click to show internal directories.
Click to hide internal directories.