Documentation ¶
Overview ¶
Package test provides test utilities for the Syncer.
Index ¶
- Constants
- func AwaitAndVerifyResource(client dynamic.ResourceInterface, name string, ...) *unstructured.Unstructured
- func AwaitNoResource(client dynamic.ResourceInterface, name string)
- func AwaitResource(client dynamic.ResourceInterface, name string) *unstructured.Unstructured
- func CreateResource[T runtime.Object](resourceInterface dynamic.ResourceInterface, obj T) T
- func GetGroupVersionKindFor(obj runtime.Object) schema.GroupVersionKind
- func GetGroupVersionResourceFor(restMapper metaapi.RESTMapper, obj runtime.Object) *schema.GroupVersionResource
- func GetRESTMapperAndGroupVersionResourceFor(obj runtime.Object) (metaapi.RESTMapper, *schema.GroupVersionResource)
- func GetRESTMapperFor(objs ...runtime.Object) metaapi.RESTMapper
- func GetResource[T runtime.Object](resourceInterface dynamic.ResourceInterface, obj T) T
- func GetResourceAndError[T runtime.Object](resourceInterface dynamic.ResourceInterface, obj T) (T, error)
- func NewPod(namespace string) *corev1.Pod
- func NewPodWithImage(namespace, imageName string) *corev1.Pod
- func PrepInitialClientObjs(namespace, clusterID string, initObjs ...runtime.Object) []runtime.Object
- func SetClusterIDLabel[T runtime.Object](obj T, clusterID string) T
- func UpdateResource[T runtime.Object](resourceInterface dynamic.ResourceInterface, obj T) T
- func VerifyResource(resourceInterface dynamic.ResourceInterface, expected *corev1.Pod, ...)
Constants ¶
View Source
const ( RemoteNamespace = "remote-ns" LocalNamespace = "local-ns" )
Variables ¶
This section is empty.
Functions ¶
func AwaitAndVerifyResource ¶ added in v0.6.0
func AwaitAndVerifyResource(client dynamic.ResourceInterface, name string, verify func(*unstructured.Unstructured) bool, ) *unstructured.Unstructured
func AwaitNoResource ¶ added in v0.6.0
func AwaitNoResource(client dynamic.ResourceInterface, name string)
func AwaitResource ¶ added in v0.6.0
func AwaitResource(client dynamic.ResourceInterface, name string) *unstructured.Unstructured
func CreateResource ¶
func CreateResource[T runtime.Object](resourceInterface dynamic.ResourceInterface, obj T) T
func GetGroupVersionKindFor ¶ added in v0.6.0
func GetGroupVersionKindFor(obj runtime.Object) schema.GroupVersionKind
func GetGroupVersionResourceFor ¶ added in v0.6.0
func GetGroupVersionResourceFor(restMapper metaapi.RESTMapper, obj runtime.Object) *schema.GroupVersionResource
func GetRESTMapperAndGroupVersionResourceFor ¶
func GetRESTMapperAndGroupVersionResourceFor(obj runtime.Object) (metaapi.RESTMapper, *schema.GroupVersionResource)
func GetRESTMapperFor ¶ added in v0.6.0
func GetRESTMapperFor(objs ...runtime.Object) metaapi.RESTMapper
func GetResource ¶
func GetResource[T runtime.Object](resourceInterface dynamic.ResourceInterface, obj T) T
func GetResourceAndError ¶
func GetResourceAndError[T runtime.Object](resourceInterface dynamic.ResourceInterface, obj T) (T, error)
func NewPodWithImage ¶
func PrepInitialClientObjs ¶
func SetClusterIDLabel ¶
func UpdateResource ¶
func UpdateResource[T runtime.Object](resourceInterface dynamic.ResourceInterface, obj T) T
func VerifyResource ¶
func VerifyResource(resourceInterface dynamic.ResourceInterface, expected *corev1.Pod, expNamespace, clusterID string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.