...
1 package platform
2
3 import (
4 "context"
5 "io"
6
7 corev1 "k8s.io/api/core/v1"
8 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
9 "k8s.io/apimachinery/pkg/watch"
10 )
11
12
13 type Client interface {
14
15
16
17 ExecCMDInContainer(ctx context.Context, containerName, podName string, cmd []string, stdout, stderr io.Writer, stdin io.Reader, tty bool) error
18
19
20
21 GetPodLogs(podName, containerName string, followLog bool) (io.ReadCloser, error)
22
23
24 GetPodsMatchingSelector(selector string) (*corev1.PodList, error)
25
26
27 GetAllResourcesFromSelector(selector string, ns string) ([]unstructured.Unstructured, error)
28
29
30 GetAllPodsInNamespaceMatchingSelector(selector string, ns string) (*corev1.PodList, error)
31
32
33
34 GetRunningPodFromSelector(selector string) (*corev1.Pod, error)
35
36 GetPodUsingComponentName(componentName string) (*corev1.Pod, error)
37
38 PodWatcher(ctx context.Context, selector string) (watch.Interface, error)
39 }
40
View as plain text