informer

package
v0.0.0-...-164c5de Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusCompleted string = "Satisfied"
	StatusTimeout   string = "Timeout"
)

Variables

This section is empty.

Functions

func IsMapPresent

func IsMapPresent(sourceMap map[string]string, subsetMap map[string]string) (bool, error)

func StartWatcher

func StartWatcher(configFile string, ownerFile string, loggerIn *zap.Logger) error

func TestGeneric

func TestGeneric(configFile string, loggerIn *zap.Logger) error

func UpdateStatus

func UpdateStatus(ownerFile string, status string) error

func WatchBasic

func WatchBasic(conditions []BasicConfigurationCondition, matchConditions chan Condition, stopper chan struct{}, informer cache.SharedIndexInformer)

func WatchPods

func WatchPods(conditions []PodCondition, matchConditions chan Condition, stopper chan struct{})

Types

type BasicConfiguration

type BasicConfiguration struct {
	Namespace string            `yaml:"namespace"`
	Name      string            `yaml:"name"`
	Labels    map[string]string `yaml:"labels"`
}

type BasicConfigurationCondition

type BasicConfigurationCondition struct {
	ID         int               `yaml:"id"`
	Namespace  string            `yaml:"namespace"`
	Name       string            `yaml:"name"`
	APIVersion string            `yaml:"apiVersion"`
	Kind       string            `yaml:"kind"`
	Labels     map[string]string `yaml:"labels"`
}

type BasicK8s

type BasicK8s interface {
	GetNamespace() string
	GetName() string
}

type Condition

type Condition struct {
	Selector    string `yaml:"selector"`
	ID          int    `yaml:"id"`
	Met         bool   `yaml:"met"`
	Description string `yaml:"description"`
}

type ExitScenario

type ExitScenario struct {
	Exit       int                           `yaml:"exit"`
	Timeout    int                           `yaml:"timeout"`
	Pods       []PodCondition                `yaml:"pods"`
	ConfigMaps []BasicConfigurationCondition `yaml:"configmaps"`
	Secrets    []BasicConfigurationCondition `yaml:"secrets"`
	Services   []BasicConfigurationCondition `yaml:"services"`
}

type ExitScenarioState

type ExitScenarioState struct {
	Exit       int         `yaml:"exit"`
	Timeout    int         `yaml:"timeout"`
	Conditions []Condition `yaml:"conditions"`
}

type PatchObject

type PatchObject struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value string `json:"value"`
}

type PodCondition

type PodCondition struct {
	ID         int               `yaml:"id"`
	Namespace  string            `yaml:"namespace"`
	Name       string            `yaml:"name"`
	Phase      string            `yaml:"phase"`
	APIVersion string            `yaml:"apiVersion"`
	Kind       string            `yaml:"kind"`
	Labels     map[string]string `yaml:"labels"`
}

type SelectorName

type SelectorName string
const (
	POD       SelectorName = "Pod"
	JOB       SelectorName = "Job"
	CONFIGMAP SelectorName = "ConfigMap"
	SECRET    SelectorName = "Secret"
	UNKOWN    SelectorName = ""
)

func GetSelector

func GetSelector(gvk schema.GroupVersionKind) SelectorName

func (SelectorName) GetGVK

func (sn SelectorName) GetGVK() *schema.GroupVersionKind

type WatcherConfig

type WatcherConfig struct {
	CrdName      string `yaml:"crdname,omitempty"`
	CrdNamespace string `yaml:"crdnamespace,omitempty"`
	Kind         string `yaml:"kind,omitempty"`
	APIVersion   string `yaml:"apiversion,omitempty"`
	Group        string `yaml:"group,omitempty"`
}

Jump to

Keyboard shortcuts

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