manifestreader

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 16 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterLocalConfig added in v0.20.3

func FilterLocalConfig(objs []*unstructured.Unstructured) []*unstructured.Unstructured

FilterLocalConfig returns a new slice of Unstructured where all resources with the LocalConfig annotation is filtered out.

func KyamlNodeToUnstructured added in v0.26.0

func KyamlNodeToUnstructured(n *yaml.RNode) (*unstructured.Unstructured, error)

KyamlNodeToUnstructured take a resource represented as a kyaml RNode and turns it into an Unstructured object.

func RemoveAnnotations added in v0.26.0

func RemoveAnnotations(n *yaml.RNode, annotations ...kioutil.AnnotationKey) error

RemoveAnnotations removes the specified kioutil annotations from the resource.

func SetNamespaces added in v0.20.3

func SetNamespaces(mapper meta.RESTMapper, objs []*unstructured.Unstructured,
	defaultNamespace string, enforceNamespace bool) error

SetNamespaces verifies that every namespaced resource has the namespace set, and if one does not, it will set the namespace to the provided defaultNamespace. This implementation will check each resource (that doesn't already have the namespace set) on whether it is namespace or cluster scoped. It does this by first checking the RESTMapper, and it there is not match there, it will look for CRDs in the provided Unstructureds.

Types

type FakeLoader added in v0.28.0

type FakeLoader struct {
	Factory   util.Factory
	InvClient *inventory.FakeClient
}

func NewFakeLoader added in v0.22.0

func NewFakeLoader(f util.Factory, objs object.ObjMetadataSet) *FakeLoader

func (*FakeLoader) InventoryInfo added in v0.28.0

func (*FakeLoader) ManifestReader added in v0.28.0

func (f *FakeLoader) ManifestReader(reader io.Reader, _ string) (ManifestReader, error)

type ManifestLoader added in v0.22.0

type ManifestLoader interface {
	ManifestReader(reader io.Reader, path string) (ManifestReader, error)
}

ManifestLoader is an interface for reading and parsing the resources

func NewManifestLoader added in v0.22.0

func NewManifestLoader(f util.Factory) ManifestLoader

NewManifestLoader returns an instance of manifestLoader.

type ManifestReader

type ManifestReader interface {
	Read() ([]*unstructured.Unstructured, error)
}

ManifestReader defines the interface for reading a set of manifests into info objects.

type NamespaceMismatchError added in v0.26.0

type NamespaceMismatchError struct {
	RequiredNamespace string
	Namespace         string
}

NamespaceMismatchError is returned if all resources must be in a specific namespace, and resources are found using other namespaces.

func (*NamespaceMismatchError) Error added in v0.26.0

func (e *NamespaceMismatchError) Error() string

type PathManifestReader

type PathManifestReader struct {
	Path string

	ReaderOptions
}

PathManifestReader reads manifests from the provided path and returns them as Info objects. The returned Infos will not have client or mapping set.

func (*PathManifestReader) Read

Read reads the manifests and returns them as Info objects.

type ReaderOptions

type ReaderOptions struct {
	Mapper           meta.RESTMapper
	Validate         bool
	Namespace        string
	EnforceNamespace bool
}

ReaderOptions defines the shared inputs for the different implementations of the ManifestReader interface.

type StreamManifestReader

type StreamManifestReader struct {
	ReaderName string
	Reader     io.Reader

	ReaderOptions
}

StreamManifestReader reads manifest from the provided io.Reader and returns them as Info objects. The returned Infos will not have client or mapping set.

func (*StreamManifestReader) Read

Read reads the manifests and returns them as Info objects.

type UnknownTypesError added in v0.26.0

type UnknownTypesError struct {
	GroupVersionKinds []schema.GroupVersionKind
}

UnknownTypesError captures information about unknown types encountered.

func (*UnknownTypesError) Error added in v0.26.0

func (e *UnknownTypesError) Error() string

Jump to

Keyboard shortcuts

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