patches

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Kind is the kind for this function.
	Kind = "Patch"
)

Variables

This section is empty.

Functions

func Filter

func Filter() kio.Filter

Filter returns a filter for the Patches Fn

Types

type PatchFn

type PatchFn struct {
	// Kind is the API name.  Must be PodEnvs.
	Kind string `yaml:"kind"`

	// APIVersion is the API version.  Must be examples.kpt.dev/v1alpha1
	APIVersion string `yaml:"apiVersion"`

	// Metadata defines instance metadata.
	Metadata v1alpha1.Metadata `yaml:"metadata"`

	// Spec defines the desired declarative configuration.
	Spec Spec `yaml:"spec"`
}

PatchFn is a filter to apply patches to resources. The patches can be either strategic merge patch or JSON6902 patches. Patches can be targeted to resources a number of ways (name, matching resource type, labels). This allows for bulk applying a patch to multiple resources. The semantics should be the same as kustomize's patch transform:

https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/

This is based on the Patch struct used in kustomize to represent it https://github.com/kubernetes-sigs/kustomize/blob/f61b075d3bd670b7bcd5d58ce13e88a6f25977f2/api/types/patch.go

func (PatchFn) Filter

func (f PatchFn) Filter(items []*kYaml.RNode) ([]*kYaml.RNode, error)

Filter applies the filter to the nodes.

type Spec

type Spec struct {
	// Patches is the content of the patches to apply
	Patches []string `json:"patches,omitempty" yaml:"patches,omitempty"`

	// Target points to the resources that the patch is applied to
	Selector *framework.Selector `json:"selector,omitempty" yaml:"selector,omitempty"`
}

Spec is the spec for PatchFn.

Jump to

Keyboard shortcuts

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