...

Source file src/github.com/redhat-developer/odo/pkg/platform/interface.go

Documentation: github.com/redhat-developer/odo/pkg/platform

     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  // Client is the interface that wraps operations that can be performed on any supported platform.
    13  type Client interface {
    14  
    15  	// ExecCMDInContainer executes the specified command in the container of a pod.
    16  	// If an empty string is passed as container name, the command will be executed in the first container found in the pod.
    17  	ExecCMDInContainer(ctx context.Context, containerName, podName string, cmd []string, stdout, stderr io.Writer, stdin io.Reader, tty bool) error
    18  
    19  	// GetPodLogs returns the logs of the specified pod container.
    20  	// All logs for all containers part of the pod are returned if an empty string is provided as container name.
    21  	GetPodLogs(podName, containerName string, followLog bool) (io.ReadCloser, error)
    22  
    23  	// GetPodsMatchingSelector returns all pods matching the given label selector.
    24  	GetPodsMatchingSelector(selector string) (*corev1.PodList, error)
    25  
    26  	// GetAllResourcesFromSelector returns all resources of any kind matching the given label selector.
    27  	GetAllResourcesFromSelector(selector string, ns string) ([]unstructured.Unstructured, error)
    28  
    29  	// GetAllPodsInNamespaceMatchingSelector returns all pods matching the given label selector and in the specified namespace.
    30  	GetAllPodsInNamespaceMatchingSelector(selector string, ns string) (*corev1.PodList, error)
    31  
    32  	// GetRunningPodFromSelector returns any pod matching the given label selector.
    33  	// If multiple pods are found, implementations might have different behavior, by either returning an error or returning any element.
    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