Documentation ¶
Index ¶
- func ExtractContainerResourceValue(fs *v1.ResourceFieldSelector, container *v1.Container) (string, error)
- func ExtractFieldPathAsString(obj interface{}, fieldPath string) (string, error)
- func FormatMap(m map[string]string) (fmtStr string)
- func GetEnvVarRefString(from *corev1.EnvVarSource) string
- func GetEnvVarRefValue(kc kubernetes.Interface, ns string, store *ResourceStore, ...) (string, error)
- func SplitMaybeSubscriptedPath(fieldPath string) (string, string, bool)
- type ResourceStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractContainerResourceValue ¶
func ExtractContainerResourceValue(fs *v1.ResourceFieldSelector, container *v1.Container) (string, error)
ExtractContainerResourceValue extracts the value of a resource in an already known container
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 GetEnvVarRefString ¶
func GetEnvVarRefString(from *corev1.EnvVarSource) string
GenEnvVarRefString returns a text description of the supplied EnvVarSource
func GetEnvVarRefValue ¶
func GetEnvVarRefValue(kc kubernetes.Interface, ns string, store *ResourceStore, from *corev1.EnvVarSource, obj runtime.Object, c *corev1.Container) (string, error)
GenEnvVarRefValue returns the value referenced by the supplied EnvVarSource given the other supplied information
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 ¶
type ResourceStore ¶
type ResourceStore struct { SecretStore map[string]*corev1.Secret ConfigMapStore map[string]*corev1.ConfigMap }
ResourceStore defines a new resource store data structure
func NewResourceStore ¶
func NewResourceStore() *ResourceStore
NewResourceStore returns a pointer to a new resource store data structure