manifest

package
v1.35.0-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigConnectorResourceSelector = []GroupKindSelector{

	&wildcardGroupKind{Group: regexp.MustCompile(`([[:alpha:]]+\.)+cnrm\.cloud\.google\.com`)},
}

ConfigConnectorResourceSelector provides a resource selector for Google Cloud Config Connector resources See https://cloud.google.com/config-connector/docs/overview

View Source
var ManifestTmpDir = filepath.Join(os.TempDir(), manifestsStagingFolder)

Functions

func AddTransform

func AddTransform(newTransform Transform)

AddTransform adds a transform to be applied when deploying.

func DownloadFromGCS

func DownloadFromGCS(manifests []string) (string, error)

DownloadFromGCS downloads all provided manifests from a remote GCS bucket, and returns a relative path pointing to the GCS temp dir.

func Write

func Write(manifests string, output string, manifestOut io.Writer) error

Write writes manifests to a file, a writer or a GCS bucket.

Types

type FieldVisitor

type FieldVisitor interface {
	// Visit is called for each transformable key contained in the object and may apply transformations/aggregations on it.
	// It should return true to allow recursive traversal or false when the entry was transformed.
	Visit(object map[string]interface{}, key string, value interface{}) bool
}

FieldVisitor represents the aggregation/transformation that should be performed on each traversed field.

type GroupKindSelector added in v1.34.1

type GroupKindSelector interface {
	Matches(group, kind string) bool
}

type ManifestList

type ManifestList [][]byte

ManifestList is a list of yaml manifests.

func ApplyTransforms

func ApplyTransforms(manifests ManifestList, builds []graph.Artifact, insecureRegistries map[string]bool, debugHelpersRegistry string) (ManifestList, error)

ApplyTransforms applies all manifests transforms to the provided manifests.

func Load

func Load(in io.Reader) (ManifestList, error)

Load uses the Kubernetes `apimachinery` to split YAML content into a set of YAML documents.

func (*ManifestList) Append

func (l *ManifestList) Append(buf []byte)

Append appends the yaml manifests defined in the given buffer. `buf` can contain concatenated manifests without `---` separators because `kubectl create --dry-run -oyaml` produces such output.

func (*ManifestList) CollectNamespaces

func (l *ManifestList) CollectNamespaces() ([]string, error)

CollectNamespaces returns all the namespaces in the manifests.

func (*ManifestList) Diff

func (l *ManifestList) Diff(latest ManifestList) ManifestList

Diff computes the list of manifests that have changed.

func (*ManifestList) Filter added in v1.34.1

func (l *ManifestList) Filter(selectors ...GroupKindSelector) (ManifestList, error)

Filter returns the manifest list that match any of the given `GroupKindSelector` items

func (*ManifestList) GetImages

func (l *ManifestList) GetImages() ([]graph.Artifact, error)

GetImages gathers a map of base image names to the image with its tag

func (*ManifestList) Reader

func (l *ManifestList) Reader() io.Reader

Reader returns a reader on the raw yaml descriptors.

func (*ManifestList) ReplaceImages

func (l *ManifestList) ReplaceImages(ctx context.Context, builds []graph.Artifact) (ManifestList, error)

ReplaceImages replaces image names in a list of manifests. It doesn't replace images that are referenced by digest.

func (*ManifestList) ReplaceRemoteManifestImages added in v1.30.0

func (l *ManifestList) ReplaceRemoteManifestImages(ctx context.Context, builds []graph.Artifact) (ManifestList, error)

ReplaceRemoteManifestImages replaces all image names in a list containing remote manifests. This will even override images referenced by digest or with a different repository

func (*ManifestList) SelectResources added in v1.34.1

func (l *ManifestList) SelectResources(selectors ...GroupKindSelector) ([]unstructured.Unstructured, error)

SelectResources returns the resources defined in the manifest list that match any of the given `GroupKindSelector` items

func (*ManifestList) SetLabels

func (l *ManifestList) SetLabels(labels map[string]string) (ManifestList, error)

SetLabels add labels to a list of Kubernetes manifests.

func (*ManifestList) String

func (l *ManifestList) String() string

func (*ManifestList) Visit

func (l *ManifestList) Visit(visitor FieldVisitor) (ManifestList, error)

Visit recursively visits all transformable object fields within the manifests and lets the visitor apply transformations/aggregations on them.

type Registries

type Registries struct {
	InsecureRegistries   map[string]bool
	DebugHelpersRegistry string
}

type Transform

type Transform func(l ManifestList, builds []graph.Artifact, registries Registries) (ManifestList, error)

func GetTransforms

func GetTransforms() []Transform

GetTransforms returns all manifest transforms.

Jump to

Keyboard shortcuts

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