fieldpath

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2017 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractContainerResourceValue added in v1.3.0

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 added in v1.3.0

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 added in v1.4.0

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 added in v1.3.0

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

formatMap formats map[string]string to a string.

func MergeContainerResourceLimits added in v1.4.0

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL