Documentation
¶
Index ¶
- Variables
- func DiscoverClusterName(config *rest.Config) (string, error)
- func NewClient(config *rest.Config) (client.Client, error)
- func NewConfig() *rest.Config
- type Environment
- func (env *Environment) AfterEach()
- func (env *Environment) BeforeEach()
- func (env *Environment) EventuallyExpectHealthy(pods ...*v1.Pod)
- func (env *Environment) EventuallyExpectHealthyPodCount(selector labels.Selector, numPods int)
- func (env *Environment) EventuallyExpectKarpenterWithEnvVar(envVar v1.EnvVar)
- func (env *Environment) ExpectCreated(objects ...client.Object)
- func (env *Environment) ExpectCreatedNodeCount(comparator string, nodeCount int)
- func (env *Environment) ExpectDeleted(objects ...client.Object)
- func (env *Environment) ExpectNodesEventuallyDeleted(timeout time.Duration, nodes ...*v1.Node)
- func (env *Environment) GetCreatedNodes(before []v1.Node, after []v1.Node) []*v1.Node
- type Monitor
- func (m *Monitor) CreatedNodes() int
- func (m *Monitor) GetNodes() []v1.Node
- func (m *Monitor) NodeCount() int
- func (m *Monitor) NodeCountAtReset() interface{}
- func (m *Monitor) Reset()
- func (m *Monitor) RestartCount() map[string]int
- func (m *Monitor) RunningPods(selector labels.Selector) int
- func (m *Monitor) TotalNodesSeen() int
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TestLabelName = "testing.karpenter.sh/test-id" CleanableObjects = []client.Object{ &v1.Pod{}, &appsv1.Deployment{}, &appsv1.DaemonSet{}, &v1beta1.PodDisruptionBudget{}, &v1.PersistentVolumeClaim{}, &v1.PersistentVolume{}, &storagev1.StorageClass{}, &v1alpha1.AWSNodeTemplate{}, &v1alpha5.Provisioner{}, } )
Functions ¶
Types ¶
type Environment ¶
type Environment struct {
context.Context
ClusterName string
Client client.Client
KubeClient kubernetes.Interface
EC2API ec2.EC2
SSMAPI ssm.SSM
Monitor *Monitor
}
func NewEnvironment ¶
func NewEnvironment(t *testing.T) (*Environment, error)
func (*Environment) AfterEach ¶
func (env *Environment) AfterEach()
func (*Environment) BeforeEach ¶
func (env *Environment) BeforeEach()
func (*Environment) EventuallyExpectHealthy ¶
func (env *Environment) EventuallyExpectHealthy(pods ...*v1.Pod)
func (*Environment) EventuallyExpectHealthyPodCount ¶
func (env *Environment) EventuallyExpectHealthyPodCount(selector labels.Selector, numPods int)
func (*Environment) EventuallyExpectKarpenterWithEnvVar ¶
func (env *Environment) EventuallyExpectKarpenterWithEnvVar(envVar v1.EnvVar)
func (*Environment) ExpectCreated ¶
func (env *Environment) ExpectCreated(objects ...client.Object)
func (*Environment) ExpectCreatedNodeCount ¶
func (env *Environment) ExpectCreatedNodeCount(comparator string, nodeCount int)
func (*Environment) ExpectDeleted ¶
func (env *Environment) ExpectDeleted(objects ...client.Object)
func (*Environment) ExpectNodesEventuallyDeleted ¶
func (env *Environment) ExpectNodesEventuallyDeleted(timeout time.Duration, nodes ...*v1.Node)
func (*Environment) GetCreatedNodes ¶
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor is used to monitor the cluster state during a running test
func (*Monitor) CreatedNodes ¶
CreatedNodes returns the number of nodes created since the last reset
func (*Monitor) NodeCountAtReset ¶
func (m *Monitor) NodeCountAtReset() interface{}
NodeCountAtReset returns the number of nodes that were running when the monitor was last reset, typically at the beginning of a test
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
func (*Monitor) TotalNodesSeen ¶
TotalNodesSeen returns the total number of unique nodes ever seen since the last reset.
Click to show internal directories.
Click to hide internal directories.