Skip to content

e2e: reach clusterip clusters from the external test harness #923

Open

Description

@WalBeh

Follow-up from #920.

Problem

The e2e suite runs the operator in the pytest process (kopf_runner), outside the test cluster, with CRATEDB_OPERATOR_TESTING=true. In that mode get_host connects through the data service's LB address, or externalDNS for traefik. A clusterip cluster has neither, so get_host raises TemporaryError until the test ends. The clusterip e2e tests therefore use wait_for_healthy=False and never connect: bootstrap, health and suspend/resume are not tested end to end for clusterip.

Production is not affected. Outside test mode get_host always returns the headless crate-discovery-<name>.<namespace>, and #920 has a unit test that pins this for every exposure.

Options

  • Port-forward (preferred): in test mode, forward a local port to a CrateDB pod through the Kubernetes API. get_host returns only a host and connection_factory always uses port 5432, so the port must be passed through as well. No test-only code in operator handlers.
  • Test-only LB service: the test creates an extra LoadBalancer service with the data-service selector, and test-mode get_host uses it for clusterip. Cheap, but adds a test-only path to operator code.

On minikube, minikube tunnel also routes the service CIDR, but that does not help the AKS nightly job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions