Documentation ¶
Index ¶
- func AllTerminated(containerStatuses []v1.ContainerStatus, containerNames []string) bool
- func CopyArchive(ctx context.Context, c KubernetesClientInterface, ...) error
- func GetContainerID(container string) string
- func KillGracefully(ctx context.Context, c KubernetesClientInterface, containerNames []string, ...) error
- func TerminatePodWithContainerNames(ctx context.Context, c KubernetesClientInterface, containerNames []string, ...) error
- func WaitForTermination(ctx context.Context, c KubernetesClientInterface, containerNames []string, ...) error
- type KubernetesClientInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllTerminated ¶
func AllTerminated(containerStatuses []v1.ContainerStatus, containerNames []string) bool
func CopyArchive ¶
func CopyArchive(ctx context.Context, c KubernetesClientInterface, containerName, sourcePath, destPath string) error
CopyArchive downloads files and directories as a tarball and saves it to a specified path.
func GetContainerID ¶
GetContainerID returns container ID of a ContainerStatus resource
func KillGracefully ¶
func KillGracefully(ctx context.Context, c KubernetesClientInterface, containerNames []string, terminationGracePeriodDuration time.Duration) error
KillGracefully kills a container gracefully.
func TerminatePodWithContainerNames ¶
func TerminatePodWithContainerNames(ctx context.Context, c KubernetesClientInterface, containerNames []string, sig syscall.Signal) error
TerminatePodWithContainerNames invoke the given SIG against the PID1 of the container. No-op if the container is on the hostPID
func WaitForTermination ¶
func WaitForTermination(ctx context.Context, c KubernetesClientInterface, containerNames []string, timeout time.Duration) error
WaitForTermination of the given containerName, set the timeout to 0 to discard it
Types ¶
type KubernetesClientInterface ¶
type KubernetesClientInterface interface { GetContainerStatuses(ctx context.Context) (*v1.Pod, []v1.ContainerStatus, error) KillContainer(pod *v1.Pod, container *v1.ContainerStatus, sig syscall.Signal) error CreateArchive(ctx context.Context, containerName, sourcePath string) (*bytes.Buffer, error) }
KubernetesClientInterface is the interface to implement getContainerStatus method
Click to show internal directories.
Click to hide internal directories.