Documentation ¶
Index ¶
- Variables
- func ContainerRunning(containerName string) func(watch.Event) (bool, error)
- func ErrWithMessagef(err error, format string, args ...interface{}) error
- func IsNotFound(err error) bool
- func PodInitReady(event watch.Event) (bool, error)
- func PreparePortForward(config *rest.Config, namespace, podName string, ports []string, ...) (*portforward.PortForwarder, error)
- func SetKubernetesDefaults(config *rest.Config) error
- type Client
- func (c *Client) Attach(namespace, podName, containerName string, stdin io.Reader, ...) error
- func (c *Client) CreatePod(namespace, name, image string, cmd []string, workDir string, tty, stdin bool, ...) (*apiv1.Pod, error)
- func (c *Client) DeletePod(namespace, name string) error
- func (c *Client) GetLogs(namespace, name, containerName string) (*rest.Request, error)
- func (c *Client) WaitForPod(namespace, name string, exitCondition watchtools.ConditionFunc) (*apiv1.Pod, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNoContainerFound = fmt.Errorf("no container found")
var (
ErrNotFound = errors.New("not found")
)
Definitions of common error types used throughout runtime implementation. All errors returned by the interface will map into one of these errors classes.
var ErrPodCompleted = fmt.Errorf("pod ran to completion")
var ErrPodStarted = fmt.Errorf("pod ran to running")
Functions ¶
func ContainerRunning ¶
ContainerRunning returns true if the pod is running and container is ready, false if the pod has not yet reached those states, returns ErrPodCompleted if the pod has run to completion, or an error in any other case.
func ErrWithMessagef ¶
func IsNotFound ¶
IsNotFound returns true if the error is due to a missing resource
func PodInitReady ¶
PodInitReady returns true if the pod init containers are running and ready, false if the pod has not yet reached those states, returns ErrPodCompleted if the pod has run to completion, or an error in any other case.
func PreparePortForward ¶
func PreparePortForward(config *rest.Config, namespace, podName string, ports []string, stopChannel, readyChannel chan struct{}, out, errOut io.Writer) (*portforward.PortForwarder, error)
func SetKubernetesDefaults ¶
SetKubernetesDefaults sets default values on the provided client config for accessing the Kubernetes API or returns an error if any of the defaults are impossible or invalid. NOTE: Originally copied from here:
https://github.com/kubernetes/kubernetes/blob/ddf47ac13c1a9483ea035a79cd7c10005ff21a6d/pkg/kubectl/cmd/util/kubectl_match_version.go#L113-L130
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) WaitForPod ¶
func (c *Client) WaitForPod(namespace, name string, exitCondition watchtools.ConditionFunc) (*apiv1.Pod, error)
WaitForPod watches the given pod until the exitCondition is true