patches

package
v1.32.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// KubeletConfiguration defines the kubeletconfiguration patch target.
	KubeletConfiguration = "kubeletconfiguration"
	// CoreDNSDeployment defines the corednsdeployment patch target.
	CoreDNSDeployment = "corednsdeployment"
)

Variables

This section is empty.

Functions

func KnownTargets added in v1.25.0

func KnownTargets() []string

KnownTargets returns the locally defined knownTargets.

Types

type PatchManager

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

PatchManager defines an object that can apply patches.

func GetPatchManagerForPath

func GetPatchManagerForPath(path string, knownTargets []string, output io.Writer) (*PatchManager, error)

GetPatchManagerForPath creates a patch manager that can be used to apply patches to "knownTargets". "path" should contain patches that can be used to patch the "knownTargets". If "output" is non-nil, messages about actions performed by the manager would go on this io.Writer.

func NewPatchManager added in v1.32.0

func NewPatchManager(patchSets []*PatchSet, knownTargets []string, output io.Writer) *PatchManager

NewPatchManager creates a patch manager that can be used to apply patches to "knownTargets".

func (*PatchManager) ApplyPatchesToTarget

func (pm *PatchManager) ApplyPatchesToTarget(patchTarget *PatchTarget) error

ApplyPatchesToTarget takes a patch target and patches its "Data" using the patches stored in the patch manager. The resulted "Data" is always converted to JSON.

type PatchSet added in v1.32.0

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

PatchSet defines a set of patches of a certain type that can patch a PatchTarget.

func CreatePatchSet added in v1.32.0

func CreatePatchSet(targetName string, patchType types.PatchType, data string) (*PatchSet, error)

CreatePatchSet creates a patchSet object, by splitting the given "data" by "\n---".

func (*PatchSet) String added in v1.32.0

func (ps *PatchSet) String() string

String() is used for unit-testing.

type PatchTarget

type PatchTarget struct {
	// Name must be the name of a known target. In the case of Kubernetes objects
	// this is likely to match the ObjectMeta.Name of a target.
	Name string

	// StrategicMergePatchObject is only used for strategic merge patches.
	// It represents the underlying object type that is patched - e.g. "v1.Pod"
	StrategicMergePatchObject interface{}

	// Data must contain the bytes that will be patched.
	Data []byte
}

PatchTarget defines a target to be patched, such as a control-plane static Pod.

Jump to

Keyboard shortcuts

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