Documentation ¶
Overview ¶
Package k8stest provides example objects for testing.
Index ¶
- Variables
- func AsRuntimeObjects(in []metav1.Object) (out []runtime.Object)
- func MakeDNS() flipopv1alpha1.DNSRecordSet
- func MakeMatch() flipopv1alpha1.Match
- func MakeNode(name, providerID string, mutators ...func(node metav1.Object) metav1.Object) *corev1.Node
- func MakePod(name, nodeName string, mutators ...func(pod metav1.Object) metav1.Object) *corev1.Pod
- func MarkDeleting(o metav1.Object) metav1.Object
- func MarkReady(o metav1.Object) metav1.Object
- func MarkRunning(o metav1.Object) metav1.Object
- func SetLabels(l labels.Set) func(metav1.Object) metav1.Object
- func SetNamespace(ns string) func(o metav1.Object) metav1.Object
- func SetNodeAddress(t corev1.NodeAddressType, addr string) func(o metav1.Object) metav1.Object
- func SetTaints(t []corev1.Taint) func(metav1.Object) metav1.Object
Constants ¶
This section is empty.
Variables ¶
var MatchingNodeLabels = labels.Set(map[string]string{
"system": "bajor",
"quadrant": "alpha",
})
MatchingNodeLabels is a set of node labels which match the selector from MakeMatch.
var MatchingPodLabels = labels.Set(map[string]string{
"vessel": "runabout",
"class": "danube",
})
MatchingPodLabels is a set of pod labels which match the selector from MakeMatch.
var NoSchedule = []corev1.Taint{ corev1.Taint{ Key: "node.kubernetes.io/unschedulable", Effect: corev1.TaintEffectNoSchedule, }, }
NoSchedule is a set taints which can be applied to a node to make it unschedulable.
var PodTolerations = []corev1.Toleration{ corev1.Toleration{ Key: "shields", Value: "down", Operator: corev1.TolerationOpEqual, Effect: corev1.TaintEffectNoExecute, }, corev1.Toleration{ Key: "alert", Value: "red", Operator: corev1.TolerationOpEqual, Effect: corev1.TaintEffectNoSchedule, }, }
PodTolerations is an example kubernetes node Toleration.
Functions ¶
func AsRuntimeObjects ¶
AsRuntimeObjects returns a slice of runtime.Objects based upon a slice of metav1.Object.
func MakeMatch ¶
func MakeMatch() flipopv1alpha1.Match
MakeMatch returns flipop match object which selects the pods/nodes specified in MatchingPodLabels, and MatchingNodeLabels.
func MakeNode ¶
func MakeNode(name, providerID string, mutators ...func(node metav1.Object) metav1.Object) *corev1.Node
MakeNode creates a node object and applies the specified mutators to customize the object.
func MakePod ¶
MakePod creates a pod and optionally applies a list of mutators to customize the object.
func MarkDeleting ¶
MarkDeleting returns a mutator which marks the object as deleting.
func MarkRunning ¶
MarkRunning returns a mutator which marks a pod as running.
func SetNamespace ¶
SetNamespace returns a mutator which sets the namespace of a kubernetes object.
func SetNodeAddress ¶
SetNodeAddress returns a mutator which adds the specified address to a node.
Types ¶
This section is empty.