Documentation ¶
Index ¶
- Constants
- Variables
- func NewClient(config *rest.Config) (client.Client, error)
- func NewConfig() *rest.Config
- func NodeNames(nodes []*v1.Node) []string
- type ContextKey
- type Environment
- func (env *Environment) AfterEach()
- func (env *Environment) BeforeEach()
- func (env *Environment) Cleanup()
- func (env *Environment) CleanupObjects(cleanableObjects ...client.Object)
- func (env *Environment) EventuallyExpectCreatedMachineCount(comparator string, count int) []*v1alpha5.Machine
- func (env *Environment) EventuallyExpectCreatedNodeCount(comparator string, count int) []*v1.Node
- func (env *Environment) EventuallyExpectDeletedNodeCount(comparator string, count int) []*v1.Node
- func (env *Environment) EventuallyExpectDeletedNodeCountWithSelector(comparator string, count int, selector labels.Selector) []*v1.Node
- func (env *Environment) EventuallyExpectGPUProvisionerRestarted()
- func (env *Environment) EventuallyExpectHealthy(pods ...*v1.Pod)
- func (env *Environment) EventuallyExpectHealthyPodCount(selector labels.Selector, numPods int)
- func (env *Environment) EventuallyExpectHealthyPodCountWithTimeout(timeout time.Duration, selector labels.Selector, numPods int)
- func (env *Environment) EventuallyExpectHealthyWithTimeout(timeout time.Duration, pods ...*v1.Pod)
- func (env *Environment) EventuallyExpectInitializedNodeCount(comparator string, count int) []*v1.Node
- func (env *Environment) EventuallyExpectMachinesReady(machines ...*v1alpha5.Machine)
- func (env *Environment) EventuallyExpectNodeCount(comparator string, count int) []*v1.Node
- func (env *Environment) EventuallyExpectNodeCountWithSelector(comparator string, count int, selector labels.Selector) []*v1.Node
- func (env *Environment) EventuallyExpectNotFound(objects ...client.Object)
- func (env *Environment) EventuallyExpectNotFoundAssertion(objects ...client.Object) AsyncAssertion
- func (env *Environment) EventuallyExpectNotFoundAssertionWithOffset(offset int, objects ...client.Object) AsyncAssertion
- func (env *Environment) EventuallyExpectNotFoundWithOffset(offset int, objects ...client.Object)
- func (env *Environment) EventuallyExpectPendingPodCount(selector labels.Selector, numPods int)
- func (env *Environment) EventuallyExpectRollout(name, namespace string)
- func (env *Environment) ExpectActiveGPUProvisionerPod() *v1.Pod
- func (env *Environment) ExpectActiveGPUProvisionerPodName() string
- func (env *Environment) ExpectCABundle() string
- func (env *Environment) ExpectConfigMapExists(key types.NamespacedName) *v1.ConfigMap
- func (env *Environment) ExpectCreated(objects ...client.Object)
- func (env *Environment) ExpectCreatedNodeCount(comparator string, count int) []*v1.Node
- func (env *Environment) ExpectCreatedWithOffset(offset int, objects ...client.Object)
- func (env *Environment) ExpectDeleted(objects ...client.Object)
- func (env *Environment) ExpectDeletedWithOffset(offset int, objects ...client.Object)
- func (env *Environment) ExpectExists(obj client.Object)
- func (env *Environment) ExpectGPUProvisionerPods() []*v1.Pod
- func (env *Environment) ExpectNoCrashes()
- func (env *Environment) ExpectPodsMatchingSelector(selector labels.Selector) []*v1.Pod
- func (env *Environment) ExpectSettings() *v1.ConfigMap
- func (env *Environment) ExpectUniqueNodeNames(selector labels.Selector, uniqueNames int)
- func (env *Environment) GetNode(nodeName string) v1.Node
- type Monitor
- func (m *Monitor) CreatedNodeCount() int
- func (m *Monitor) CreatedNodes() []*v1.Node
- func (m *Monitor) DeletedNodes() []*v1.Node
- func (m *Monitor) NodeCount() int
- func (m *Monitor) NodeCountAtReset() int
- func (m *Monitor) Nodes() []*v1.Node
- func (m *Monitor) NodesAtReset() []*v1.Node
- func (m *Monitor) PendingPods(selector labels.Selector) []*v1.Pod
- func (m *Monitor) PendingPodsCount(selector labels.Selector) int
- func (m *Monitor) Reset()
- func (m *Monitor) RestartCount() map[string]int
- func (m *Monitor) RunningPods(selector labels.Selector) []*v1.Pod
- func (m *Monitor) RunningPodsCount(selector labels.Selector) int
Constants ¶
const (
GitRefContextKey = ContextKey("gitRef")
)
Variables ¶
Functions ¶
Types ¶
type ContextKey ¶
type ContextKey string
type Environment ¶
type Environment struct { context.Context Client client.Client Config *rest.Config KubeClient kubernetes.Interface Monitor *Monitor StartingNodeCount int }
func NewEnvironment ¶
func NewEnvironment(t *testing.T) *Environment
func (*Environment) AfterEach ¶
func (env *Environment) AfterEach()
func (*Environment) Cleanup ¶
func (env *Environment) Cleanup()
func (*Environment) CleanupObjects ¶
func (env *Environment) CleanupObjects(cleanableObjects ...client.Object)
func (*Environment) EventuallyExpectCreatedMachineCount ¶
func (env *Environment) EventuallyExpectCreatedMachineCount(comparator string, count int) []*v1alpha5.Machine
func (*Environment) EventuallyExpectCreatedNodeCount ¶
func (env *Environment) EventuallyExpectCreatedNodeCount(comparator string, count int) []*v1.Node
func (*Environment) EventuallyExpectDeletedNodeCount ¶
func (env *Environment) EventuallyExpectDeletedNodeCount(comparator string, count int) []*v1.Node
func (*Environment) EventuallyExpectDeletedNodeCountWithSelector ¶
func (*Environment) EventuallyExpectGPUProvisionerRestarted ¶
func (env *Environment) EventuallyExpectGPUProvisionerRestarted()
func (*Environment) EventuallyExpectHealthy ¶
func (env *Environment) EventuallyExpectHealthy(pods ...*v1.Pod)
func (*Environment) EventuallyExpectHealthyPodCount ¶
func (env *Environment) EventuallyExpectHealthyPodCount(selector labels.Selector, numPods int)
func (*Environment) EventuallyExpectHealthyPodCountWithTimeout ¶
func (*Environment) EventuallyExpectHealthyWithTimeout ¶
func (env *Environment) EventuallyExpectHealthyWithTimeout(timeout time.Duration, pods ...*v1.Pod)
func (*Environment) EventuallyExpectInitializedNodeCount ¶
func (env *Environment) EventuallyExpectInitializedNodeCount(comparator string, count int) []*v1.Node
func (*Environment) EventuallyExpectMachinesReady ¶
func (env *Environment) EventuallyExpectMachinesReady(machines ...*v1alpha5.Machine)
func (*Environment) EventuallyExpectNodeCount ¶
func (env *Environment) EventuallyExpectNodeCount(comparator string, count int) []*v1.Node
func (*Environment) EventuallyExpectNodeCountWithSelector ¶
func (*Environment) EventuallyExpectNotFound ¶
func (env *Environment) EventuallyExpectNotFound(objects ...client.Object)
func (*Environment) EventuallyExpectNotFoundAssertion ¶
func (env *Environment) EventuallyExpectNotFoundAssertion(objects ...client.Object) AsyncAssertion
func (*Environment) EventuallyExpectNotFoundAssertionWithOffset ¶
func (env *Environment) EventuallyExpectNotFoundAssertionWithOffset(offset int, objects ...client.Object) AsyncAssertion
func (*Environment) EventuallyExpectNotFoundWithOffset ¶
func (env *Environment) EventuallyExpectNotFoundWithOffset(offset int, objects ...client.Object)
func (*Environment) EventuallyExpectPendingPodCount ¶
func (env *Environment) EventuallyExpectPendingPodCount(selector labels.Selector, numPods int)
func (*Environment) EventuallyExpectRollout ¶
func (env *Environment) EventuallyExpectRollout(name, namespace string)
func (*Environment) ExpectActiveGPUProvisionerPod ¶
func (env *Environment) ExpectActiveGPUProvisionerPod() *v1.Pod
func (*Environment) ExpectActiveGPUProvisionerPodName ¶
func (env *Environment) ExpectActiveGPUProvisionerPodName() string
func (*Environment) ExpectCABundle ¶
func (env *Environment) ExpectCABundle() string
func (*Environment) ExpectConfigMapExists ¶
func (env *Environment) ExpectConfigMapExists(key types.NamespacedName) *v1.ConfigMap
func (*Environment) ExpectCreated ¶
func (env *Environment) ExpectCreated(objects ...client.Object)
func (*Environment) ExpectCreatedNodeCount ¶
func (env *Environment) ExpectCreatedNodeCount(comparator string, count int) []*v1.Node
func (*Environment) ExpectCreatedWithOffset ¶
func (env *Environment) ExpectCreatedWithOffset(offset int, objects ...client.Object)
func (*Environment) ExpectDeleted ¶
func (env *Environment) ExpectDeleted(objects ...client.Object)
func (*Environment) ExpectDeletedWithOffset ¶
func (env *Environment) ExpectDeletedWithOffset(offset int, objects ...client.Object)
func (*Environment) ExpectExists ¶
func (env *Environment) ExpectExists(obj client.Object)
func (*Environment) ExpectGPUProvisionerPods ¶
func (env *Environment) ExpectGPUProvisionerPods() []*v1.Pod
func (*Environment) ExpectNoCrashes ¶
func (env *Environment) ExpectNoCrashes()
func (*Environment) ExpectPodsMatchingSelector ¶
func (env *Environment) ExpectPodsMatchingSelector(selector labels.Selector) []*v1.Pod
func (*Environment) ExpectSettings ¶
func (env *Environment) ExpectSettings() *v1.ConfigMap
ExpectSettings gets the gpu-provisioner-global-settings ConfigMap
func (*Environment) ExpectUniqueNodeNames ¶
func (env *Environment) ExpectUniqueNodeNames(selector labels.Selector, uniqueNames int)
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor is used to monitor the cluster state during a running test
func (*Monitor) CreatedNodeCount ¶
CreatedNodeCount returns the number of nodes created since the last reset
func (*Monitor) CreatedNodes ¶
CreatedNodes returns the nodes that have been created since the last reset (essentially Nodes - NodesAtReset)
func (*Monitor) DeletedNodes ¶
DeletedNodes returns the nodes that have been deleted since the last reset (essentially NodesAtReset - Nodes)
func (*Monitor) NodeCountAtReset ¶
NodeCountAtReset returns the number of nodes that were running when the monitor was last reset, typically at the beginning of a test
func (*Monitor) NodesAtReset ¶
NodesAtReset returns a slice of nodes that the monitor saw at the last reset
func (*Monitor) PendingPods ¶
PendingPods returns the number of pending pods matching the given selector
func (*Monitor) Reset ¶
func (m *Monitor) Reset()
Reset resets the cluster monitor prior to running a test.
func (*Monitor) RestartCount ¶
RestartCount returns the containers and number of restarts for that container for all containers in the pods in the given namespace
func (*Monitor) RunningPods ¶
RunningPods returns the number of running pods matching the given selector