Documentation
¶
Index ¶
- Constants
- func CheckAction(expected, actual kubetesting.Action, t *testing.T)
- func CheckActions(expected, actual []kubetesting.Action, t *testing.T)
- func CheckEvents(expectedOrderedEvents []string, receivedEvents []string, t *testing.T)
- func FilterActions(actions []kubetesting.Action) []kubetesting.Action
- func NewDiscoveryAction(_ string) kubetesting.ActionImpl
- func NewFailingFakeClusterClientStore() clusterclientstore.Interface
- 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 FailingFakeClusterClientStore
- type FakeCluster
- type FakeClusterClientStore
- func (s *FakeClusterClientStore) AddEventHandlerCallback(c clusterclientstore.EventHandlerRegisterFunc)
- func (s *FakeClusterClientStore) AddSubscriptionCallback(c clusterclientstore.SubscriptionRegisterFunc)
- func (s *FakeClusterClientStore) GetClient(clusterName string, ua string) (kubernetes.Interface, error)
- func (s *FakeClusterClientStore) GetConfig(clusterName string) (*rest.Config, 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 CheckEvents ¶
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 NewFailingFakeClusterClientStore ¶ added in v0.7.0
func NewFailingFakeClusterClientStore() clusterclientstore.Interface
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 FailingFakeClusterClientStore ¶ added in v0.7.0
type FailingFakeClusterClientStore struct {
FakeClusterClientStore
}
FailingFakeClusterClientStore is an implementation of clusterclientstore.Interface that always fails when trying to get clients for any cluster.
func (*FailingFakeClusterClientStore) GetClient ¶ added in v0.7.0
func (s *FailingFakeClusterClientStore) GetClient(clusterName string, ua string) (kubernetes.Interface, error)
type FakeCluster ¶ added in v0.7.0
type FakeCluster struct {
Name string
Client *kubefake.Clientset
DynamicClient *fakedynamic.FakeDynamicClient
InformerFactory informers.SharedInformerFactory
// contains filtered or unexported fields
}
func NewFakeCluster ¶ added in v0.7.0
func NewFakeCluster( client *kubefake.Clientset, dynamic *fakedynamic.FakeDynamicClient, ) *FakeCluster
func NewNamedFakeCluster ¶ added in v0.7.0
func NewNamedFakeCluster( name string, client *kubefake.Clientset, dynamic *fakedynamic.FakeDynamicClient, ) *FakeCluster
func (*FakeCluster) AddMany ¶ added in v0.7.0
func (c *FakeCluster) AddMany(objects []runtime.Object)
func (*FakeCluster) AddOne ¶ added in v0.7.0
func (c *FakeCluster) AddOne(object runtime.Object)
func (*FakeCluster) Expect ¶ added in v0.7.0
func (c *FakeCluster) Expect(actions ...kubetesting.Action)
func (*FakeCluster) ExpectedActions ¶ added in v0.7.0
func (c *FakeCluster) ExpectedActions() []kubetesting.Action
func (*FakeCluster) Objects ¶ added in v0.7.0
func (c *FakeCluster) Objects() []runtime.Object
type FakeClusterClientStore ¶
type FakeClusterClientStore struct {
// contains filtered or unexported fields
}
FakeClusterClientStore is a fake implementation of a ClusterClientStore, allowing you to provide your own clientsets.
func NewFakeClusterClientStore ¶
func NewFakeClusterClientStore(clusters map[string]*FakeCluster) *FakeClusterClientStore
func (*FakeClusterClientStore) AddEventHandlerCallback ¶
func (s *FakeClusterClientStore) AddEventHandlerCallback(c clusterclientstore.EventHandlerRegisterFunc)
func (*FakeClusterClientStore) AddSubscriptionCallback ¶
func (s *FakeClusterClientStore) AddSubscriptionCallback(c clusterclientstore.SubscriptionRegisterFunc)
func (*FakeClusterClientStore) GetClient ¶
func (s *FakeClusterClientStore) GetClient(clusterName string, ua string) (kubernetes.Interface, error)
func (*FakeClusterClientStore) GetConfig ¶ added in v0.7.0
func (s *FakeClusterClientStore) GetConfig(clusterName string) (*rest.Config, error)
func (*FakeClusterClientStore) GetInformerFactory ¶
func (s *FakeClusterClientStore) GetInformerFactory(clusterName string) (informers.SharedInformerFactory, error)
func (*FakeClusterClientStore) Run ¶
func (s *FakeClusterClientStore) Run(stopCh <-chan struct{})