Documentation
¶
Index ¶
- Variables
- func AddManagedLabel(labels map[string]string) map[string]string
- func ConvertKeyValueToMap(kvList []types.KeyValue) map[string]string
- func ConvertMapToKeyValue(values map[string]string) []types.KeyValue
- func GetEnvBool(key string, defaultValue bool) (bool, error)
- func GetEnvNumber(key string, defaultValue int) (int, error)
- func GetPodLogStream(ctx context.Context, client kubernetes.Interface, ...) (io.ReadCloser, error)
- func GetPodsByLabel(ctx context.Context, client kubernetes.Interface, ...) (*corev1.PodList, error)
- func IsPodInPodList(podName string, pods *corev1.PodList) bool
- func ParseIntStr(intStr string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
var ( ManagedLabel = cappAPIGroup + "/managed" ManagedLabelValue = "true" ManagedLabelSelector = fmt.Sprintf("%s=%s", ManagedLabel, ManagedLabelValue) ParentCappLabel = cappAPIGroup + "/parent-capp" ParentCappNSLabel = cappAPIGroup + "/parent-capp-ns" ParentCappLabelSelector = ParentCappLabel + "=%s" PlacementEnvironmentKey = "environment" PlacementRegionKey = "region" PlacementEnvironmentLabel = cappAPIGroup + "/" + PlacementEnvironmentKey PlacementRegionLabel = cappAPIGroup + "/" + PlacementRegionKey CappNameLabel = cappAPIGroup + "/cappName" CappNameLabelSelector = CappNameLabel + "=%s" )
Functions ¶
func AddManagedLabel ¶
AddManagedLabel adds the managed label to the given labels map.
func ConvertKeyValueToMap ¶
ConvertKeyValueToMap converts a slice of KeyValue pairs to a map with string keys and values.
func ConvertMapToKeyValue ¶
ConvertMapToKeyValue converts a map with string keys and values to a slice of KeyValue pairs.
func GetEnvBool ¶
GetEnvBool retrieves the value of the environment variable named by the key. If the variable is empty or not set, it returns the default value.
func GetEnvNumber ¶
GetEnvNumber retrieves the value of the environment variable named by the key. If the variable is empty or not set, it returns the default value.
func GetPodLogStream ¶
func GetPodLogStream(ctx context.Context, client kubernetes.Interface, namespace, podName, containerName string, previous bool) (io.ReadCloser, error)
GetPodLogStream returns the logs of a container in a pod.
func GetPodsByLabel ¶
func GetPodsByLabel(ctx context.Context, client kubernetes.Interface, namespace, labelSelector string, listOptions metav1.ListOptions) (*corev1.PodList, error)
GetPodsByLabel returns the pods in a namespace using a given label selector.
func IsPodInPodList ¶
IsPodInPodList checks if a pod with the given name exists in the provided list of pods.
func ParseIntStr ¶
ParseIntStr parses a string into an int64 number.
Types ¶
This section is empty.