Documentation ¶
Index ¶
- Constants
- func StartEnvTest(projectRootDir string) (*envtest.Environment, *rest.Config, error)
- type TestEnvironment
- func (env TestEnvironment) CreateK8sResource(ctx context.Context, obj client.Object) error
- func (env TestEnvironment) CreateUnstructuredK8sResource(ctx context.Context, obj *unstructured.Unstructured) error
- func (env TestEnvironment) DeleteConfigMapFromK8s(ctx context.Context, name, namespace string) error
- func (env TestEnvironment) DeleteSecretFromK8s(ctx context.Context, name, namespace string) error
- func (env TestEnvironment) DeleteServiceFromK8s(ctx context.Context, name, namespace string) error
- func (env TestEnvironment) EnsureK8sConfigMapExists(t *testing.T, ctx context.Context, name, namespace string)
- func (env TestEnvironment) EnsureK8sConfigMapNotFound(t *testing.T, ctx context.Context, name, namespace string)
- func (env TestEnvironment) EnsureK8sResourceCreated(t *testing.T, ctx context.Context, obj client.Object)
- func (env TestEnvironment) EnsureK8sResourceDeleted(t *testing.T, ctx context.Context, obj client.Object)
- func (env TestEnvironment) EnsureK8sResourceUpdated(t *testing.T, ctx context.Context, obj client.Object)
- func (env TestEnvironment) EnsureK8sSecretExists(t *testing.T, ctx context.Context, name, namespace string)
- func (env TestEnvironment) EnsureK8sSecretNotFound(t *testing.T, ctx context.Context, name, namespace string)
- func (env TestEnvironment) EnsureK8sServiceExists(t *testing.T, ctx context.Context, name, namespace string)
- func (env TestEnvironment) EnsureK8sServiceNotFound(t *testing.T, ctx context.Context, name, namespace string)
- func (env TestEnvironment) EnsureK8sUnStructResourceCreated(t *testing.T, ctx context.Context, obj *unstructured.Unstructured)
- func (env TestEnvironment) EnsureNamespaceCreation(t *testing.T, ctx context.Context, namespace string)
- func (env TestEnvironment) GetCompanionCRFromK8s(ctx context.Context, name, namespace string) (kcmv1alpha1.Companion, error)
- func (env TestEnvironment) GetConfigMapFromK8s(ctx context.Context, name, namespace string) (*kcorev1.ConfigMap, error)
- func (env TestEnvironment) GetSecretFromK8s(ctx context.Context, name, namespace string) (*kcorev1.Secret, error)
- func (env TestEnvironment) GetServiceFromK8s(ctx context.Context, name, namespace string) (*kcorev1.Service, error)
- func (env TestEnvironment) TearDown() error
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func StartEnvTest ¶
Types ¶
type TestEnvironment ¶
type TestEnvironment struct { EnvTestInstance *envtest.Environment K8sDynamicClient *dynamic.DynamicClient KubeClient kcmk8s.Client Reconciler *kcmctrl.Reconciler Logger *zap.SugaredLogger Recorder *record.EventRecorder TestCancelFn context.CancelFunc // contains filtered or unexported fields }
TestEnvironment provides mocked resources for integration tests.
func NewTestEnvironment ¶
func NewTestEnvironment(projectRootDir string) (*TestEnvironment, error)
func (TestEnvironment) CreateK8sResource ¶
func (TestEnvironment) CreateUnstructuredK8sResource ¶
func (env TestEnvironment) CreateUnstructuredK8sResource(ctx context.Context, obj *unstructured.Unstructured) error
func (TestEnvironment) DeleteConfigMapFromK8s ¶
func (env TestEnvironment) DeleteConfigMapFromK8s(ctx context.Context, name, namespace string) error
func (TestEnvironment) DeleteSecretFromK8s ¶
func (env TestEnvironment) DeleteSecretFromK8s(ctx context.Context, name, namespace string) error
func (TestEnvironment) DeleteServiceFromK8s ¶
func (env TestEnvironment) DeleteServiceFromK8s(ctx context.Context, name, namespace string) error
func (TestEnvironment) EnsureK8sConfigMapExists ¶
func (TestEnvironment) EnsureK8sConfigMapNotFound ¶
func (TestEnvironment) EnsureK8sResourceCreated ¶
func (TestEnvironment) EnsureK8sResourceDeleted ¶
func (TestEnvironment) EnsureK8sResourceUpdated ¶
func (TestEnvironment) EnsureK8sSecretExists ¶
func (TestEnvironment) EnsureK8sSecretNotFound ¶
func (TestEnvironment) EnsureK8sServiceExists ¶
func (TestEnvironment) EnsureK8sServiceNotFound ¶
func (TestEnvironment) EnsureK8sUnStructResourceCreated ¶
func (env TestEnvironment) EnsureK8sUnStructResourceCreated(t *testing.T, ctx context.Context, obj *unstructured.Unstructured, )
func (TestEnvironment) EnsureNamespaceCreation ¶
func (TestEnvironment) GetCompanionCRFromK8s ¶
func (env TestEnvironment) GetCompanionCRFromK8s(ctx context.Context, name, namespace string, ) (kcmv1alpha1.Companion, error)
func (TestEnvironment) GetConfigMapFromK8s ¶
func (TestEnvironment) GetSecretFromK8s ¶
func (TestEnvironment) GetServiceFromK8s ¶
func (TestEnvironment) TearDown ¶
func (env TestEnvironment) TearDown() error
Click to show internal directories.
Click to hide internal directories.