Documentation ¶
Overview ¶
Package testutil implements helper utilities used in tests.
Index ¶
- func CreateKubeconfigSecret(cfg *rest.Config, clusterName, namespace string, crClient client.Client) error
- func CreateResources(f *os.File, cfg *rest.Config, dynamicClient dynamic.Interface) error
- func DeleteNamespace(ctx context.Context, clientset *kubernetes.Clientset, namespace string) error
- func DeleteResources(f *os.File, cfg *rest.Config, dynamicClient dynamic.Interface, ...) error
- func EnsureResources(f *os.File, cfg *rest.Config, dynamicClient dynamic.Interface) error
- func GetExternalCRDPaths(externalDeps map[string][]string) ([]string, error)
- func SetupWebhookCertificates(ctx context.Context, k8sClient client.Client, k8sConfig *rest.Config, ...) error
- type FakeDiscovery
- func (c FakeDiscovery) OpenAPISchema() (*openapiv2.Document, error)
- func (c FakeDiscovery) OpenAPIV3() openapi.Client
- func (c FakeDiscovery) RESTClient() rest.Interface
- func (c FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error)
- func (c FakeDiscovery) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error)
- func (c FakeDiscovery) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error)
- func (c FakeDiscovery) ServerPreferredResources() ([]*metav1.APIResourceList, error)
- func (c FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error)
- func (c FakeDiscovery) ServerVersion() (*version.Info, error)
- type FakeGVRHelper
- type WebhookCertificatesDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateKubeconfigSecret ¶
func CreateKubeconfigSecret(cfg *rest.Config, clusterName, namespace string, crClient client.Client) error
CreateKubeconfigSecret create a secret with kubeconfig token for the cluster provided by client
func CreateResources ¶
CreateResources using unstructured objects from a yaml/json file provided by decoder
func DeleteNamespace ¶
DeleteNamespace finalizes and deletes a namespace given its name
func DeleteResources ¶
func DeleteResources(f *os.File, cfg *rest.Config, dynamicClient dynamic.Interface, waitForDeletion bool) error
DeleteResources using unstructured objects from a yaml/json file provided by decoder.
func EnsureResources ¶
EnsureResources verifies that resources exist, creating it if necessary
func GetExternalCRDPaths ¶
GetExternalCRDPaths gets paths for external CRDs by introspecting versions of the go dependencies
Types ¶
type FakeDiscovery ¶
type FakeDiscovery struct { FakeDiscovery discovery.DiscoveryInterface Resources []*metav1.APIResourceList APIGroups *metav1.APIGroupList }
FakeDiscovery customize the behavior of fake client-go FakeDiscovery.ServerPreferredResources to return a customized APIResourceList. The client-go FakeDiscovery.ServerPreferredResources is hardcoded to return nil. https://github.com/kubernetes/client-go/blob/master/discovery/fake/discovery.go#L85
func (FakeDiscovery) OpenAPISchema ¶
func (c FakeDiscovery) OpenAPISchema() (*openapiv2.Document, error)
func (FakeDiscovery) OpenAPIV3 ¶
func (c FakeDiscovery) OpenAPIV3() openapi.Client
func (FakeDiscovery) RESTClient ¶
func (c FakeDiscovery) RESTClient() rest.Interface
func (FakeDiscovery) ServerGroups ¶
func (c FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error)
func (FakeDiscovery) ServerGroupsAndResources ¶
func (c FakeDiscovery) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error)
func (FakeDiscovery) ServerPreferredNamespacedResources ¶
func (c FakeDiscovery) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error)
func (FakeDiscovery) ServerPreferredResources ¶
func (c FakeDiscovery) ServerPreferredResources() ([]*metav1.APIResourceList, error)
func (FakeDiscovery) ServerResourcesForGroupVersion ¶
func (c FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error)
func (FakeDiscovery) ServerVersion ¶
func (c FakeDiscovery) ServerVersion() (*version.Info, error)
type FakeGVRHelper ¶
type FakeGVRHelper struct {
DiscoveryClient discovery.DiscoveryInterface
}
func (*FakeGVRHelper) GetDiscoveryClient ¶
func (f *FakeGVRHelper) GetDiscoveryClient() discovery.DiscoveryInterface
func (*FakeGVRHelper) GetGVR ¶
func (f *FakeGVRHelper) GetGVR(gk schema.GroupKind) (*schema.GroupVersionResource, error)