Documentation
¶
Overview ¶
This entire piece of code is lifted from MetaController
refer - https://github.com/GoogleCloudPlatform/metacontroller
Index ¶
- Constants
- func GetLastApplied(obj *unstructured.Unstructured) (map[string]interface{}, error)
- func Merge(observed, lastApplied, desired map[string]interface{}) (map[string]interface{}, error)
- func SetLastApplied(obj *unstructured.Unstructured, lastApplied map[string]interface{}) error
- type BDD
- type DynClient
- type TestAbstract
- func (t *TestAbstract) Given() error
- func (t *TestAbstract) PostSetup() error
- func (t *TestAbstract) PostTeardown() error
- func (t *TestAbstract) Setup() error
- func (t *TestAbstract) Teardown() error
- func (t *TestAbstract) Test() error
- func (t *TestAbstract) Then() error
- func (t *TestAbstract) When() error
- type TestFns
- type Testsuite
Constants ¶
View Source
const ( StepSetup = iota + 1 StepPostSetup StepGiven StepWhen StepThen StepTeardown StepPostTeardown )
Variables ¶
This section is empty.
Functions ¶
func GetLastApplied ¶
func GetLastApplied(obj *unstructured.Unstructured) (map[string]interface{}, error)
GetLastApplied returns the last applied state from the provided object
func Merge ¶
Merge updates the given observed object to apply the desired changes. It returns an updated copy of the observed object if no error occurs.
last applied | \|/
desired --->(state)<--- observed
func SetLastApplied ¶
func SetLastApplied(obj *unstructured.Unstructured, lastApplied map[string]interface{}) error
SetLastApplied sets the last applied state against the provided object
Types ¶
type DynClient ¶
type DynClient struct {
// contains filtered or unexported fields
}
func NewDynClient ¶
func NewDynClientOrDie ¶
func NewDynClientOrDie() *DynClient
func (*DynClient) GetResourceInterface ¶
func (uc *DynClient) GetResourceInterface( gvk schema.GroupVersionKind, ns ...string, ) (dynamic.ResourceInterface, error)
type TestAbstract ¶
type TestAbstract struct { WaitPostSteps []int WaitTime time.Duration Steps []func() error Setupfn func() error PostSetupfn func() error Teardownfn func() error PostTeardownfn func() error Givenfn func() error Whenfn func() error Thenfn func() error // contains filtered or unexported fields }
TestAbstract as the name suggests abstracts some of the common features required by instances implementing bdd or testsuite interface
func (*TestAbstract) Given ¶
func (t *TestAbstract) Given() error
func (*TestAbstract) PostSetup ¶
func (t *TestAbstract) PostSetup() error
func (*TestAbstract) PostTeardown ¶
func (t *TestAbstract) PostTeardown() error
func (*TestAbstract) Setup ¶
func (t *TestAbstract) Setup() error
func (*TestAbstract) Teardown ¶
func (t *TestAbstract) Teardown() error
func (*TestAbstract) Test ¶
func (t *TestAbstract) Test() error
func (*TestAbstract) Then ¶
func (t *TestAbstract) Then() error
func (*TestAbstract) When ¶
func (t *TestAbstract) When() error
Click to show internal directories.
Click to hide internal directories.