specchecker

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashConfigMap

func HashConfigMap(configMap *core_v1.ConfigMap, h hash.Hash, filter sets.String) bool

HashConfigMap hashes the sorted values in the ConfigMap in sorted order with a NUL as a separator character between and within pairs of key + value.

func HashConfigMapRef

func HashConfigMapRef(store Store, namespace, name string, filter sets.String, optional *bool, h hash.Hash) error

func HashSecret

func HashSecret(secret *core_v1.Secret, h hash.Hash, filter sets.String) bool

HashSecret hashes the sorted values in the secret in sorted order with a NUL as a separator character between and within pairs of key + value.

func HashSecretRef

func HashSecretRef(store Store, namespace, name string, filter sets.String, optional *bool, h hash.Hash) error

Types

type Checker

type Checker struct {
	Store      Store
	KnownTypes map[schema.GroupKind]ObjectProcessor
}

func New

func New(store Store, kts ...map[schema.GroupKind]ObjectProcessor) *Checker

func (*Checker) BeforeCreate

func (c *Checker) BeforeCreate(logger *zap.Logger, spec *unstructured.Unstructured) (*unstructured.Unstructured, error)

BeforeCreate pre-processes object specification and returns an updated version.

func (*Checker) CompareActualVsSpec

func (c *Checker) CompareActualVsSpec(logger *zap.Logger, spec, actual runtime.Object) (*unstructured.Unstructured, bool, string, error)

type Context

type Context struct {
	Logger *zap.Logger
	Store  Store
}

Context includes objects used by different cleanup functions

type ObjectProcessor

type ObjectProcessor interface {
	// BeforeCreate pre-processes object specification and returns an updated version.
	BeforeCreate(ctx *Context, spec *unstructured.Unstructured) (runtime.Object, error)
	ApplySpec(ctx *Context, spec, actual *unstructured.Unstructured) (runtime.Object, error)
}

type Store

type Store interface {
	Get(gvk schema.GroupVersionKind, namespace, name string) (obj runtime.Object, exists bool, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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