resource

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromFiles added in v0.3.0

func FromFiles(ctx context.Context, paths []string, ignoreFilePatterns []string) (<-chan Resource, <-chan error)

func FromStream added in v0.3.0

func FromStream(ctx context.Context, path string, r io.Reader) (<-chan Resource, <-chan error)

FromStream reads resources from a byte stream, usually here stdin

func SplitYAMLDocument added in v0.3.0

func SplitYAMLDocument(data []byte, atEOF bool) (advance int, token []byte, err error)

SplitYAMLDocument is a bufio.SplitFunc for splitting a YAML document into individual documents.

This is from Kubernetes' 'pkg/util/yaml'.splitYAMLDocument, which is unfortunately not exported.

Types

type DiscoveryError added in v0.3.0

type DiscoveryError struct {
	Path string
	Err  error
}

func (DiscoveryError) Error added in v0.3.0

func (de DiscoveryError) Error() string

type Resource added in v0.3.0

type Resource struct {
	Path  string
	Bytes []byte
	// contains filtered or unexported fields
}

Resource represents a Kubernetes resource within a file

func (*Resource) Resources added in v0.4.8

func (res *Resource) Resources() []Resource

Resources returns a list of resources if the resource is of type List, a single resource otherwise See https://github.com/yannh/kubeconform/issues/53

func (*Resource) Signature added in v0.3.0

func (res *Resource) Signature() (*Signature, error)

Signature computes a signature for a resource, based on its Kind, Version, Namespace & Name

func (*Resource) SignatureFromMap added in v0.4.1

func (res *Resource) SignatureFromMap(m map[string]interface{}) (*Signature, error)

type Signature

type Signature struct {
	Kind, Version, Namespace, Name string
}

Signature is a key representing a Kubernetes resource

func (*Signature) GroupVersionKind added in v0.5.0

func (sig *Signature) GroupVersionKind() string

GroupVersionKind returns a string with the GVK encoding of a resource signature. This encoding slightly differs from the Kubernetes upstream implementation in order to be suitable for being used in the kubeconform command-line arguments.

func (*Signature) QualifiedName added in v0.4.13

func (sig *Signature) QualifiedName() string

QualifiedName returns a string for a signature in the format version/kind/namespace/name

Jump to

Keyboard shortcuts

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