ananke/internal/cluster/testing_hooks_ops.go

144 lines
7.3 KiB
Go
Raw Normal View History

package cluster
import "context"
// TestHookDrainWorkers runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookDrainWorkers(ctx context.Context, workers []string) error.
// Why: exposes worker drain internals to top-level tests.
func (o *Orchestrator) TestHookDrainWorkers(ctx context.Context, workers []string) error {
return o.drainWorkers(ctx, workers)
}
// TestHookUncordonWorkers runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookUncordonWorkers(ctx context.Context, workers []string) error.
// Why: exposes worker uncordon internals to top-level tests.
func (o *Orchestrator) TestHookUncordonWorkers(ctx context.Context, workers []string) error {
return o.uncordonWorkers(ctx, workers)
}
// TestHookDrainNodeDiagnostics runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookDrainNodeDiagnostics(ctx context.Context, node string) string.
// Why: exposes drain diagnostic internals to top-level tests.
func (o *Orchestrator) TestHookDrainNodeDiagnostics(ctx context.Context, node string) string {
return o.drainNodeDiagnostics(ctx, node)
}
// TestHookTakeEtcdSnapshot runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookTakeEtcdSnapshot(ctx context.Context, controlPlane string) error.
// Why: exposes etcd snapshot capture internals to top-level tests.
func (o *Orchestrator) TestHookTakeEtcdSnapshot(ctx context.Context, controlPlane string) error {
return o.takeEtcdSnapshot(ctx, controlPlane)
}
// TestHookLatestEtcdSnapshotPath runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookLatestEtcdSnapshotPath(ctx context.Context, controlPlane string) (string, error).
// Why: exposes snapshot path parser internals to top-level tests.
func (o *Orchestrator) TestHookLatestEtcdSnapshotPath(ctx context.Context, controlPlane string) (string, error) {
return o.latestEtcdSnapshotPath(ctx, controlPlane)
}
// TestHookEffectiveWorkers runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookEffectiveWorkers(ctx context.Context) ([]string, error).
// Why: exposes worker-selection internals to top-level tests.
func (o *Orchestrator) TestHookEffectiveWorkers(ctx context.Context) ([]string, error) {
return o.effectiveWorkers(ctx)
}
// TestHookDiscoverWorkers runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookDiscoverWorkers(ctx context.Context) ([]string, error).
// Why: exposes worker discovery internals to top-level tests.
func (o *Orchestrator) TestHookDiscoverWorkers(ctx context.Context) ([]string, error) {
return o.discoverWorkers(ctx)
}
// TestHookPatchFluxSuspendAll runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookPatchFluxSuspendAll(ctx context.Context, suspend bool) error.
// Why: exposes flux suspend patch internals to top-level tests.
func (o *Orchestrator) TestHookPatchFluxSuspendAll(ctx context.Context, suspend bool) error {
return o.patchFluxSuspendAll(ctx, suspend)
}
// TestHookScaleDownApps runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookScaleDownApps(ctx context.Context) error.
// Why: exposes app scale-down internals to top-level tests.
func (o *Orchestrator) TestHookScaleDownApps(ctx context.Context) error {
return o.scaleDownApps(ctx)
}
// TestHookRestoreScaledApps runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookRestoreScaledApps(ctx context.Context) error.
// Why: exposes app scale-restore internals to top-level tests.
func (o *Orchestrator) TestHookRestoreScaledApps(ctx context.Context) error {
return o.restoreScaledApps(ctx)
}
// TestHookListScalableWorkloads runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookListScalableWorkloads(ctx context.Context) ([]workloadScaleEntry, error).
// Why: exposes scalable workload discovery internals to top-level tests.
func (o *Orchestrator) TestHookListScalableWorkloads(ctx context.Context) ([]workloadScaleEntry, error) {
return o.listScalableWorkloads(ctx)
}
// TestHookScaleWorkloads runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookScaleWorkloads(ctx context.Context, entries []workloadScaleEntry, forceReplicas int, parallelism int) error.
// Why: exposes workload scaling internals to top-level tests.
func (o *Orchestrator) TestHookScaleWorkloads(ctx context.Context, entries []workloadScaleEntry, forceReplicas int, parallelism int) error {
return o.scaleWorkloads(ctx, entries, forceReplicas, parallelism)
}
// TestHookWriteScaledWorkloadSnapshot runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookWriteScaledWorkloadSnapshot(entries []workloadScaleEntry) error.
// Why: exposes scaled workload snapshot writer to top-level tests.
func (o *Orchestrator) TestHookWriteScaledWorkloadSnapshot(entries []workloadScaleEntry) error {
return o.writeScaledWorkloadSnapshot(entries)
}
// TestHookReadScaledWorkloadSnapshot runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookReadScaledWorkloadSnapshot() (*workloadScaleSnapshot, error).
// Why: exposes scaled workload snapshot reader to top-level tests.
func (o *Orchestrator) TestHookReadScaledWorkloadSnapshot() (*workloadScaleSnapshot, error) {
return o.readScaledWorkloadSnapshot()
}
// TestHookRunSSHAcrossNodes runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookRunSSHAcrossNodes(ctx context.Context, nodes []string, action string, command string).
// Why: exposes fan-out SSH executor internals to top-level tests.
func (o *Orchestrator) TestHookRunSSHAcrossNodes(ctx context.Context, nodes []string, action string, command string) {
o.runSSHAcrossNodes(ctx, nodes, action, command)
}
// TestHookStopWorkers runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookStopWorkers(ctx context.Context, workers []string).
// Why: exposes worker stop fan-out internals to top-level tests.
func (o *Orchestrator) TestHookStopWorkers(ctx context.Context, workers []string) {
o.stopWorkers(ctx, workers)
}
// TestHookStartWorkers runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookStartWorkers(ctx context.Context, workers []string).
// Why: exposes worker start fan-out internals to top-level tests.
func (o *Orchestrator) TestHookStartWorkers(ctx context.Context, workers []string) {
o.startWorkers(ctx, workers)
}
// TestHookStopControlPlanes runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookStopControlPlanes(ctx context.Context, cps []string).
// Why: exposes control-plane stop fan-out internals to top-level tests.
func (o *Orchestrator) TestHookStopControlPlanes(ctx context.Context, cps []string) {
o.stopControlPlanes(ctx, cps)
}
// TestHookStartControlPlanes runs one orchestration or CLI step.
// Signature: (o *Orchestrator) TestHookStartControlPlanes(ctx context.Context, cps []string).
// Why: exposes control-plane start fan-out internals to top-level tests.
func (o *Orchestrator) TestHookStartControlPlanes(ctx context.Context, cps []string) {
o.startControlPlanes(ctx, cps)
}
// TestHookParseSnapshotPathFromEtcdSnapshotList runs one orchestration or CLI step.
// Signature: TestHookParseSnapshotPathFromEtcdSnapshotList(out string) string.
// Why: exposes etcd snapshot list parser helper to top-level tests.
func TestHookParseSnapshotPathFromEtcdSnapshotList(out string) string {
return parseSnapshotPathFromEtcdSnapshotList(out)
}