patch

package
v0.3.20 Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONPatchOperation

type JSONPatchOperation struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value,omitempty"`
}

A JSON Patch operation as defined in https://tools.ietf.org/html/rfc6902

func BuildSidecarPatch

func BuildSidecarPatch(pod *corev1.Pod, configMap *corev1.ConfigMap, templateData interface{}) ([]JSONPatchOperation, error)

This function expects the given config map to contain one entry under it's data element. The entry is expected to contain raw YAML representing a PodSpec. The YAML will be rendered as a template using the given data and used to build a slice of JSONPatch operations to be applied to the given pod.

Currently only the 'containers' and 'initContainers' elements in the configMap are considered. The patch operations that are returned will append them to the correspondent elements in the target pod.

Jump to

Keyboard shortcuts

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