Documentation ¶
Index ¶
- Constants
- func CheckAction(expected, actual kubetesting.Action, t *testing.T)
- func CheckActions(expected, actual []kubetesting.Action, t *testing.T)
- func CheckClusterClientActions(store *clusterclientstore.Store, clusters []*ClusterFixture, ua string, ...)
- func CheckEvents(expectedOrderedEvents []string, receivedEvents []string, t *testing.T)
- func ClusterClientStore(stopCh chan struct{}, clusterNames []string, ...) *clusterclientstore.Store
- func FilterActions(actions []kubetesting.Action) []kubetesting.Action
- func NewDiscoveryAction(_ string) kubetesting.ActionImpl
- func PrettyPrintActions(actions []kubetesting.Action, t *testing.T)
- func ShallowCheckAction(expected, actual kubetesting.Action, t *testing.T)
- func ShallowCheckActions(expected, actual []kubetesting.Action, t *testing.T)
- type ClusterFixture
- type FakeClusterClientStore
- func (s *FakeClusterClientStore) AddEventHandlerCallback(eventHandlerCallback clusterclientstore.EventHandlerRegisterFunc)
- func (s *FakeClusterClientStore) AddSubscriptionCallback(subscriptionCallback clusterclientstore.SubscriptionRegisterFunc)
- func (s *FakeClusterClientStore) GetClient(clusterName string, ua string) (kubernetes.Interface, error)
- func (s *FakeClusterClientStore) GetInformerFactory(clusterName string) (informers.SharedInformerFactory, error)
- func (s *FakeClusterClientStore) Run(stopCh <-chan struct{})
Constants ¶
const ( NoResyncPeriod time.Duration = 0 ContextLines = 4 TestNamespace = "test-namespace" TestLabel = "shipper-e2e-test" TestRegion = "eu-west" )
Variables ¶
This section is empty.
Functions ¶
func CheckAction ¶
func CheckAction(expected, actual kubetesting.Action, t *testing.T)
CheckAction compares two individual actions and calls Errorf on t if it finds a difference.
func CheckActions ¶
func CheckActions(expected, actual []kubetesting.Action, t *testing.T)
CheckActions takes a slice of expected actions and a slice of observed actions (typically obtained from fakeClient.Actions()) and compares them. Calls Errorf on t for every difference it finds.
func CheckClusterClientActions ¶
func CheckClusterClientActions( store *clusterclientstore.Store, clusters []*ClusterFixture, ua string, t *testing.T, )
func CheckEvents ¶
func ClusterClientStore ¶
func ClusterClientStore( stopCh chan struct{}, clusterNames []string, clientBuilderFunc clusterclientstore.ClientBuilderFunc, ) *clusterclientstore.Store
func FilterActions ¶
func FilterActions(actions []kubetesting.Action) []kubetesting.Action
FilterActions, given a slice of observed actions, returns only those that change state. Useful for reducing the number of actions needed to check in tests.
func NewDiscoveryAction ¶ added in v0.5.0
func NewDiscoveryAction(_ string) kubetesting.ActionImpl
func PrettyPrintActions ¶ added in v0.5.0
func PrettyPrintActions(actions []kubetesting.Action, t *testing.T)
PrettyPrintActions pretty-prints a slice of actions, useful for creating a human-readable list for debugging.
func ShallowCheckAction ¶
func ShallowCheckAction(expected, actual kubetesting.Action, t *testing.T)
ShallowCheckAction checks the verb, resource, and namespace without looking at the objects involved. This is a stand-in until we port the Installation controller to not use 'nil' as the object involved in the kubetesting.Actions it expects.
func ShallowCheckActions ¶
func ShallowCheckActions(expected, actual []kubetesting.Action, t *testing.T)
ShallowCheckActions takes a slice of expected actions and a slice of observed actions (typically obtained from fakeClient.Actions()) and compares them shallowly. Calls Errorf on t for every difference it finds.
Types ¶
type ClusterFixture ¶
type ClusterFixture struct { Name string // contains filtered or unexported fields }
func NewClusterFixture ¶
func NewClusterFixture(name string) *ClusterFixture
func (*ClusterFixture) AddMany ¶
func (c *ClusterFixture) AddMany(objects []runtime.Object)
func (*ClusterFixture) AddOne ¶
func (c *ClusterFixture) AddOne(object runtime.Object)
func (*ClusterFixture) Expect ¶
func (c *ClusterFixture) Expect(actions ...kubetesting.Action)
func (*ClusterFixture) ExpectedActions ¶
func (c *ClusterFixture) ExpectedActions() []kubetesting.Action
func (*ClusterFixture) Objects ¶
func (c *ClusterFixture) Objects() []runtime.Object
type FakeClusterClientStore ¶
type FakeClusterClientStore struct { // Passed to the registered event handler callbacks. FakeClusterNames []string // contains filtered or unexported fields }
FakeClusterClientStore stores only one informer and fake clientset, and no matter what cluster name it's called with, returns the same clientset and informer.
It also supports callbacks, meaning that when it's passed into a controller, the controller can register callback and be notified when the Run() method on FakeClusterClientstore is called.
func NewFakeClusterClientStore ¶
func NewFakeClusterClientStore( fakeClient *fake.Clientset, informer informers.SharedInformerFactory, fakeClusterNames []string, ) *FakeClusterClientStore
func (*FakeClusterClientStore) AddEventHandlerCallback ¶
func (s *FakeClusterClientStore) AddEventHandlerCallback(eventHandlerCallback clusterclientstore.EventHandlerRegisterFunc)
func (*FakeClusterClientStore) AddSubscriptionCallback ¶
func (s *FakeClusterClientStore) AddSubscriptionCallback(subscriptionCallback clusterclientstore.SubscriptionRegisterFunc)
func (*FakeClusterClientStore) GetClient ¶
func (s *FakeClusterClientStore) GetClient(clusterName string, ua string) (kubernetes.Interface, error)
func (*FakeClusterClientStore) GetInformerFactory ¶
func (s *FakeClusterClientStore) GetInformerFactory(clusterName string) (informers.SharedInformerFactory, error)
func (*FakeClusterClientStore) Run ¶
func (s *FakeClusterClientStore) Run(stopCh <-chan struct{})