Documentation ¶
Index ¶
- Constants
- func CreateKindClusterWithVersion(clusterName, configPath string) env.Func
- func CreateNSForTest(ctx context.Context, cfg *envconf.Config, t *testing.T, runID string) (context.Context, error)
- func CreateNamespace(ctx context.Context, k8sClient client.Client, name string) error
- func DeleteNamespace(ctx context.Context, cfg *envconf.Config, t *testing.T, _ string) (context.Context, error)
- func DestroyKindCluster(clusterName string) env.Func
- func GetClusterVersion() env.Func
- func GetResource(ctx context.Context, k8sClient client.Client, name, namespace string, ...) error
- func RandString(n int) string
- func SetupCRDs(crdPath, pattern string) env.Func
- func SetupEnvTest() env.Func
- func StopEnvTest() env.Func
- type Method
- type PossiblyErroringFakeCtrlRuntimeClient
- func (p PossiblyErroringFakeCtrlRuntimeClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (p PossiblyErroringFakeCtrlRuntimeClient) List(ctx context.Context, dpl client.ObjectList, opts ...client.ListOption) error
- func (p PossiblyErroringFakeCtrlRuntimeClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, ...) error
- func (p PossiblyErroringFakeCtrlRuntimeClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
Constants ¶
View Source
const ( List = iota Create Update Patch )
Variables ¶
This section is empty.
Functions ¶
func CreateKindClusterWithVersion ¶
CreateKindClusterWithVersion create KinD cluster with a specific version
func CreateNSForTest ¶
func CreateNSForTest(ctx context.Context, cfg *envconf.Config, t *testing.T, runID string) (context.Context, error)
TODO: rename me in CreateNamespace CreateNSForTest creates a random namespace with the runID as a prefix. It is stored in the context so that the deleteNSForTest routine can look it up and delete it.
func CreateNamespace ¶
func DeleteNamespace ¶
func DeleteNamespace(ctx context.Context, cfg *envconf.Config, t *testing.T, _ string) (context.Context, error)
DeleteNamespace looks up the namespace corresponding to the given test and deletes it.
func DestroyKindCluster ¶
CreateKindClusterWithVersion destroy KinD cluster with cluster name. If skipDeleteClusterFlag is set, it avoid the delete of the cluster (useful when running tests locally various times).
func GetClusterVersion ¶
func GetResource ¶
func GetResource(ctx context.Context, k8sClient client.Client, name, namespace string, resource *unstructured.Unstructured) error
func RandString ¶
func SetupEnvTest ¶ added in v0.5.1
func StopEnvTest ¶ added in v0.5.1
Types ¶
type PossiblyErroringFakeCtrlRuntimeClient ¶
type PossiblyErroringFakeCtrlRuntimeClient struct { client.Client ShouldError func(method Method, obj runtime.Object) bool }
func (PossiblyErroringFakeCtrlRuntimeClient) Create ¶
func (p PossiblyErroringFakeCtrlRuntimeClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
func (PossiblyErroringFakeCtrlRuntimeClient) List ¶
func (p PossiblyErroringFakeCtrlRuntimeClient) List(ctx context.Context, dpl client.ObjectList, opts ...client.ListOption) error
func (PossiblyErroringFakeCtrlRuntimeClient) Patch ¶
func (p PossiblyErroringFakeCtrlRuntimeClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error
func (PossiblyErroringFakeCtrlRuntimeClient) Update ¶
func (p PossiblyErroringFakeCtrlRuntimeClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
Click to show internal directories.
Click to hide internal directories.