Documentation ¶
Index ¶
- func NewUUIDString() (string, error)
- func RandString(length int) string
- type Service
- func (svc *Service) BuildEphemeralScannerContainer(name string, image string, targetHost string, targetPort string, ...) (*corev1.EphemeralContainer, error)
- func (svc *Service) BuildEphemeralSnifferContainer(name string, image string, search string, snapLen int, protocol string, ...) (*corev1.EphemeralContainer, error)
- func (svc *Service) CheckEphemeralContainerSupport(ctx context.Context) error
- func (svc *Service) GetExitStatusOfEphemeralContainer(ctx context.Context, containerName string, timeOut time.Duration, ...) (int, error)
- func (svc *Service) GetPod(ctx context.Context, name, namespace string) (*corev1.Pod, error)
- func (svc *Service) GetPodInDaemonSet(ctx context.Context, name, namespace string) (*corev1.Pod, error)
- func (svc *Service) GetPodInDeployment(ctx context.Context, name, namespace string) (*corev1.Pod, error)
- func (svc *Service) GetPodInStatefulSet(ctx context.Context, name, namespace string) (*corev1.Pod, error)
- func (svc *Service) LaunchEphemeralContainerInPod(ctx context.Context, pod *corev1.Pod, ec *corev1.EphemeralContainer) (*corev1.Pod, string, error)
- func (svc *Service) PingHealthEndpoint(ctx context.Context, endpoint string) error
- func (svc *Service) WaitForPodInResourceReady(name, namespace, resourceType string, poll, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewUUIDString ¶
NewUUIDString - generates a new UUID and converts it to string
func RandString ¶
RandString - generates random string with length
Types ¶
type Service ¶
type Service struct { Client kubernetes.Interface // kubernetes client-set Log hclog.Logger // logger embedded in our service }
Service exposes the operations on various K8s resources
func New ¶
func New(client kubernetes.Interface, l hclog.Logger) *Service
New - builds a new Service that can interface with Kubernetes
func NewDefaultService ¶
NewDefaultService - builds a new Service looking for a KubeConfig in various locations
func NewServiceFromKubeConfigFile ¶
NewServiceFromKubeConfigFile - builds a new Service using KubeConfig file location passed by the caller
func (*Service) BuildEphemeralScannerContainer ¶
func (svc *Service) BuildEphemeralScannerContainer( name string, image string, targetHost string, targetPort string, protocol string, message string, attempts int, ) (*corev1.EphemeralContainer, error)
BuildEphemeralScannerContainer - builds an ephemeral scanner container
func (*Service) BuildEphemeralSnifferContainer ¶
func (svc *Service) BuildEphemeralSnifferContainer( name string, image string, search string, snapLen int, protocol string, numberMatches int, intFace string, timeoutSec int, ) (*corev1.EphemeralContainer, error)
BuildEphemeralSnifferContainer - builds an ephemeral sniffer container
func (*Service) CheckEphemeralContainerSupport ¶
CheckEphemeralContainerSupport - Checks support for ephemeral containers
func (*Service) GetExitStatusOfEphemeralContainer ¶
func (svc *Service) GetExitStatusOfEphemeralContainer( ctx context.Context, containerName string, timeOut time.Duration, podName string, podNamespace string, ) (int, error)
GetExitStatusOfEphemeralContainer - returns the exit status of an EphemeralContainer in a pod
func (*Service) GetPodInDaemonSet ¶
func (svc *Service) GetPodInDaemonSet(ctx context.Context, name, namespace string) (*corev1.Pod, error)
GetPodInDaemonSet - Returns a running Pod with IP address in a DaemonSet
func (*Service) GetPodInDeployment ¶
func (svc *Service) GetPodInDeployment(ctx context.Context, name, namespace string) (*corev1.Pod, error)
GetPodInDeployment - Returns a running Pod in a deployment
func (*Service) GetPodInStatefulSet ¶
func (svc *Service) GetPodInStatefulSet(ctx context.Context, name, namespace string) (*corev1.Pod, error)
GetPodInStatefulSet - Returns a running Pod in a statefulset
func (*Service) LaunchEphemeralContainerInPod ¶
func (svc *Service) LaunchEphemeralContainerInPod( ctx context.Context, pod *corev1.Pod, ec *corev1.EphemeralContainer, ) (*corev1.Pod, string, error)
LaunchEphemeralContainerInPod - Launches an ephemeral container in running Pod
func (*Service) PingHealthEndpoint ¶
PingHealthEndpoint - pings a single endpoint of the apiServer using HTTP