Documentation ¶
Index ¶
- func ConvertDownwardAPIFieldLabel(version, label, value string) (string, string, error)
- func ExtractFieldPathAsString(obj interface{}, fieldPath string) (string, error)
- func FindStatusCondition(conditions []corev1.PodCondition, conditionType corev1.PodConditionType) *corev1.PodCondition
- func FormatMap(m map[string]string) (fmtStr string)
- func FromEndpoints(endpoints []*corev1.Endpoints) []corev1.EnvVar
- func IsServiceIPSet(service *corev1.Service) bool
- func IsStatusConditionFalse(conditions []corev1.PodCondition, conditionType corev1.PodConditionType) bool
- func IsStatusConditionPresentAndEqual(conditions []corev1.PodCondition, conditionType corev1.PodConditionType, ...) bool
- func IsStatusConditionTrue(conditions []corev1.PodCondition, conditionType corev1.PodConditionType) bool
- func RemoveStatusCondition(conditions *[]metav1.Condition, conditionType string)
- func SetPodStatusCondition(conditions *[]corev1.PodCondition, newCondition corev1.PodCondition)
- func SplitMaybeSubscriptedPath(fieldPath string) (string, string, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertDownwardAPIFieldLabel ¶
ConvertDownwardAPIFieldLabel converts the specified downward API field label and its value in the pod of the specified version to the internal version, and returns the converted label and value. This function returns an error if the conversion fails.
func ExtractFieldPathAsString ¶
ExtractFieldPathAsString extracts the field from the given object and returns it as a string. The object must be a pointer to an API type.
func FindStatusCondition ¶
func FindStatusCondition(conditions []corev1.PodCondition, conditionType corev1.PodConditionType) *corev1.PodCondition
FindStatusCondition finds the conditionType in conditions.
func FromEndpoints ¶
FromEndpoints builds environment variables that a container is started with, which tell the container where to find the services it may need, which are provided as an argument.
func IsServiceIPSet ¶
IsServiceIPSet aims to check if the service's ClusterIP is set or not the objective is not to perform validation here
func IsStatusConditionFalse ¶
func IsStatusConditionFalse(conditions []corev1.PodCondition, conditionType corev1.PodConditionType) bool
IsStatusConditionFalse returns true when the conditionType is present and set to `metav1.ConditionFalse`
func IsStatusConditionPresentAndEqual ¶
func IsStatusConditionPresentAndEqual(conditions []corev1.PodCondition, conditionType corev1.PodConditionType, status corev1.ConditionStatus) bool
IsStatusConditionPresentAndEqual returns true when conditionType is present and equal to status.
func IsStatusConditionTrue ¶
func IsStatusConditionTrue(conditions []corev1.PodCondition, conditionType corev1.PodConditionType) bool
IsStatusConditionTrue returns true when the conditionType is present and set to `metav1.ConditionTrue`
func RemoveStatusCondition ¶
RemoveStatusCondition removes the corresponding conditionType from conditions. conditions must be non-nil.
func SetPodStatusCondition ¶
func SetPodStatusCondition(conditions *[]corev1.PodCondition, newCondition corev1.PodCondition)
SetPodStatusCondition sets the corresponding condition in conditions to newCondition. conditions must be non-nil.
- if the condition of the specified type already exists (all fields of the existing condition are updated to newCondition, LastTransitionTime is set to now if the new status differs from the old status)
- if a condition of the specified type does not exist (LastTransitionTime is set to now() if unset, and newCondition is appended)
func SplitMaybeSubscriptedPath ¶
SplitMaybeSubscriptedPath checks whether the specified fieldPath is subscripted, and
- if yes, this function splits the fieldPath into path and subscript, and returns (path, subscript, true).
- if no, this function returns (fieldPath, "", false).
Example inputs and outputs:
- "metadata.annotations['myKey']" --> ("metadata.annotations", "myKey", true)
- "metadata.annotations['a[b]c']" --> ("metadata.annotations", "a[b]c", true)
- "metadata.labels[”]" --> ("metadata.labels", "", true)
- "metadata.labels" --> ("metadata.labels", "", false)
Types ¶
This section is empty.