Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AdditionalKustomizeDir string
AdditionalKustomizeDir is a path to additional kustomize configuration to deploy to the test cluster. It is applied after all configuration from this repository is applied.
Functions ¶
This section is empty.
Types ¶
type KustomizeDir ¶
type KustomizeDir string
KustomizeDir represents a path to a temporary kustomize directory that has everything from config dir plus the tests/ dir with kustomization.yaml that has the image patch in place.
func PrepareKustomizeDir ¶
func PrepareKustomizeDir(t *testing.T, image string) KustomizeDir
PrepareKustomizeDir prepares a temporary kustomize directory with operator image patch in place. It takes the provided image and uses it to append an "images:" section to resulting kustomization.yaml. It returns the KustomizeConfigPath that has methods to access particular paths.
func (KustomizeDir) CRD ¶
func (kcp KustomizeDir) CRD() string
CRD returns the path to the crd/ dir in the temporary kustomize directory.
func (KustomizeDir) ManagerKustomizationYAML ¶
func (kcp KustomizeDir) ManagerKustomizationYAML() string
ManagerKustomizationYAML returns the path to the file manager/kustomization.yaml
func (KustomizeDir) Tests ¶
func (kcp KustomizeDir) Tests() string
Tests returns the path to the tests/ dir in the temporary kustomize directory.
func (KustomizeDir) TestsKustomization ¶
func (kcp KustomizeDir) TestsKustomization() string
TestsKustomization returns the path to the tests/kustomization dir in the temporary kustomize directory.
type TestEnvOption ¶
type TestEnvOption func(opt *testEnvOptions)
TestEnvOption is a functional option for configuring a test environment.
func WithInstallViaKustomize ¶
func WithInstallViaKustomize() TestEnvOption
WithInstallViaKustomize makes the test environment install the operator and all the dependencies via kustomize.
func WithOperatorImage ¶
func WithOperatorImage(image string) TestEnvOption
WithOperatorImage allows configuring the operator image to use in the test environment.
type TestEnvironment ¶
type TestEnvironment struct { Clients *testutils.K8sClients Namespace *corev1.Namespace Cleaner *clusters.Cleaner Environment environments.Environment }
TestEnvironment represents a testing environment (K8s cluster) for running isolated e2e test.
func CreateEnvironment ¶
func CreateEnvironment(t *testing.T, ctx context.Context, opts ...TestEnvOption) TestEnvironment
CreateEnvironment creates a new independent testing environment for running isolated e2e test. When running with Helm, the caller is responsible for cleaning up the environment.