Documentation
¶
Overview ¶
Package phases declares the acceptance phases the Go harness carries.
hack/e2e-kind.sh stands the cluster up and runs every phase through run_recorded_phase. A phase ported to Go is one test function in the binary the driver builds from test/e2e, and this package is the contract between the two: the name the driver and support/e2e-suites.json know the phase by, the test that is the phase, the environment the driver hands it, the scenarios it records in the timing ledger, and the bound it runs under.
Three programs read it. The harness loads a phase's inputs from nothing else. hack/verify-kubernetes-support.go holds the driver's call to exactly those inputs. hack/acceptancecoverage lists the scenarios. The inputs are one struct per phase, so a phase reads what it declared and the compiler refuses anything else; a shell phase needed a hand-written environment contract and a scan of its source for the same answer.
The package imports nothing heavier than reflect, because the verifier and the coverage table import it too.
Index ¶
- Variables
- func Load[T any](p Of[T], lookup func(string) (string, bool)) (T, error)
- func PostgresDataDirectory(major int) string
- func PostgresImageMajor(image string) (int, error)
- type AlertingInputs
- type CertRotationInputs
- type ConfigMapSourceInputs
- type ControlPlaneInputs
- type DataPlaneInputs
- type GitSourceInputs
- type HAInputs
- type HTTPSSourceInputs
- type MigrationsInputs
- type Of
- type Phase
- type ReferenceDataInputs
- type UninstallInputs
- type UpgradeInputs
Constants ¶
This section is empty.
Variables ¶
var Alerting = define[AlertingInputs](Phase{ Name: "alerting", Test: "TestAlerting", Timeout: 90 * time.Minute, RequiresFull: []string{"assert"}, Scenarios: []string{ "native-producers", "monitoring-path", "unresolved-view-read-failures", "lost-scrape-target", "lost-view", "upgrade-alerts", }, })
Alerting proves scrape and admission faults, lost managers, and interrupted upgrades. Storage uses the certificate phase's independent monitoring setup.
var AlertingCertificates = define[AlertingInputs](Phase{ Name: "alerting-certificates", Test: "TestAlertingCertificates", Timeout: 60 * time.Minute, RequiresFull: []string{"assert"}, Scenarios: []string{"native-producers", "monitoring-path", "plan-store-large", "certificate-expiry"}, })
AlertingCertificates proves storage and expiry notifications and recovery. Both incidents share its monitoring namespace and native producers; each completes before the next changes certificates or retained plans.
var AlertingOperations = define[AlertingInputs](Phase{ Name: "alerting-operations", Test: "TestAlertingOperations", Timeout: 90 * time.Minute, Scenarios: []string{ "native-producers", "monitoring-path", "unresolved-apply", "ordinary-policy-waits", "stalled-operation", "resource-overdue", "lock-release-owed", "operations-failing", }, Artifacts: []string{"", "-uncertain"}, })
AlertingOperations owns operation incidents and the full no-page windows. It runs on another cluster so infrastructure faults cannot change its history.
var CertRotation = define[CertRotationInputs](Phase{ Name: "cert-rotation", Test: "TestCertRotation", Timeout: 100 * time.Minute, RequiresFull: []string{"assert"}, Scenarios: []string{ "recovery-guard", "live-helm-lookup", "corrupt-ca-recovery", "missing-secret-recreation", }, })
CertRotation proves certificate rotation: the exact recovery guard, Helm's live lookup, recovery from a corrupt CA and recreation of a deleted Secret.
var ConfigMapSources = define[ConfigMapSourceInputs](Phase{ Name: "configmap-sources", Test: "TestConfigMapSources", Timeout: 60 * time.Minute, Scenarios: []string{ "configmap-schema", "configmap-schema-edits", "configmap-migration", "journal-audit-lines", "configmap-snapshot-refused", "configmap-unreadable-source", "database-reachable-kind", "configmap-refused-statement", }, })
ConfigMapSources proves a schema and a migration sequence whose source is a ConfigMap: each applied with no registry, through a snapshot the manager wrote and the operation Pods checked; an edit to a selected key planning again and retiring the snapshot nothing names, and an edit to an unselected key planning nothing; a line on the manager's log for each journal entry both resources store, equal to it, and no other line for either; a snapshot replaced after approval refused by the Pod before the operation container starts; a desired file Ptah cannot read named in the condition and the Event, for a schema and a migration, and the fault of a schema it read and refuses; and a statement the database refuses, whose answer is in the Pod log and nowhere else, read by running the command the status and the Event print, as the diagnostic reader examples/diagnostic-reader-role.yaml is written for. The Job carries the 24 hour TTL, and the command still reads it past the five minutes any other Job keeps, counted from the Job's own finish time; the row does not wait for the 24 hours. On the same sources it proves DatabaseReachable: a wrong password in the URL reaches False with the authentication reason, and correcting the Secret reaches True.
var ControlPlane = define[ControlPlaneInputs](Phase{ Name: "assert", Test: "TestControlPlaneContract", Timeout: 60 * time.Minute, Scenarios: []string{ "manager-readiness", "crd-discovery", "finalizer-authorization", "realm-authorization", "plan-chunk-authorization", "webhook-configuration", "secret-isolation", "namespace-local-references", "verification-policy", "pod-webhook-outage-scope", "duration-bounds", "reference-keys", "managed-scope-selectors", "unsupported-engine", "suspended-schema-fixture", "approval-binding", "cross-namespace-approval", }, })
ControlPlane proves the control-plane contract: the release's readiness, discovery, authorization and admission shape, the API server's refusals, and the approval binding, against fixtures the later phases reuse.
var DataPlane = define[DataPlaneInputs](Phase{ Name: "dataplane", Test: "TestDataPlane", Timeout: 90 * time.Minute, RequiresFull: []string{"assert"}, Scenarios: []string{ "databases-and-fixtures", "postgresql-lifecycle", "native-plan-size-boundary", "closing-audits", "four-eyes-distinct-approver", "pod-metadata-admission", "pod-configuration-error", "postgresql-extension-drift", "oci-unreadable-schema", "postgresql-login-visibility-drift", }, Preparation: 1, })
DataPlane proves the PostgreSQL lifecycle, both engines' size limits, four-eyes approval, Pod metadata, a PostgreSQL extension's drift in Ptah's feature categories, what a schema artifact the executor cannot parse says, and drift under the documented login. It also prepares the other suites.
var GitSources = define[GitSourceInputs](Phase{ Name: "git-sources", Test: "TestGitSources", Timeout: 60 * time.Minute, Scenarios: []string{ "git-schema", "git-schema-moves", "git-schema-pinned", "git-force-push", "git-source-policy", "git-migration-ssh", "git-credential-refused", "git-source-refused", "git-source-unreadable", }, })
GitSources proves a schema and a migration sequence whose source is Git: a schema from a branch over HTTPS with a token and a CA, applied through the commit a Resolve Job found and the fetch every later Job made; the branch moving to a commit that changes no selected file, which plans nothing, and to one that changes the schema, which plans and applies; a source policy recorded beside the resolution, and a host it refuses before any Job; a schema pinned to a commit; a force-push that replaces that commit, which the branch follows and the pinned schema's Resolve refuses; a migration directory from a tag over SSH with a deploy key and pinned known hosts; a credential granted for another host, refused before Ptah runs; and a submodule, an LFS pointer and a host key the known hosts do not pin, each refused at its Resolve; and a schema file and a migration directory Ptah cannot read, each named in the condition and the Event.
var HA = define[HAInputs](Phase{ Name: "ha", Test: "TestHA", Timeout: 45 * time.Minute, Scenarios: []string{ "lease-authorization", "leader-failover", "operation-after-failover", }, })
HA proves leader election across two manager replicas: one namespaced Lease with exact RBAC, a failover that keeps the Lease and moves its holder, and an operation the new leader admits and reports in its metrics.
var HTTPSSources = define[HTTPSSourceInputs](Phase{ Name: "https-sources", Test: "TestHTTPSSources", Timeout: 60 * time.Minute, Scenarios: []string{ "https-schema", "https-migration", "https-schema-zip", "https-republished", "https-redirect-refused", "https-credential-refused", "https-source-refused", "https-source-policy", }, })
HTTPSSources proves a schema and a migration sequence whose source is an HTTPS download pinned by its digest, with no registry: a schema file behind Basic and a private CA, reached through a same-origin redirect, applied through the plan its Resolve bound; a migration directory in a gzip tar behind a Bearer token, applied in full; a schema file selected from a public zip, applied; that zip republished as other bytes holding the same file, refused naming both digests until the spec names the new one, and then kept without a new plan; a redirect to another origin, refused with the credential set and with nothing sent there; a credential granted for another host, refused before Ptah runs; a symbolic link and a ".." entry, each refused at its Resolve; and a source policy whose host list and content bound each refuse the source.
var MigrationFaultsMySQL = define[MigrationsInputs](Phase{ Name: "migration-faults-mysql", Test: "TestMigrationFaultsMySQL", Timeout: 90 * time.Minute, Scenarios: []string{ "fault-artifact", "mysql-migration-faults", "mysql-refused-migration-log", }, Artifacts: []string{"", "-uncertain"}, IsolatesNode: true, })
MigrationFaultsMySQL proves the same faults against MySQL.
var MigrationFaultsPostgreSQL = define[MigrationsInputs](Phase{ Name: "migration-faults-postgresql", Test: "TestMigrationFaultsPostgreSQL", Timeout: 90 * time.Minute, Scenarios: []string{ "fault-artifact", "postgresql-migration-faults", "postgresql-migration-drift-check", }, Artifacts: []string{"", "-uncertain"}, IsolatesNode: true, })
MigrationFaultsPostgreSQL proves the faults of the versioned-migration path against PostgreSQL: late dispatch, restored history, Apply faults, lock release, a lost node, unreadable artifacts, policy and egress refusals, retargeting, and the rebuild drill. Every row owns its migration and database, so the phase needs an artifact and the verification policy, not the lifecycle the migrations phase leaves behind.
var MigrationRuntimeMySQL = define[MigrationsInputs](Phase{ Name: "migration-runtime-mysql", Test: "TestMigrationRuntimeMySQL", Timeout: 60 * time.Minute, Scenarios: []string{ "runtime-artifact", "pod-configuration-past-deadline", "apply-asks-for-the-realm-lease", "approval-resource-replacement", "approval-policy-change", "approval-transaction-mode-change", "approval-artifact-change", "approval-verification-policy-uid-change", "approval-verification-policy-content-change", "approval-executor-image-change", "approval-ptah-version-change", "unsupported-controller-state-after-approval", "unsupported-runner-protocol-after-approval", "running-apply-executor-image-change", }, Artifacts: []string{""}, })
MigrationRuntimeMySQL proves execution bindings and runtime refusals against its own native artifact and isolated databases.
var MigrationRuntimePostgreSQL = define[MigrationsInputs](Phase{ Name: "migration-runtime-postgresql", Test: "TestMigrationRuntimePostgreSQL", Timeout: 60 * time.Minute, Scenarios: []string{ "runtime-artifact", "pod-configuration-past-deadline", "apply-asks-for-the-realm-lease", "approval-resource-replacement", "approval-policy-change", "approval-transaction-mode-change", "approval-artifact-change", "approval-verification-policy-uid-change", "approval-verification-policy-content-change", "approval-executor-image-change", "approval-ptah-version-change", "unsupported-controller-state-after-approval", "unsupported-runner-protocol-after-approval", "running-apply-executor-image-change", }, Artifacts: []string{""}, })
MigrationRuntimePostgreSQL proves execution bindings and runtime refusals against its own native artifact and isolated databases.
var MigrationsMySQL = define[MigrationsInputs](Phase{ Name: "migrations-mysql", Test: "TestMigrationsMySQL", Timeout: 90 * time.Minute, Scenarios: []string{ "migration-policy", "mysql-transaction-mode", "mysql-migrations", }, Artifacts: []string{""}, IsolatesNode: true, })
MigrationsMySQL proves the same path against MySQL, after the row that says which transaction mode a MySQL sequence may name.
var MigrationsPostgreSQL = define[MigrationsInputs](Phase{ Name: "migrations-postgresql", Test: "TestMigrationsPostgreSQL", Timeout: 90 * time.Minute, Scenarios: []string{ "migration-policy", "postgresql-migrations", }, Artifacts: []string{""}, IsolatesNode: true, })
MigrationsPostgreSQL proves the versioned-migration path against PostgreSQL: the approval gate, the applied sequence, the history it leaves, and the refusals that read that history.
var ReferenceDataMySQL = define[ReferenceDataInputs](Phase{ Name: "reference-data-mysql", Test: "TestReferenceDataMySQL", Timeout: 60 * time.Minute, Scenarios: []string{ "declared-row-values", "mysql-reference-data", }, })
ReferenceDataMySQL proves the same on MySQL.
var ReferenceDataPostgreSQL = define[ReferenceDataInputs](Phase{ Name: "reference-data-postgresql", Test: "TestReferenceDataPostgreSQL", Timeout: 60 * time.Minute, Scenarios: []string{ "declared-row-values", "postgresql-reference-data", }, })
ReferenceDataPostgreSQL proves declared reference data on PostgreSQL, from a database with no tables: the first rows, a data-only change, a stale approval after an external edit, a withdrawn and an emptied declaration, a protected table, and no row value anywhere but the database.
var SchemaApprovals = define[DataPlaneInputs](Phase{ Name: "schema-approvals", Test: "TestSchemaApprovals", Timeout: 90 * time.Minute, RequiresFull: []string{"assert"}, Scenarios: []string{ "watches", "approval-resource-replacement", "approval-target-secret-change", "approval-target-login-change", "approval-destructive-policy-change", "approval-exclusion-policy-change", "approval-verification-policy-change", "plan-stale-only-on-replacement", "approval-history-audit", }, })
SchemaApprovals proves that a schema approval stops binding when what it approved changes, on both engines, without waiting for the unrelated interruption sequence.
var SchemaFaults = define[DataPlaneInputs](Phase{ Name: "schema-faults", Test: "TestSchemaFaults", Timeout: 160 * time.Minute, IsolatesNode: true, RequiresFull: []string{"assert"}, Scenarios: []string{ "external-postgresql-lifecycle", "mysql-lifecycle", "mysql-dsn-refusal", "watches", "mysql-drift-before-dispatch", "hung-schema-result-read", "job-deadline", "manager-restart", "runner-termination", "job-deletion", "closing-audits", }, })
SchemaFaults keeps the shared fault watches and cluster-wide barriers in one phase, including the lifecycle assertions that must hold after faults.
var SchemaRuntime = define[DataPlaneInputs](Phase{ Name: "schema-runtime", Test: "TestSchemaRuntime", Timeout: 60 * time.Minute, RequiresFull: []string{"assert"}, Scenarios: []string{ "watches", "watch-history-audit", "approval-executor-image-change", "approval-ptah-version-change", "unsupported-controller-state-after-approval", "unsupported-runner-protocol-after-approval", "running-apply-executor-image-change", }, })
SchemaRuntime proves the executor and runtime bindings of a schema approval on both engines: a changed executor image or Ptah version, a controller state or runner protocol the manager no longer supports, and an executor change while an Apply runs. Each row rolls the manager, so the phase stands up its own fixtures and watches rather than sharing the approval rows'.
var Uninstall = define[UninstallInputs](Phase{ Name: "uninstall", Test: "TestUninstall", Timeout: 150 * time.Minute, Scenarios: []string{ "next-release-upgrade", "rollback", "uninstall", "reinstall-over-retained-crds", "exported-chart-install", "uninstall-first-teardown", }, })
Uninstall proves the release transitions after the upgrade: a synthetic next release that recovers from a late failure without interrupting a running Apply, a rollback refused over future state and then allowed, and an uninstall that removes the runtime and keeps the CRDs and live objects, followed by a reinstall over drifted CRDs and a fresh install of the exact exported chart bytes. It ends with the teardown the operations page gives a cluster that stays: a namespace holding retired result records inside their retention window goes once the release is uninstalled, before that window ends, and leaves none of its records or Secrets.
var Upgrade = define[UpgradeInputs](Phase{ Name: "upgrade", Test: "TestUpgrade", Timeout: 120 * time.Minute, Scenarios: []string{ "read-only-job-cleanup", "crd-preflight-refusals", "drifted-crd-upgrade", "controller-write-guard", "runtime-recovery", "singleton-coordination", }, })
Upgrade proves the CRD upgrade path: a CRD preflight that refuses a missing CRD, a newer schema or state and an incomplete or colliding identity without changing anything, drifted CRDs converged before the manager rolls out with every live object preserved, the manager's write guards, and one release per namespace.
Functions ¶
func Load ¶
Load reads the phase's inputs through lookup, which is os.LookupEnv outside a test. Every input is required and has to be non-empty: the driver binds each one, and a phase started without one would measure some other cluster or none. The error names every input that is missing, not only the first.
func PostgresDataDirectory ¶ added in v0.2.10
PostgresDataDirectory is the directory the official image of a major version declares as its volume, which PostgreSQL 18's image moved up one level. A mount anywhere else leaves Docker an anonymous volume at the declared path, and with the image's own PGDATA a mount at the old path stops 18 from starting.
func PostgresImageMajor ¶ added in v0.2.10
PostgresImageMajor is the PostgreSQL major version a digest-pinned image names in its tag. The release line a lifecycle runs on arrives as that one image reference, and the acceptance holds the server it reaches to this number, so a tag whose digest belongs to another line fails the run instead of reporting the wrong line as proven.
Types ¶
type AlertingInputs ¶
type AlertingInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// OperatorNamespace is the release namespace.
OperatorNamespace string `env:"E2E_OPERATOR_NAMESPACE"`
// TestNamespace holds the existing approval used for a dry-run admission probe.
TestNamespace string `env:"E2E_TEST_NAMESPACE"`
// ExecutorImage publishes the native producer artifacts.
ExecutorImage string `env:"E2E_EXECUTOR_IMAGE"`
// RegistryService is the prepared in-cluster artifact registry.
RegistryService string `env:"E2E_REGISTRY_SERVICE"`
// HelmRelease is the installed release, whose values the rules are
// rendered with.
HelmRelease string `env:"E2E_HELM_RELEASE"`
// ChartPackage is the chart the release was installed from.
ChartPackage string `env:"E2E_CHART_PACKAGE"`
// The existing synthetic next release gives upgrade faults a distinct runtime.
NextChartPackage string `env:"E2E_NEXT_CHART_PACKAGE"`
NextValuesFile string `env:"E2E_NEXT_VALUES_FILE"`
// FixtureImage carries the alert receiver.
FixtureImage string `env:"E2E_FIXTURE_IMAGE"`
// PrometheusImage and AlertmanagerImage are the monitoring path, mirrored
// into the registry and pinned by digest.
PrometheusImage string `env:"E2E_PROMETHEUS_IMAGE"`
AlertmanagerImage string `env:"E2E_ALERTMANAGER_IMAGE"`
// RegistryCredentialsFile holds the registry's username and password,
// which the monitoring Pods pull their images with.
RegistryCredentialsFile string `env:"E2E_REGISTRY_CREDENTIALS_FILE"`
}
AlertingInputs is what the driver hands the alerting phase. The data-plane preparation supplies databases and a registry; alerting creates its own producers.
type CertRotationInputs ¶
type CertRotationInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// OperatorNamespace is the release namespace, where the manager, the
// rotator, their Secrets and the webhook Service live.
OperatorNamespace string `env:"E2E_OPERATOR_NAMESPACE"`
// TestNamespace holds the approval the control-plane contract leaves
// behind. The phase reaches approval admission through it.
TestNamespace string `env:"E2E_TEST_NAMESPACE"`
// HelmRelease is the installed release.
HelmRelease string `env:"E2E_HELM_RELEASE"`
// ChartPackage is the packaged chart the release was installed from. The
// phase upgrades to it so that the chart's live lookup of the certificate
// runs against a cluster that has one.
ChartPackage string `env:"E2E_CHART_PACKAGE"`
}
CertRotationInputs is what the driver hands the certificate rotation phase.
type ConfigMapSourceInputs ¶ added in v0.2.7
type ConfigMapSourceInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// TestNamespace is the namespace the data plane stood up in preparation,
// with its PostgreSQL server and the Secret that holds its password.
TestNamespace string `env:"E2E_TEST_NAMESPACE"`
// OperatorNamespace is the release namespace, whose manager Pods' logs
// the journal lines are read from.
OperatorNamespace string `env:"E2E_OPERATOR_NAMESPACE"`
}
ConfigMapSourceInputs is what the driver hands the ConfigMap source phase. It runs in the namespace the data plane stood up, on its PostgreSQL server, and reaches no registry: that a resource whose source is a ConfigMap needs none is part of what it proves.
type ControlPlaneInputs ¶
type ControlPlaneInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// OperatorNamespace is the release namespace.
OperatorNamespace string `env:"E2E_OPERATOR_NAMESPACE"`
// TestNamespace is where the phase creates its schema, plan and approval
// fixtures, which the certificates and data-plane phases go on to use.
TestNamespace string `env:"E2E_TEST_NAMESPACE"`
// ForeignNamespace holds the objects a reference from TestNamespace must
// not reach.
ForeignNamespace string `env:"E2E_FOREIGN_NAMESPACE"`
// HelmRelease is the installed release.
HelmRelease string `env:"E2E_HELM_RELEASE"`
// ExecutorImage is the digest-pinned Ptah executor the release runs.
ExecutorImage string `env:"E2E_EXECUTOR_IMAGE"`
// RunnerImage is the runner image built beside the manager.
RunnerImage string `env:"E2E_RUNNER_IMAGE"`
// PtahVersion is the Ptah version bound beside the executor.
PtahVersion string `env:"E2E_PTAH_VERSION"`
// ControllerImage is the candidate manager image, pinned by digest.
ControllerImage string `env:"E2E_CONTROLLER_IMAGE"`
// ControllerRevision is the commit the candidate was built from.
ControllerRevision string `env:"E2E_CONTROLLER_REVISION"`
// ControllerStateVersion is the controller-state version the chart was
// stamped with.
ControllerStateVersion string `env:"E2E_CONTROLLER_STATE_VERSION"`
}
ControlPlaneInputs is what the driver hands the control-plane contract phase, which the driver knows as assert.
type DataPlaneInputs ¶
type DataPlaneInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// OperatorNamespace is the release namespace.
OperatorNamespace string `env:"E2E_OPERATOR_NAMESPACE"`
// TestNamespace is where the phase stands up its registry endpoint, its
// databases and its fixtures, and where the migration suites find them.
TestNamespace string `env:"E2E_TEST_NAMESPACE"`
// HelmRelease is the installed release.
HelmRelease string `env:"E2E_HELM_RELEASE"`
// ChartPackage is the packaged chart the release was installed from. The
// four-eyes row upgrades the release to it with one value changed.
ChartPackage string `env:"E2E_CHART_PACKAGE"`
// PtahVersion is the Ptah version bound beside the executor.
PtahVersion string `env:"E2E_PTAH_VERSION"`
// ExecutorImage is the digest-pinned Ptah executor the release runs.
ExecutorImage string `env:"E2E_EXECUTOR_IMAGE"`
// RunnerImage is the runner image built beside the manager.
RunnerImage string `env:"E2E_RUNNER_IMAGE"`
// FixtureImage carries the TLS registry proxy and the fault fixtures.
FixtureImage string `env:"E2E_FIXTURE_IMAGE"`
// ControllerImage is the candidate manager image, pinned by digest.
ControllerImage string `env:"E2E_CONTROLLER_IMAGE"`
// ControllerRevision is the commit the candidate was built from.
ControllerRevision string `env:"E2E_CONTROLLER_REVISION"`
// ControllerStateVersion is the controller-state version the chart was
// stamped with.
ControllerStateVersion string `env:"E2E_CONTROLLER_STATE_VERSION"`
// PostgresImage and MySQLImage are the database servers the phase runs in
// the test namespace.
PostgresImage string `env:"E2E_POSTGRES_IMAGE"`
MySQLImage string `env:"E2E_MYSQL_IMAGE"`
// RegistryHostAddress is the registry as the host reaches it, for the
// artifact no product command builds.
RegistryHostAddress string `env:"E2E_REGISTRY_HOST_ADDRESS"`
// RegistryIP is the registry container's address on the kind network,
// RegistryService the Service that routes to it, and RegistryPort the
// host port the driver published it on.
RegistryIP string `env:"E2E_REGISTRY_IP"`
RegistryService string `env:"E2E_REGISTRY_SERVICE"`
RegistryPort string `env:"E2E_REGISTRY_PORT"`
// RegistryCredentialsFile holds the registry's username and password.
RegistryCredentialsFile string `env:"E2E_REGISTRY_CREDENTIALS_FILE"`
// DockerContext is the remote Docker daemon the registry and the external
// PostgreSQL run on, and RegistryContainerID the registry container the
// outage row stops.
DockerContext string `env:"E2E_DOCKER_CONTEXT"`
RegistryContainerID string `env:"E2E_REGISTRY_CONTAINER_ID"`
// The external PostgreSQL: a container outside Kubernetes that a
// selectorless Service routes to.
ExternalPostgresContainerID string `env:"E2E_EXTERNAL_POSTGRES_CONTAINER_ID"`
ExternalPostgresIP string `env:"E2E_EXTERNAL_POSTGRES_IP"`
ExternalPostgresService string `env:"E2E_EXTERNAL_POSTGRES_SERVICE"`
ExternalPostgresImage string `env:"E2E_EXTERNAL_POSTGRES_IMAGE"`
ExternalPostgresOwner string `env:"E2E_EXTERNAL_POSTGRES_OWNER"`
ExternalPostgresCredentialsFile string `env:"E2E_EXTERNAL_POSTGRES_CREDENTIALS_FILE"`
// The authenticated HTTPS registry proxy: its Service and the CA,
// certificate and key the driver generated for it.
TLSProxyService string `env:"E2E_TLS_PROXY_SERVICE"`
TLSProxyCAFile string `env:"E2E_TLS_PROXY_CA_FILE"`
TLSProxyCertFile string `env:"E2E_TLS_PROXY_CERT_FILE"`
TLSProxyKeyFile string `env:"E2E_TLS_PROXY_KEY_FILE"`
// Mode is full or prepare. The migration suites run the phase in prepare,
// for the namespace it stands up and none of its own acceptance.
Mode string `env:"E2E_DATAPLANE_MODE"`
}
DataPlaneInputs is what the driver hands the data-plane phase.
type GitSourceInputs ¶ added in v0.2.7
type GitSourceInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// TestNamespace is the namespace the data plane stood up in preparation,
// with its PostgreSQL server, the Secret that holds its password and the
// registry pull Secret.
TestNamespace string `env:"E2E_TEST_NAMESPACE"`
// FixtureImage carries the Git server.
FixtureImage string `env:"E2E_FIXTURE_IMAGE"`
}
GitSourceInputs is what the driver hands the Git source phase. It runs in the namespace the data plane stood up, on its PostgreSQL server, and serves its repository from the fixture image.
type HAInputs ¶
type HAInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// OperatorNamespace is the release namespace.
OperatorNamespace string `env:"E2E_OPERATOR_NAMESPACE"`
// HATestNamespace is the namespace the phase creates its operation in,
// and removes.
HATestNamespace string `env:"E2E_HA_TEST_NAMESPACE"`
// ForeignNamespace and ProofNamespace are namespaces the manager's Lease
// grant must not reach.
ForeignNamespace string `env:"E2E_FOREIGN_NAMESPACE"`
ProofNamespace string `env:"E2E_PROOF_NAMESPACE"`
// HelmRelease is the installed release.
HelmRelease string `env:"E2E_HELM_RELEASE"`
// RegistryCredentialsFile holds the registry's username and password,
// which the operation Pod pulls its images with.
RegistryCredentialsFile string `env:"E2E_REGISTRY_CREDENTIALS_FILE"`
}
HAInputs is what the driver hands the high-availability phase.
type HTTPSSourceInputs ¶ added in v0.2.12
type HTTPSSourceInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// TestNamespace is the namespace the data plane stood up in preparation,
// with its PostgreSQL server, the Secret that holds its password and the
// registry pull Secret.
TestNamespace string `env:"E2E_TEST_NAMESPACE"`
// FixtureImage carries the download server.
FixtureImage string `env:"E2E_FIXTURE_IMAGE"`
}
HTTPSSourceInputs is what the driver hands the HTTPS source phase. It runs in the namespace the data plane stood up, on its PostgreSQL server, and serves its downloads from the fixture image.
type MigrationsInputs ¶
type MigrationsInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// TestNamespace is the namespace the data plane stood up in preparation:
// its registry Service, its databases and its admission fixtures.
TestNamespace string `env:"E2E_TEST_NAMESPACE"`
// ExecutorImage publishes the migration artifacts, with the command a
// person would use.
ExecutorImage string `env:"E2E_EXECUTOR_IMAGE"`
// PtahVersion is the driver's declaration of the pinned executor build.
PtahVersion string `env:"E2E_PTAH_VERSION"`
// RunnerImage is the runner image the migration Jobs carry.
RunnerImage string `env:"E2E_RUNNER_IMAGE"`
// FixtureImage carries the isolated unsupported-runner publisher.
FixtureImage string `env:"E2E_FIXTURE_IMAGE"`
// ControllerImage is the candidate manager image, pinned by digest.
ControllerImage string `env:"E2E_CONTROLLER_IMAGE"`
// ControllerRevision is the commit the candidate was built from.
ControllerRevision string `env:"E2E_CONTROLLER_REVISION"`
// ControllerStateVersion is the controller-state version the chart was
// stamped with.
ControllerStateVersion string `env:"E2E_CONTROLLER_STATE_VERSION"`
// RegistryService is the Service the cluster reaches the registry by.
RegistryService string `env:"E2E_REGISTRY_SERVICE"`
// RegistryHostAddress is the same registry as the host reaches it, for the
// one artifact no product command can produce.
RegistryHostAddress string `env:"E2E_REGISTRY_HOST_ADDRESS"`
// RegistryCredentialsFile holds the registry's username and password.
RegistryCredentialsFile string `env:"E2E_REGISTRY_CREDENTIALS_FILE"`
// DockerContext and KindClusterName reach the isolation worker's node
// container, which the phase cuts off from the API server.
DockerContext string `env:"E2E_DOCKER_CONTEXT"`
KindClusterName string `env:"E2E_KIND_CLUSTER_NAME"`
// Engine is postgresql or mysql, and has to be the phase's own.
Engine string `env:"E2E_ENGINE"`
}
MigrationsInputs is what the driver hands the migration phases. Each phase runs one engine, and the driver names it: a phase that fell back to one engine because nobody named one would be coverage nobody noticed was gone.
type Of ¶
Of is a phase whose inputs are T. The harness takes one and returns a T, so the type of what a phase reads is decided where the phase is declared.
type Phase ¶
type Phase struct {
// Name is the phase as run_recorded_phase and the suite catalog spell it.
Name string
// Test is the test function in test/e2e that is the phase. The binary runs
// that function and nothing else when it is asked for the phase.
Test string
// Timeout bounds the whole phase. It sits above the sum of the phase's own
// waits, so it is a backstop for a call that hangs rather than a deadline
// any wait relies on.
Timeout time.Duration
// Scenarios are the stages the phase records in the timing ledger, in the
// order it runs them. The harness refuses one out of order and fails a
// phase that ends without running all of them.
Scenarios []string
// IsolatesNode says the full phase faults the isolation worker's API
// connection, so only a suite that declares that worker may run it.
// These faults run after the Preparation boundary, when one exists.
IsolatesNode bool
// Preparation is how many of the leading scenarios make up the phase's
// preparation mode: what another suite runs it for, the objects it stands
// up, and none of its own acceptance. Zero means the phase has no such
// mode. A run that stopped at the boundary proved those scenarios alone.
Preparation int
// RequiresFull names earlier phases whose completed acceptance leaves
// fixtures this phase uses. These dependencies apply when this phase runs
// in full; its preparation prefix must stand on its own. Running a required
// phase only through its own preparation boundary is insufficient.
RequiresFull []string
// Artifacts are the migration artifacts a row of the phase reads that the
// same row does not publish, named by the suffix the row builds its
// reference with: "" is the engine's own artifact, "-uncertain" the slow
// one. The phase publishes every one of them itself, because its suite
// runs it against a registry no other phase wrote to.
// hack/e2e_artifacts_test.go holds the list to the rows that read them.
Artifacts []string
// contains filtered or unexported fields
}
Phase is one acceptance phase the Go harness carries.
type ReferenceDataInputs ¶
type ReferenceDataInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// TestNamespace is the namespace the data plane stood up in preparation:
// its registry Service, its databases and its registry credentials.
TestNamespace string `env:"E2E_TEST_NAMESPACE"`
// OperatorNamespace is the release namespace, whose controller log the
// phase scans for declared row values.
OperatorNamespace string `env:"E2E_OPERATOR_NAMESPACE"`
// ExecutorImage publishes the reference-data artifacts, with the command a
// person would use.
ExecutorImage string `env:"E2E_EXECUTOR_IMAGE"`
// RunnerImage is the runner image the operation Jobs carry.
RunnerImage string `env:"E2E_RUNNER_IMAGE"`
// RegistryService is the Service the cluster reaches the registry by.
RegistryService string `env:"E2E_REGISTRY_SERVICE"`
// Engine is postgresql or mysql, and has to be the phase's own.
Engine string `env:"E2E_ENGINE"`
}
ReferenceDataInputs is what the driver hands the reference-data phases. They run in the namespace the data plane stood up, on its database servers, each on a database of its own that no other phase touched.
type UninstallInputs ¶
type UninstallInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// DebugLogs is 1 to print the stderr of a refused Helm operation, and 0
// otherwise.
DebugLogs string `env:"E2E_DEBUG_LOGS"`
// OperatorNamespace is the release namespace.
OperatorNamespace string `env:"E2E_OPERATOR_NAMESPACE"`
// ProofNamespace holds the objects the upgrade phase created, which every
// step here has to leave exactly as they were.
ProofNamespace string `env:"E2E_PROOF_NAMESPACE"`
// HelmRelease is the installed release.
HelmRelease string `env:"E2E_HELM_RELEASE"`
// ChartPackage and CandidateValuesFile are the current release, which the
// phase rolls back to and installs again from its exact bytes.
ChartPackage string `env:"E2E_CHART_PACKAGE"`
CandidateValuesFile string `env:"E2E_CANDIDATE_VALUES_FILE"`
// ControllerImage is the candidate manager image, pinned by digest.
ControllerImage string `env:"E2E_CONTROLLER_IMAGE"`
// NextChartPackage, NextValuesFile and NextControllerImage are the
// synthetic next release the phase upgrades to.
NextChartPackage string `env:"E2E_NEXT_CHART_PACKAGE"`
NextValuesFile string `env:"E2E_NEXT_VALUES_FILE"`
NextControllerImage string `env:"E2E_NEXT_CONTROLLER_IMAGE"`
// KubernetesVersion is the exact version the cluster has to report.
KubernetesVersion string `env:"E2E_KUBERNETES_VERSION"`
// RegistryCredentialsFile holds the registry's username and password,
// which the running Apply's Pod pulls its images with.
RegistryCredentialsFile string `env:"E2E_REGISTRY_CREDENTIALS_FILE"`
// DockerContext and ExternalPostgresContainerID reach the external
// PostgreSQL, where the running Apply's barrier holds its lock.
DockerContext string `env:"E2E_DOCKER_CONTEXT"`
ExternalPostgresContainerID string `env:"E2E_EXTERNAL_POSTGRES_CONTAINER_ID"`
// ExternalPostgresIP and ExternalPostgresCredentialsFile are the address
// and credentials the running Apply connects with.
ExternalPostgresIP string `env:"E2E_EXTERNAL_POSTGRES_IP"`
ExternalPostgresCredentialsFile string `env:"E2E_EXTERNAL_POSTGRES_CREDENTIALS_FILE"`
// TeardownNamespace is the namespace the uninstall-first teardown runs
// an operation in, and deletes once the release is gone.
TeardownNamespace string `env:"E2E_TEARDOWN_NAMESPACE"`
}
UninstallInputs is what the driver hands the uninstall phase, which runs last on the cluster the upgrade phase leaves.
type UpgradeInputs ¶
type UpgradeInputs struct {
// Kubeconfig names the cluster the driver stood up.
Kubeconfig string `env:"E2E_KUBECONFIG"`
// DebugLogs is 1 to print the stderr of a refused Helm operation, and 0
// otherwise. The driver refuses 1 on CI, where the run log is public.
DebugLogs string `env:"E2E_DEBUG_LOGS"`
// OperatorNamespace is the release namespace.
OperatorNamespace string `env:"E2E_OPERATOR_NAMESPACE"`
// ProofNamespace holds the schema, plan and approval whose preservation
// the phase proves across every CRD change.
ProofNamespace string `env:"E2E_PROOF_NAMESPACE"`
// HelmRelease is the installed release.
HelmRelease string `env:"E2E_HELM_RELEASE"`
// ChartPackage is the chart the release was installed from.
ChartPackage string `env:"E2E_CHART_PACKAGE"`
// CandidateValuesFile is the values file the release was installed with.
CandidateValuesFile string `env:"E2E_CANDIDATE_VALUES_FILE"`
// ControllerImage is the candidate manager image, pinned by digest.
ControllerImage string `env:"E2E_CONTROLLER_IMAGE"`
// KubernetesVersion is the exact version the cluster has to report.
KubernetesVersion string `env:"E2E_KUBERNETES_VERSION"`
}
UpgradeInputs is what the driver hands the upgrade phase, which proves the CRD upgrade path of the release the driver installed.