update

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SetterShortHand is a shorthand that can be used to mark
	// setters; instead of
	// # { "$ref": "#/definitions/
	SetterShortHand = "$imagepolicy"
)

Variables

This section is empty.

Functions

func UpdateWithSetters

func UpdateWithSetters(inpath, outpath string, policies []imagev1alpha1_reflect.ImagePolicy) error

UpdateWithSetters takes all YAML files from `inpath`, updates any that contain an "in scope" image policy marker, and writes files it updated (and only those files) back to `outpath`.

Types

type ScreeningLocalReader added in v0.2.0

type ScreeningLocalReader struct {
	Token string
	Path  string

	// This records the relative path of each file that passed
	// screening (i.e., contained the token), but couldn't be parsed.
	ProblemFiles []string
}

ScreeningReader is a kio.Reader that includes only files that are pertinent to automation. In practice this means looking for a particular token in each file, and ignoring those files without the token. This avoids most problematic cases -- e.g., templates in a Helm chart, which won't parse as YAML -- and cheaply filters for only those files that need processing.

func (*ScreeningLocalReader) Read added in v0.2.0

func (r *ScreeningLocalReader) Read() ([]*yaml.RNode, error)

Read scans the .Path recursively for files that contain .Token, and parses any that do. It applies the filename annotation used by [`kio.LocalPackageWriter`](https://godoc.org/sigs.k8s.io/kustomize/kyaml/kio#LocalPackageWriter) so that the same will write files back to their original location. The implementation follows that of [LocalPackageReader.Read](https://godoc.org/sigs.k8s.io/kustomize/kyaml/kio#LocalPackageReader.Read), adapting lightly (mainly to leave features out).

Jump to

Keyboard shortcuts

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