kubernetes

package
v0.0.0-...-bd7144e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destroyer

func Destroyer() loki.DestroyerFunc

Destroyer parses the destroy section i.e. exclusion and scenario for kubernetes system.

func Register

func Register()

Register registers the kubernetes system, destroyer and killer with loki.

Types

type Killer

type Killer struct {
	// System is the kubernetes system on which the killer acts on.
	*System
}

Killer provides functionality to delete kubernetes resources.

func (*Killer) Kill

func (k *Killer) Kill(ctx context.Context, identifiers ...loki.Identifier) error

Kill deletes the kubernetes resources represented by identifiers.

type ResourceIdentifier

type ResourceIdentifier struct {
	// GroupVersionKind identifies the type of kubernetes resource.
	schema.GroupVersionKind
	// Name represents the name of kubernetes resource.
	Name string
	// Namespace represents the namespace in which kubernetes resources lies. It should be empty for cluster scoped resoruces.
	Namespace string
}

ResourceIdentifier implements loki.Identifier for kubernetes resources.

func (*ResourceIdentifier) ID

func (r *ResourceIdentifier) ID() loki.ID

ID returns the unique identifier of kubernetes resource.

type System

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

System represents a kubernetes system comprising of resources as defined in input configuration.

func NewSystem

func NewSystem() *System

NewSystem instantiates kubernetes System.

func (*System) AsJSON

func (s *System) AsJSON(ctx context.Context, reload bool) ([]byte, error)

AsJSON returns the json representation of the state of the kubernetes system. If `reload` is set to `true`, state of the system will be reloaded before preparing json representation of system.

func (*System) Identifiers

func (s *System) Identifiers() loki.Identifiers

Identifiers return Identifier values of all resources in the kubernetes system.

func (*System) Load

func (s *System) Load(ctx context.Context) error

Load loads all the kubernetes resources defined in system of input configuration and stores it in memory. This will be used in validation during chaos testing.

func (*System) Parse

func (s *System) Parse(systemConfig map[string]interface{}) error

Parse parses the configuration of system given in input configuration.

func (*System) Validate

func (s *System) Validate(ctx context.Context) (bool, error)

Validate validates whether the system is in desired state or not by comparing kubernetes resources at current time with that loaded by Load function.

Jump to

Keyboard shortcuts

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