manifest

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package manifest provides helpers to parse a Kubernetes "manifest" or multi-resource YAML document. This is used by parts of the plugin such as the Helm chart deployment platform to build status reports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	Resources []*Resource
}

A manifest represents a multi-resource Kubernetes resource description such as from YAML.

func Parse

func Parse(r io.Reader) (*Manifest, error)

Parse parses multi-document YAML contents into a manifest.

type Resource

type Resource struct {
	APIVersion string `mapstructure:"apiVersion"`
	Kind       string `mapstructure:"kind"`
	Metadata   struct {
		Name        string
		Namespace   string
		Labels      map[string]string
		Annotations map[string]string
	} `mapstructure:"metadata"`

	// RawYAML is the raw document YAML for this resource.
	RawYAML []byte

	// RawJSON is the RawYAML converted to JSON using the k8s.io YAML
	// library. We do this because all the API structures are tagged with
	// a "json" tag so this lets you unmarshal into a richer official
	// Kubernetes structure directly.
	RawJSON []byte
}

Resource is a generic resource. This is meant to be able to match any Kubernetes resource. Callers are expected to use the metadata to further query the object if more information is required.

func (*Resource) FullKind

func (r *Resource) FullKind() string

FullKind returns the Kind of this resource with the APIVersion as a prefix. This will not prefix core types (such as Secret).

Jump to

Keyboard shortcuts

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