pkg

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCMD added in v0.2.6

func RunCMD(scriptName string) int

RunCMD execute long running script with disabling output buffering, and enabling streaming. return the exit code of the script process.

Types

type Arg

type Arg string

type ByAnnotation

type ByAnnotation struct{}

func (ByAnnotation) Match

func (b ByAnnotation) Match(clt client.Client, ep Expectation, logger logr.Logger) error

Basiclly, list all the instance and check if there's instance generated by subscription

type ByAnnotationCount

type ByAnnotationCount struct{}

func (ByAnnotationCount) Match

func (b ByAnnotationCount) Match(clt client.Client, ep Expectation, logger logr.Logger) error

type ByGeneration added in v0.2.4

type ByGeneration struct{}

func (ByGeneration) Match added in v0.2.4

func (b ByGeneration) Match(clt client.Client, ep Expectation, logger logr.Logger) error

type ByLabel added in v0.2.3

type ByLabel struct{}

func (ByLabel) Match added in v0.2.3

func (b ByLabel) Match(clt client.Client, ep Expectation, logger logr.Logger) error

type ByName

type ByName struct{}

func (ByName) Match

func (b ByName) Match(clt client.Client, ep Expectation, logger logr.Logger) error

type ConfigUnit

type ConfigUnit struct {
	// mainly for checking expectations
	Clt client.Client
	// mainly for applying resources
	CfgDir string
}

type ExpctationReg

type ExpctationReg map[string]Expectations

func ToExpReg added in v0.1.6

func ToExpReg(in ExpctationReg, exps *Expectations) ExpctationReg

type Expectation

type Expectation struct {
	TestID        string            `json:"test_id"`
	TargetCluster string            `json:"target_cluster"`
	Desc          string            `json:"desc"`
	APIVersion    string            `json:"apiversion"`
	Kind          string            `json:"kind"`
	Name          string            `json:"name"`
	Namepsace     string            `json:"namespace"`
	Matcher       string            `json:"matcher"`
	Args          map[string]string `json:"args"`
}

func (Expectation) GetInstance

func (e Expectation) GetInstance() *unstructured.Unstructured

func (Expectation) GetInstanceList

func (e Expectation) GetInstanceList() *unstructured.UnstructuredList

func (Expectation) GetKey

func (e Expectation) GetKey() types.NamespacedName

func (Expectation) IsEqual

func (e Expectation) IsEqual(b Expectation) bool

func (*Expectation) String

func (e *Expectation) String() string

type Expectations

type Expectations []Expectation

func BytesToExpectations added in v0.1.6

func BytesToExpectations(in []byte) (*Expectations, error)

type KubeConfigs

type KubeConfigs map[string]*ConfigUnit

KubeConfigs have cluster name and it's location for kubeconfig

func LoadKubeConfigs

func LoadKubeConfigs(dir string) (KubeConfigs, error)

func (KubeConfigs) GetClusterNames

func (k KubeConfigs) GetClusterNames() string

type Matcher

type Matcher interface {
	Match(client.Client, Expectation, logr.Logger) error
}

func MatcherRouter

func MatcherRouter(name string) Matcher

type Stage

type Stage struct {
	ID     string `json:"id"`
	Order  int    `json:"run_order"`
	CaseID string `json:"case_id"`
	Clean  string `json:"clean"`
}

type StageReg

type StageReg map[string]Stages

func LoadStages

func LoadStages(dir string) (StageReg, error)

func ToStageReg added in v0.1.6

func ToStageReg(in StageReg, st *Stages) StageReg

type Stages

type Stages []Stage

func BytesToStages added in v0.1.6

func BytesToStages(b []byte) (*Stages, error)

type TestCase

type TestCase struct {
	CaseID        string   `json:"test_id"`
	Desc          string   `json:"desc"`
	URLs          []string `json:"urls"`
	TargetCluster string   `json:"target_cluster"`
}

TestCase contains an id and a ULR pointing to it's raw content

type TestCases

type TestCases []TestCase

func BytesToTestCases added in v0.1.6

func BytesToTestCases(b []byte) (*TestCases, error)

type TestCasesReg

type TestCasesReg map[string]TestCase

func LoadTestCases

func LoadTestCases(dir string) (TestCasesReg, error)

func ToTcReg added in v0.1.6

func ToTcReg(in TestCasesReg, tc *TestCases) TestCasesReg

Jump to

Keyboard shortcuts

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