deploymentpatch

package
v0.0.0-...-104c275 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: AGPL-3.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 DeploymentPatch

type DeploymentPatch struct {
	// contains filtered or unexported fields
}

DeploymentPatch is used to modify a Deployment resource using jsonpatch

func New

func New(deployment appsv1.Deployment) *DeploymentPatch

New creates a new DeploymentPatch object

func (*DeploymentPatch) AppendToAnnotations

func (d *DeploymentPatch) AppendToAnnotations(config map[string]string)

AppendToAnnotations adds given map of annotations to the deployment

func (*DeploymentPatch) AppendToLabels

func (d *DeploymentPatch) AppendToLabels(config map[string]string)

AppendToLabels appends the given map of labels to the deployment

func (*DeploymentPatch) AppendToPodAnnotations

func (d *DeploymentPatch) AppendToPodAnnotations(config map[string]string)

AppendToPodAnnotations adds given map of annotations to the pod template

func (*DeploymentPatch) AppendToPodEnvironment

func (d *DeploymentPatch) AppendToPodEnvironment(config map[string]string)

AppendToPodEnvironment adds the map of environment variables to all containers and initContainers that are in the original podspec

func (*DeploymentPatch) AppendToPodLabels

func (d *DeploymentPatch) AppendToPodLabels(config map[string]string)

AppendToPodLabels appends the given map of labels to the pod template

func (*DeploymentPatch) GetPatch

func (d *DeploymentPatch) GetPatch() []PatchOperation

GetPatch returns the resulting array of PatchOperation objects

func (*DeploymentPatch) GetPatchBytes

func (d *DeploymentPatch) GetPatchBytes() ([]byte, error)

GetPatchBytes returns the resulting jsonPatch

func (*DeploymentPatch) PrependToPodInitContainers

func (d *DeploymentPatch) PrependToPodInitContainers(container corev1.Container)

PrependToPodInitContainers prepends an init container to the template

type PatchOperation

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

PatchOperation represents a single jsonpatch operation.

Jump to

Keyboard shortcuts

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