patchstrategicmerge

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Overview

Package patchstrategicmerge contains a kio.Filter implementation of the kustomize strategic merge patch transformer.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Patch *yaml.RNode
}
Example
err := kio.Pipeline{
	Inputs: []kio.Reader{&kio.ByteReader{Reader: bytes.NewBufferString(`
apiVersion: example.com/v1
kind: Foo
metadata:
  name: instance
spec:
  replicas: 3
`)}},
	Filters: []kio.Filter{Filter{
		Patch: yaml.MustParse(`
spec:
  template:
    containers:
    - image: nginx
`),
	}},
	Outputs: []kio.Writer{kio.ByteWriter{Writer: os.Stdout}},
}.Execute()
if err != nil {
	log.Fatal(err)
}
Output:

apiVersion: example.com/v1
kind: Foo
metadata:
  name: instance
spec:
  replicas: 3
  template:
    containers:
    - image: nginx

func (Filter) Filter

func (pf Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error)

Filter does a strategic merge patch, which can delete nodes.

Jump to

Keyboard shortcuts

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