kubeval

package
v0.9.2-mjasion Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSchemaLocation = "https://kubernetesjsonschema.dev"

DefaultSchemaLocation is the default value for

View Source
var OpenShift bool

OpenShift represents whether to test against upstream Kubernetes of the OpenShift schemas

View Source
var OpenShiftSchemaLocation = "https://raw.githubusercontent.com/garethr/openshift-json-schema/master"

OpenShiftSchemaLocation is the alternative location for OpenShift specific schemas

View Source
var SchemaLocation string

SchemaLocation represents what is the schema location, / where default value is maintener github project, but can be overriden / to either different github repo, or a local file

View Source
var Strict bool

Strict tells kubeval whether to prohibit properties not in the schema. The API allows them, but kubectl does not

View Source
var Version string

Version represents the version of Kubernetes for which we should load the schema

Functions

This section is empty.

Types

type ValidFormat

type ValidFormat struct{}

ValidFormat is a type for quickly forcing new formats on the gojsonschema loader

func (ValidFormat) IsFormat

func (f ValidFormat) IsFormat(input interface{}) bool

IsFormat always returns true and meets the gojsonschema.FormatChecker interface

type ValidationResult

type ValidationResult struct {
	FileName        string
	Kind            string
	APIVersion      string
	Errors          []gojsonschema.ResultError
	ValidatedObject map[string]interface{}
	PlainObjectYaml []byte
}

ValidationResult contains the details from validating a given Kubernetes resource

func Validate

func Validate(config []byte, fileName string) ([]ValidationResult, error)

Validate a Kubernetes YAML file, parsing out individual resources and validating them all according to the relevant schemas TODO This function requires a judicious amount of refactoring.

Jump to

Keyboard shortcuts

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