Documentation ¶
Index ¶
- func FindFlagValueRaw(command []string, flag string) []string
- func FindInnerValue(values []string, flag string) []string
- func GetCommandOptionFromDeployment(ctx context.Context, c client.Client, ...) ([]string, error)
- func GetContainerFromDeployment(deployment *appsv1.Deployment, containerName string) (container corev1.Container, found bool)
- func GetContainerFromStatefulSet(statefulSet *appsv1.StatefulSet, containerName string) (container corev1.Container, found bool)
- func GetFileDataFromVolume(ctx context.Context, c client.Client, namespace string, volume corev1.Volume, ...) ([]byte, error)
- func GetKubeletCommand(ctx context.Context, podExecutor pod.PodExecutor) (string, error)
- func GetKubeletConfig(ctx context.Context, podExecutor pod.PodExecutor, rawKubeletCommand string) (*config.KubeletConfig, error)
- func GetNamespaces(ctx context.Context, c client.Client) (map[string]corev1.Namespace, error)
- func GetNodeConfigz(ctx context.Context, coreV1RESTClient rest.Interface, nodeName string) (*config.KubeletConfig, error)
- func GetNodes(ctx context.Context, c client.Client, limit int64) ([]corev1.Node, error)
- func GetObjectsMetadata(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, ...) ([]metav1.PartialObjectMetadata, error)
- func GetPodSecurityPolicies(ctx context.Context, c client.Client, limit int64) ([]policyv1beta1.PodSecurityPolicy, error)
- func GetPods(ctx context.Context, c client.Client, namespace string, ...) ([]corev1.Pod, error)
- func GetVolumeConfigByteSliceByMountPath(ctx context.Context, c client.Client, deployment *appsv1.Deployment, ...) ([]byte, error)
- func GetVolumeFromDeployment(deployment *appsv1.Deployment, volumeName string) (volume corev1.Volume, found bool)
- func GetVolumeFromStatefulSet(statefulSet *appsv1.StatefulSet, volumeName string) (volume corev1.Volume, found bool)
- func IsFlagSet(rawCommand, option string) bool
- func NodeReadyStatus(node corev1.Node) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindFlagValueRaw ¶
FindFlagValueRaw returns the value of a specific flag in a commands slice. The following flag representations are supported:
--flag=foo --flag foo --flag -flag=foo -flag foo -flag
Notable ambiguous behavior:
--flag="foo" -> `"foo"` --flag=foo --flag2=bar -> "foo --flag2=bar" --flag= foo -> "foo" --flag= -> ""
func FindInnerValue ¶
FindInnerValue returns the value of a specific flag when the format is flag1=value1,flag3=value3,flag3=value3
func GetCommandOptionFromDeployment ¶
func GetCommandOptionFromDeployment(ctx context.Context, c client.Client, deploymentName, containerName, namespace, option string) ([]string, error)
GetCommandOptionFromDeployment returns command and args from a specific deployment container.
func GetContainerFromDeployment ¶
func GetContainerFromDeployment(deployment *appsv1.Deployment, containerName string) (container corev1.Container, found bool)
GetContainerFromDeployment returns a container object with a specific cainerName, if such container is not present it retuns found=false
func GetContainerFromStatefulSet ¶
func GetContainerFromStatefulSet(statefulSet *appsv1.StatefulSet, containerName string) (container corev1.Container, found bool)
GetContainerFromStatefulSet returns a container object with a specific cainerName, if such container is not present it retuns found=false
func GetFileDataFromVolume ¶
func GetFileDataFromVolume(ctx context.Context, c client.Client, namespace string, volume corev1.Volume, fileName string) ([]byte, error)
GetFileDataFromVolume returns byte slice of the value of a specific Data field in a ConfigMap or Secret volume
func GetKubeletCommand ¶
GetKubeletCommand returns the used kubelet command
func GetKubeletConfig ¶
func GetKubeletConfig(ctx context.Context, podExecutor pod.PodExecutor, rawKubeletCommand string) (*config.KubeletConfig, error)
GetKubeletConfig returns the kubelet config specified in the kubelet command's option `--config`
func GetNamespaces ¶
GetNamespaces returns a map containing all namespaces, where the names of the namespaces are used as a keys.
func GetNodeConfigz ¶
func GetNodeConfigz(ctx context.Context, coreV1RESTClient rest.Interface, nodeName string) (*config.KubeletConfig, error)
GetNodeConfigz returns the runtime kubelet config
func GetObjectsMetadata ¶
func GetObjectsMetadata(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, namespace string, selector labels.Selector, limit int64) ([]metav1.PartialObjectMetadata, error)
GetObjectsMetadata returns the object metadata for all resources of a given group version kind for a namespace, or all namespaces if it's set to "". It retrieves objects by portions set by limit.
func GetPodSecurityPolicies ¶
func GetPodSecurityPolicies(ctx context.Context, c client.Client, limit int64) ([]policyv1beta1.PodSecurityPolicy, error)
GetPodSecurityPolicies returns all pod security policies. It retrieves policies by portions set by limit.
func GetPods ¶
func GetPods(ctx context.Context, c client.Client, namespace string, selector labels.Selector, limit int64) ([]corev1.Pod, error)
GetPods return all pods for a given namespace, or all namespaces if it's set to empty string "". It retrieves pods by portions set by limit.
func GetVolumeConfigByteSliceByMountPath ¶
func GetVolumeConfigByteSliceByMountPath(ctx context.Context, c client.Client, deployment *appsv1.Deployment, containerName, mountPath string) ([]byte, error)
GetVolumeConfigByteSliceByMountPath returns the byte slice data of a specific volume in a deployment by the volumes mountPath and containerName
func GetVolumeFromDeployment ¶
func GetVolumeFromDeployment(deployment *appsv1.Deployment, volumeName string) (volume corev1.Volume, found bool)
GetVolumeFromDeployment returns a volume object with a specific volumeName, if such volume is not present it retuns found=false
func GetVolumeFromStatefulSet ¶
func GetVolumeFromStatefulSet(statefulSet *appsv1.StatefulSet, volumeName string) (volume corev1.Volume, found bool)
GetVolumeFromStatefulSet returns a volume object with a specific volumeName, if such volume is not present it retuns found=false
func NodeReadyStatus ¶
NodeReadyStatus returns true if the given node has NodeReady status condition true and false in every other case.
Types ¶
This section is empty.