manifest

package
v0.0.0-...-bb0df7c Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	// OriginalFilename is set to the filename this manifest was loaded from.
	// It is not guaranteed to be set or be unique, but we will set it when
	// loading from disk to provide better debuggability.
	OriginalFilename string

	Raw []byte
	GVK schema.GroupVersionKind

	Obj *unstructured.Unstructured
}

Manifest stores Kubernetes object in Raw from a file. It stores the GroupVersionKind for the manifest. Raw and Obj should always be kept in sync such that each provides the same data but in different formats. To ensure Raw and Obj are always in sync, they should not be set directly but rather only be set by calling either method ManifestsFromFiles or ParseManifests.

func ManifestsFromFiles

func ManifestsFromFiles(files []string) ([]Manifest, error)

ManifestsFromFiles reads files and returns Manifests in the same order. files should be list of absolute paths for the manifests on disk.

func ParseManifests

func ParseManifests(r io.Reader) ([]Manifest, error)

ParseManifests parses a YAML or JSON document that may contain one or more kubernetes resources.

func (*Manifest) UnmarshalJSON

func (m *Manifest) UnmarshalJSON(in []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for the Manifest type. It unmarshals bytes of a single kubernetes object to Manifest.

Jump to

Keyboard shortcuts

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