Documentation ¶
Index ¶
- func Eventually(t *testing.T, name string, cond Condition)
- type Condition
- type EventualOpts
- type FakeConfigMapController
- type MockDependencyHandler
- type MockDeploymentHandler
- type MockDestinationRuleHandler
- type MockGlobalTrafficHandler
- type MockIstioConfigStore
- type MockNodeHandler
- type MockPodHandler
- type MockRolloutHandler
- type MockRoutingPolicyHandler
- type MockServiceEntryHandler
- type MockServiceHandler
- type MockSidecarHandler
- type MockVirtualServiceHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Condition ¶
type Condition func() bool
A Condition is a function that returns true when a test condition is satisfied.
type EventualOpts ¶
type EventualOpts struct {
// contains filtered or unexported fields
}
EventualOpts defines a polling strategy for operations that must eventually succeed. A new EventualOpts must be provided for each invocation of Eventually (or call Reset on a previously completed set of options).
func NewEventualOpts ¶
func NewEventualOpts(interval, deadline time.Duration) *EventualOpts
NewEventualOpts constructs an EventualOpts instance with the provided polling interval and deadline. EventualOpts will perform randomized exponential backoff using the starting interval, and will stop polling (and therefore fail) after deadline time as elapsed from calling Eventually.
Note: we always backoff with a randomization of 0.5 (50%), a multiplier of 1.5, and a max interval of one minute.
func (EventualOpts) Eventually ¶
func (e EventualOpts) Eventually(t *testing.T, name string, cond Condition)
Eventually polls cond until it succeeds (returns true) or we exceed the deadline. Eventually performs backoff while polling cond.
name is printed as part of the test failure message when we exceed the deadline to help identify the test case failing. cond does not need to be thread-safe: it is only called from the current goroutine. cond itself can also fail the test early using t.Fatal.
type FakeConfigMapController ¶
type FakeConfigMapController struct { GetError error PutError error ConfigmapToReturn *k8sCoreV1.ConfigMap }
func (*FakeConfigMapController) GetConfigMap ¶
func (*FakeConfigMapController) GetIPPrefixForServiceEntries ¶
func (c *FakeConfigMapController) GetIPPrefixForServiceEntries() (seIpPrefix string)
func (*FakeConfigMapController) PutConfigMap ¶
type MockDependencyHandler ¶
type MockDependencyHandler struct { }
func (*MockDependencyHandler) Added ¶
func (m *MockDependencyHandler) Added(ctx context.Context, obj *v1.Dependency)
func (*MockDependencyHandler) Deleted ¶
func (m *MockDependencyHandler) Deleted(ctx context.Context, obj *v1.Dependency)
func (*MockDependencyHandler) Updated ¶
func (m *MockDependencyHandler) Updated(ctx context.Context, obj *v1.Dependency)
type MockDeploymentHandler ¶
type MockDeploymentHandler struct { }
func (*MockDeploymentHandler) Added ¶
func (m *MockDeploymentHandler) Added(ctx context.Context, obj *k8sAppsV1.Deployment)
func (*MockDeploymentHandler) Deleted ¶
func (m *MockDeploymentHandler) Deleted(ctx context.Context, obj *k8sAppsV1.Deployment)
type MockDestinationRuleHandler ¶
type MockDestinationRuleHandler struct {
Obj *v1alpha32.DestinationRule
}
func (*MockDestinationRuleHandler) Added ¶
func (m *MockDestinationRuleHandler) Added(ctx context.Context, obj *v1alpha32.DestinationRule)
func (*MockDestinationRuleHandler) Deleted ¶
func (m *MockDestinationRuleHandler) Deleted(ctx context.Context, obj *v1alpha32.DestinationRule)
func (*MockDestinationRuleHandler) Updated ¶
func (m *MockDestinationRuleHandler) Updated(ctx context.Context, obj *v1alpha32.DestinationRule)
type MockGlobalTrafficHandler ¶
type MockGlobalTrafficHandler struct {
Obj *v1.GlobalTrafficPolicy
}
func (*MockGlobalTrafficHandler) Added ¶
func (m *MockGlobalTrafficHandler) Added(ctx context.Context, obj *v1.GlobalTrafficPolicy)
func (*MockGlobalTrafficHandler) Deleted ¶
func (m *MockGlobalTrafficHandler) Deleted(ctx context.Context, obj *v1.GlobalTrafficPolicy)
func (*MockGlobalTrafficHandler) Updated ¶
func (m *MockGlobalTrafficHandler) Updated(ctx context.Context, obj *v1.GlobalTrafficPolicy)
type MockIstioConfigStore ¶
type MockIstioConfigStore struct {
TestHook func(interface{})
}
func (*MockIstioConfigStore) Delete ¶
func (m *MockIstioConfigStore) Delete(typ, name, namespace string) error
func (*MockIstioConfigStore) HasSynced ¶
func (m *MockIstioConfigStore) HasSynced() bool
func (*MockIstioConfigStore) Run ¶
func (m *MockIstioConfigStore) Run(stop <-chan struct{})
type MockNodeHandler ¶
func (*MockNodeHandler) Added ¶
func (m *MockNodeHandler) Added(obj *k8sCoreV1.Node)
func (*MockNodeHandler) Deleted ¶
func (m *MockNodeHandler) Deleted(obj *k8sCoreV1.Node)
type MockPodHandler ¶
type MockPodHandler struct { }
func (MockPodHandler) Added ¶
func (m MockPodHandler) Added(obj *k8sCoreV1.Pod)
func (MockPodHandler) Deleted ¶
func (m MockPodHandler) Deleted(obj *k8sCoreV1.Pod)
type MockRolloutHandler ¶
type MockRolloutHandler struct { }
func (*MockRolloutHandler) Added ¶
func (m *MockRolloutHandler) Added(ctx context.Context, obj *argo.Rollout)
type MockRoutingPolicyHandler ¶
type MockRoutingPolicyHandler struct {
Obj *v1.RoutingPolicy
}
func (*MockRoutingPolicyHandler) Added ¶
func (m *MockRoutingPolicyHandler) Added(ctx context.Context, obj *v1.RoutingPolicy)
func (*MockRoutingPolicyHandler) Deleted ¶
func (m *MockRoutingPolicyHandler) Deleted(ctx context.Context, obj *v1.RoutingPolicy)
func (*MockRoutingPolicyHandler) Updated ¶
func (m *MockRoutingPolicyHandler) Updated(ctx context.Context, obj *v1.RoutingPolicy)
type MockServiceEntryHandler ¶
type MockServiceEntryHandler struct {
Obj *v1alpha32.ServiceEntry
}
func (*MockServiceEntryHandler) Added ¶
func (m *MockServiceEntryHandler) Added(obj *v1alpha32.ServiceEntry)
func (*MockServiceEntryHandler) Deleted ¶
func (m *MockServiceEntryHandler) Deleted(obj *v1alpha32.ServiceEntry)
func (*MockServiceEntryHandler) Updated ¶
func (m *MockServiceEntryHandler) Updated(obj *v1alpha32.ServiceEntry)
type MockServiceHandler ¶
type MockServiceHandler struct { }
func (*MockServiceHandler) Added ¶
func (m *MockServiceHandler) Added(ctx context.Context, obj *k8sCoreV1.Service)
type MockSidecarHandler ¶
func (*MockSidecarHandler) Added ¶
func (m *MockSidecarHandler) Added(ctx context.Context, obj *v1alpha32.Sidecar)
type MockVirtualServiceHandler ¶
type MockVirtualServiceHandler struct {
Obj *v1alpha32.VirtualService
}
func (*MockVirtualServiceHandler) Added ¶
func (m *MockVirtualServiceHandler) Added(ctx context.Context, obj *v1alpha32.VirtualService)
func (*MockVirtualServiceHandler) Deleted ¶
func (m *MockVirtualServiceHandler) Deleted(ctx context.Context, obj *v1alpha32.VirtualService)
func (*MockVirtualServiceHandler) Updated ¶
func (m *MockVirtualServiceHandler) Updated(ctx context.Context, obj *v1alpha32.VirtualService)