kubernetesk8s.io/kubernetes/pkg/fieldpath Index | Files

package fieldpath

import "k8s.io/kubernetes/pkg/fieldpath"

Package fieldpath supplies methods for extracting fields from objects given a path to a field.

Index

Functions

func ExtractContainerResourceValue

func ExtractContainerResourceValue(fs *api.ResourceFieldSelector, container *api.Container) (string, error)

ExtractContainerResourceValue extracts the value of a resource in an already known container

func ExtractFieldPathAsString

func ExtractFieldPathAsString(obj interface{}, fieldPath string) (string, error)

ExtractFieldPathAsString extracts the field from the given object and returns it as a string. The object must be a pointer to an API type.

Currently, this API is limited to supporting the fieldpaths:

1. metadata.name - The name of an API object 2. metadata.namespace - The namespace of an API object

func ExtractResourceValueByContainerName

func ExtractResourceValueByContainerName(fs *api.ResourceFieldSelector, pod *api.Pod, containerName string) (string, error)

ExtractResourceValueByContainerName extracts the value of a resource by providing container name

func ExtractResourceValueByContainerNameAndNodeAllocatable

func ExtractResourceValueByContainerNameAndNodeAllocatable(fs *api.ResourceFieldSelector, pod *api.Pod, containerName string, nodeAllocatable api.ResourceList) (string, error)

ExtractResourceValueByContainerNameAndNodeAllocatable extracts the value of a resource by providing container name and node allocatable

func FormatMap

func FormatMap(m map[string]string) (fmtStr string)

formatMap formats map[string]string to a string.

func MergeContainerResourceLimits

func MergeContainerResourceLimits(container *api.Container,
	allocatable api.ResourceList)

MergeContainerResourceLimits checks if a limit is applied for the container, and if not, it sets the limit to the passed resource list.

Source Files

doc.go fieldpath.go

Version
v1.5.0-alpha.0
Published
Sep 1, 2016
Platform
js/wasm
Imports
7 packages
Last checked
6 minutes ago

Tools for package owners.