lintcontext

package
v0.0.0-...-a161123 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidObject

type InvalidObject struct {
	Metadata ObjectMetadata
	LoadErr  error
}

An InvalidObject represents something that couldn't be loaded from a YAML file.

type LintContext

type LintContext struct {
	// contains filtered or unexported fields
}

A LintContext represents the context for a lint run.

func CreateContexts

func CreateContexts(filesOrDirs ...string) ([]*LintContext, error)

CreateContexts creates a context. Each context contains a set of files that should be linted as a group. Currently, each directory of Kube YAML files (or Helm charts) are treated as a separate context. TODO: Figure out if it's useful to allow people to specify that files spanning different directories should be treated as being in the same context.

func CreateContextsFromTgz

func CreateContextsFromTgz(tgzFile string) ([]*LintContext, error)

CreateContextsFromTgz creates a context from TGZ Helm Chart file

func CreateContextsFromTgzBytes

func CreateContextsFromTgzBytes(tgzBytes []byte) ([]*LintContext, error)

CreateContextsFromTgzBytes creates a context from TGZ bytes of Helm Chart

func New

func New() *LintContext

New returns a ready-to-use, empty, lint context.

func (*LintContext) InvalidObjects

func (l *LintContext) InvalidObjects() []InvalidObject

InvalidObjects returns any objects that we attempted to load, but which were invalid.

func (*LintContext) Objects

func (l *LintContext) Objects() []Object

Objects returns the (valid) objects loaded from this LintContext.

type Object

type Object struct {
	Metadata  ObjectMetadata
	K8sObject k8sutil.Object
}

An Object references an object that is loaded from a YAML file.

type ObjectMetadata

type ObjectMetadata struct {
	FilePath string
	Raw      []byte
}

ObjectMetadata is metadata about an object.

Jump to

Keyboard shortcuts

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