scenarios

package
v0.32.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrgSuffix      = "-org"
	ProviderSuffix = "-provider"
	ConsumerSuffix = "-consumer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionContext

type ExecutionContext struct {
	KCPClusterClient kcpclientset.ClusterInterface
	DynamicClient    kcpdynamic.ClusterInterface
	Out              io.Writer
	ErrOut           io.Writer

	// mutable state passed between steps
	// e.g. "org-path" -> "root:quickstart-org".
	State map[string]string
}

type Scenario

type Scenario interface {
	Name() string
	Steps(prefix string) []Step
	Samples(prefix string) []Step
	EnterPath(state map[string]string) string
	PrintSummary(out io.Writer, prefix string, state map[string]string) error

	// Validate checks scenario-specific constraints, including that all
	// workspace names derived from prefix are valid DNS-1123 labels.
	Validate(prefix string) error
}

func Get

func Get(name string) (Scenario, error)

type Step

type Step struct {
	Description string

	// CleanupDescription is shown in progress output during --cleanup runs.
	// Falls back to Description when empty.
	CleanupDescription string

	Execute func(ctx context.Context, execCtx ExecutionContext) error
	Cleanup func(ctx context.Context, execCtx ExecutionContext) error
}

type WorkspacesConfig

type WorkspacesConfig struct {
	// Depth is the maximum depth of the generated tree below the org workspace.
	// depth=1 produces a flat fan-out under the org; depth=2 allows grandchildren, etc.
	Depth int
	// Count is the total number of child workspaces to create below the org.
	Count int
	// Seed seeds the PRNG used to shape the tree. Zero means "pick at runtime".
	Seed int64
}

WorkspacesConfig configures the workspaces (performance) scenario.

type WorkspacesConfigurable

type WorkspacesConfigurable interface {
	SetWorkspacesConfig(cfg WorkspacesConfig)
}

WorkspacesConfigurable lets the plugin pass scenario-specific options without leaking implementation details through the Scenario interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL