205 lines
10 KiB
Go
205 lines
10 KiB
Go
|
|
package cluster
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"time"
|
||
|
|
|
||
|
|
"scm.bstein.dev/bstein/ananke/internal/config"
|
||
|
|
)
|
||
|
|
|
||
|
|
// TestHookWaitForPostStartProbes runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookWaitForPostStartProbes(ctx context.Context) error.
|
||
|
|
// Why: exposes post-start probe gate internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookWaitForPostStartProbes(ctx context.Context) error {
|
||
|
|
return o.waitForPostStartProbes(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookPostStartProbesReady runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookPostStartProbesReady(ctx context.Context) (bool, string).
|
||
|
|
// Why: exposes post-start probe poll internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookPostStartProbesReady(ctx context.Context) (bool, string) {
|
||
|
|
return o.postStartProbesReady(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookHTTPProbe runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookHTTPProbe(ctx context.Context, probeURL string) (int, error).
|
||
|
|
// Why: exposes HTTP probe internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookHTTPProbe(ctx context.Context, probeURL string) (int, error) {
|
||
|
|
return o.httpProbe(ctx, probeURL)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookResumeFluxAndReconcile runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookResumeFluxAndReconcile(ctx context.Context) error.
|
||
|
|
// Why: exposes flux resume/reconcile internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookResumeFluxAndReconcile(ctx context.Context) error {
|
||
|
|
return o.resumeFluxAndReconcile(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookEnsureRequiredNodeLabels runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookEnsureRequiredNodeLabels(ctx context.Context) error.
|
||
|
|
// Why: exposes required-node-label enforcement internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookEnsureRequiredNodeLabels(ctx context.Context) error {
|
||
|
|
return o.ensureRequiredNodeLabels(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookSSHWithTimeout runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookSSHWithTimeout(ctx context.Context, node string, command string, timeout time.Duration) (string, error).
|
||
|
|
// Why: exposes SSH transport internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookSSHWithTimeout(ctx context.Context, node string, command string, timeout time.Duration) (string, error) {
|
||
|
|
return o.sshWithTimeout(ctx, node, command, timeout)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookRunSensitive runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookRunSensitive(ctx context.Context, timeout time.Duration, name string, args ...string) (string, error).
|
||
|
|
// Why: exposes sensitive-run command path to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookRunSensitive(ctx context.Context, timeout time.Duration, name string, args ...string) (string, error) {
|
||
|
|
return o.runSensitive(ctx, timeout, name, args...)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookWaitForStartupConvergence runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookWaitForStartupConvergence(ctx context.Context) error.
|
||
|
|
// Why: exposes convergence gate internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookWaitForStartupConvergence(ctx context.Context) error {
|
||
|
|
return o.waitForStartupConvergence(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookWaitForServiceChecklist runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookWaitForServiceChecklist(ctx context.Context) error.
|
||
|
|
// Why: exposes service checklist gate internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookWaitForServiceChecklist(ctx context.Context) error {
|
||
|
|
return o.waitForServiceChecklist(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookServiceChecklistReady runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookServiceChecklistReady(ctx context.Context) (bool, string).
|
||
|
|
// Why: exposes service checklist poll internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookServiceChecklistReady(ctx context.Context) (bool, string) {
|
||
|
|
return o.serviceChecklistReady(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookServiceCheckReady runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookServiceCheckReady(ctx context.Context, check config.ServiceChecklistCheck) (bool, string).
|
||
|
|
// Why: exposes service check evaluator internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookServiceCheckReady(ctx context.Context, check config.ServiceChecklistCheck) (bool, string) {
|
||
|
|
return o.serviceCheckReady(ctx, check)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookHTTPChecklistProbe runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookHTTPChecklistProbe(ctx context.Context, check config.ServiceChecklistCheck) (int, string, error).
|
||
|
|
// Why: exposes checklist HTTP probe internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookHTTPChecklistProbe(ctx context.Context, check config.ServiceChecklistCheck) (int, string, error) {
|
||
|
|
return o.httpChecklistProbe(ctx, check)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookWaitForStabilityWindow runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookWaitForStabilityWindow(ctx context.Context) error.
|
||
|
|
// Why: exposes startup stability-window internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookWaitForStabilityWindow(ctx context.Context) error {
|
||
|
|
return o.waitForStabilityWindow(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookStartupStabilityHealthy runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookStartupStabilityHealthy(ctx context.Context) error.
|
||
|
|
// Why: exposes startup stability-health poll internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookStartupStabilityHealthy(ctx context.Context) error {
|
||
|
|
return o.startupStabilityHealthy(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookWaitForIngressChecklist runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookWaitForIngressChecklist(ctx context.Context) error.
|
||
|
|
// Why: exposes ingress checklist gate internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookWaitForIngressChecklist(ctx context.Context) error {
|
||
|
|
return o.waitForIngressChecklist(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookIngressChecklistReady runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookIngressChecklistReady(ctx context.Context) (bool, string).
|
||
|
|
// Why: exposes ingress checklist poll internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookIngressChecklistReady(ctx context.Context) (bool, string) {
|
||
|
|
return o.ingressChecklistReady(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookDiscoverIngressHosts runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookDiscoverIngressHosts(ctx context.Context) ([]string, error).
|
||
|
|
// Why: exposes ingress host discovery internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookDiscoverIngressHosts(ctx context.Context) ([]string, error) {
|
||
|
|
return o.discoverIngressHosts(ctx)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookDiscoverIngressNamespacesForHost runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookDiscoverIngressNamespacesForHost(ctx context.Context, host string) ([]string, error).
|
||
|
|
// Why: exposes ingress host namespace discovery internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookDiscoverIngressNamespacesForHost(ctx context.Context, host string) ([]string, error) {
|
||
|
|
return o.discoverIngressNamespacesForHost(ctx, host)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookHealIngressHostBackendReplicas runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookHealIngressHostBackendReplicas(ctx context.Context, host string) ([]string, error).
|
||
|
|
// Why: exposes ingress host backend replica-heal internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookHealIngressHostBackendReplicas(ctx context.Context, host string) ([]string, error) {
|
||
|
|
return o.healIngressHostBackendReplicas(ctx, host)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookMaybeAutoHealIngressHostBackends runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookMaybeAutoHealIngressHostBackends(ctx context.Context, lastAttempt *time.Time, failureDetail string).
|
||
|
|
// Why: exposes ingress backend auto-heal internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookMaybeAutoHealIngressHostBackends(ctx context.Context, lastAttempt *time.Time, failureDetail string) {
|
||
|
|
o.maybeAutoHealIngressHostBackends(ctx, lastAttempt, failureDetail)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookChecklistFailureHost runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookChecklistFailureHost(failureDetail string) string.
|
||
|
|
// Why: exposes checklist failure host parser internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookChecklistFailureHost(failureDetail string) string {
|
||
|
|
return o.checklistFailureHost(failureDetail)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookHostFromURL runs one orchestration or CLI step.
|
||
|
|
// Signature: TestHookHostFromURL(raw string) string.
|
||
|
|
// Why: exposes URL host parser helper to top-level tests.
|
||
|
|
func TestHookHostFromURL(raw string) string {
|
||
|
|
return hostFromURL(raw)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookProbeStatusAccepted runs one orchestration or CLI step.
|
||
|
|
// Signature: TestHookProbeStatusAccepted(code int) bool.
|
||
|
|
// Why: exposes post-start probe status-code acceptance helper to top-level tests.
|
||
|
|
func TestHookProbeStatusAccepted(code int) bool {
|
||
|
|
return probeStatusAccepted("", code)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookChecklistContains runs one orchestration or CLI step.
|
||
|
|
// Signature: TestHookChecklistContains(body string, marker string) bool.
|
||
|
|
// Why: exposes checklist body matcher helper to top-level tests.
|
||
|
|
func TestHookChecklistContains(body string, marker string) bool {
|
||
|
|
return checklistContains(body, marker)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookIsLikelyHostname runs one orchestration or CLI step.
|
||
|
|
// Signature: TestHookIsLikelyHostname(value string) bool.
|
||
|
|
// Why: exposes hostname heuristic helper to top-level tests.
|
||
|
|
func TestHookIsLikelyHostname(value string) bool {
|
||
|
|
return isLikelyHostname(value)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookSSHManaged runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookSSHManaged(node string) bool.
|
||
|
|
// Why: exposes managed-node selector internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookSSHManaged(node string) bool {
|
||
|
|
return o.sshManaged(node)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookResolveSSHConfigFile runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookResolveSSHConfigFile() string.
|
||
|
|
// Why: exposes SSH config path resolution internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookResolveSSHConfigFile() string {
|
||
|
|
return o.resolveSSHConfigFile()
|
||
|
|
}
|
||
|
|
|
||
|
|
// TestHookResolveSSHIdentityFile runs one orchestration or CLI step.
|
||
|
|
// Signature: (o *Orchestrator) TestHookResolveSSHIdentityFile() string.
|
||
|
|
// Why: exposes SSH identity path resolution internals to top-level tests.
|
||
|
|
func (o *Orchestrator) TestHookResolveSSHIdentityFile() string {
|
||
|
|
return o.resolveSSHIdentityFile()
|
||
|
|
}
|