util

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckProbePort added in v0.6.6

func CheckProbePort(container *v1.Container, probe *v1.Probe) []diagnostic.Diagnostic

func ConstructForbiddenMapMatcher

func ConstructForbiddenMapMatcher(key, value, fieldType string) (check.Func, error)

ConstructForbiddenMapMatcher constructs a check function that requires that a k-v pair is NOT present in the map.

func ConstructRequiredMapMatcher

func ConstructRequiredMapMatcher(key, value, fieldType string) (check.Func, error)

ConstructRequiredMapMatcher constructs a check function that requires that a k-v pair is present in the map.

func DecodeMapStructure

func DecodeMapStructure(m map[string]interface{}, out interface{}) error

DecodeMapStructure decodes the given map[string]interface{} into the given out variable, typically a pointer to a struct.

func MustParseParameterDesc

func MustParseParameterDesc(asJSON string) check.ParameterDesc

MustParseParameterDesc unmarshals the given JSON into a templates.ParameterDesc.

func PerContainerCheck

func PerContainerCheck(matchFunc func(container *v1.Container) []diagnostic.Diagnostic) check.Func

PerContainerCheck returns a check that abstracts away some of the boilerplate of writing a check that applies to containers. The given function is passed each container, and is allowed to return diagnostics if an error is found.

func PerNonInitContainerCheck

func PerNonInitContainerCheck(matchFunc func(container *v1.Container) []diagnostic.Diagnostic) check.Func

PerNonInitContainerCheck returns a check that abstracts away some of the boilerplate of writing a check that applies to all non-init containers. The given function is passed each non-init container, and is allowed to return diagnostics if an error is found.

func ValueInRange

func ValueInRange(value, lowerBound int, upperBound *int) bool

ValueInRange returns whether the given quantity is in the range between the lowerBound and the upperBound (inclusive). A nil upper bound is interpreted as infinity.

Types

This section is empty.

Jump to

Keyboard shortcuts

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