Documentation ¶
Index ¶
- Variables
- func GetClientset() (kubernetes.Interface, error)
- func GetDynamicClient() (dynamic.Interface, error)
- func PodWatcher() (watch.Interface, error)
- func WaitForDeploymentToStabilize(ctx context.Context, c kubernetes.Interface, ns, name string, ...) error
- func WaitForJobToStabilize(ctx context.Context, c kubernetes.Interface, ns, name string, ...) error
- func WaitForPodComplete(ctx context.Context, pods corev1.PodInterface, podName string, ...) error
- func WaitForPodInitialized(ctx context.Context, pods corev1.PodInterface, podName string) error
- func WaitForPodReady(ctx context.Context, pods corev1.PodInterface, podName string) error
- func WaitForPodScheduled(ctx context.Context, pods corev1.PodInterface, podName string) error
- type ColorPicker
- type Forwarder
- type ImageList
- type LogAggregator
- type PodSelector
- type PortForwarder
Constants ¶
This section is empty.
Variables ¶
var Client = GetClientset
Client is for tests
var DynamicClient = GetDynamicClient
Functions ¶
func GetClientset ¶
func GetClientset() (kubernetes.Interface, error)
func GetDynamicClient ¶ added in v0.10.0
func PodWatcher ¶ added in v0.14.0
PodWatcher returns a watcher that will report on all Pod Events (additions, modifications, etc.)
func WaitForDeploymentToStabilize ¶ added in v0.3.0
func WaitForDeploymentToStabilize(ctx context.Context, c kubernetes.Interface, ns, name string, timeout time.Duration) error
WaitForDeploymentToStabilize waits till the Deployment has a matching generation/replica count between spec and status. TODO: handle ctx.Done()
func WaitForJobToStabilize ¶ added in v0.16.0
func WaitForJobToStabilize(ctx context.Context, c kubernetes.Interface, ns, name string, timeout time.Duration) error
WaitForJobToStabilize waits till the Job has at least one active pod
func WaitForPodComplete ¶ added in v0.5.0
func WaitForPodInitialized ¶ added in v0.16.0
WaitForPodInitialized waits until init containers have started running
func WaitForPodReady ¶
func WaitForPodScheduled ¶ added in v0.16.0
Types ¶
type ColorPicker ¶ added in v0.4.0
ColorPicker is used to associate colors for with pods so that the container logs can be output to the terminal with a consistent color being used to identify logs from each pod.
func NewColorPicker ¶ added in v0.4.0
func NewColorPicker(baseImageNames []string) ColorPicker
NewColorPicker creates a new ColorPicker. For each artifact, a color will be selected sequentially from `colorCodes`. If all colors are used, the first color will be used again. The formatter for the associated color will then be returned by `Pick` each time it is called for the artifact and can be used to write to out in that color.
type Forwarder ¶ added in v0.14.0
type Forwarder interface { Forward(context.Context, *portForwardEntry) error Terminate(*portForwardEntry) }
Forwarder is an interface that can modify and manage port-forward processes
type ImageList ¶ added in v0.4.0
ImageList implements PodSelector based on a list of images names.
func NewImageList ¶ added in v0.4.0
func NewImageList() *ImageList
NewImageList creates a new ImageList.
type LogAggregator ¶ added in v0.3.0
type LogAggregator struct {
// contains filtered or unexported fields
}
LogAggregator aggregates the logs for all the deployed pods.
func NewLogAggregator ¶ added in v0.3.0
func NewLogAggregator(out io.Writer, baseImageNames []string, podSelector PodSelector) *LogAggregator
NewLogAggregator creates a new LogAggregator for a given output.
func (*LogAggregator) IsMuted ¶ added in v0.3.0
func (a *LogAggregator) IsMuted() bool
IsMuted says if the logs are to be muted.
func (*LogAggregator) Start ¶ added in v0.3.0
func (a *LogAggregator) Start(ctx context.Context) error
Start starts a logger that listens to pods and tail their logs if they are matched by the `podSelector`.
func (*LogAggregator) Unmute ¶ added in v0.3.0
func (a *LogAggregator) Unmute()
Unmute unmutes the logs.
type PodSelector ¶ added in v0.4.0
PodSelector is used to choose which pods to log.
type PortForwarder ¶ added in v0.14.0
type PortForwarder struct { Forwarder // contains filtered or unexported fields }
PortForwarder is responsible for selecting pods satisfying a certain condition and port-forwarding the exposed container ports within those pods. It also tracks and manages the port-forward connections.
func NewPortForwarder ¶ added in v0.14.0
func NewPortForwarder(out io.Writer, podSelector PodSelector) *PortForwarder
NewPortForwarder returns a struct that tracks and port-forwards pods as they are created and modified
func (*PortForwarder) Start ¶ added in v0.14.0
func (p *PortForwarder) Start(ctx context.Context) error
Start begins a pod watcher that port forwards any pods involving containers with exposed ports. TODO(r2d4): merge this event loop with pod watcher from log writer
func (*PortForwarder) Stop ¶ added in v0.21.0
func (p *PortForwarder) Stop()
Stop terminates all kubectl port-forward commands.