config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 2 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// Kubernetes distributions
	DistroK8s = "k8s"
	DistroOcp = "ocp"

	// ClusterSet
	DefaultClusterSetName = "default"
)

Variables

View Source
var K8sNamespaces = Namespaces{
	RamenHubNamespace:       "ramen-system",
	RamenDRClusterNamespace: "ramen-system",
	RamenOpsNamespace:       "ramen-ops",
	ArgocdNamespace:         "argocd",
}

Default namespace mappings for Kubernetes (k8s) clusters.

View Source
var OcpNamespaces = Namespaces{
	RamenHubNamespace:       "openshift-operators",
	RamenDRClusterNamespace: "openshift-dr-system",
	RamenOpsNamespace:       "openshift-dr-ops",
	ArgocdNamespace:         "openshift-gitops",
}

Default namespace mappings for OpenShift (ocp) clusters.

Functions

func DeployersMap

func DeployersMap(config *Config) map[string]Deployer

DeployersMap returns a mapping from Deployer.Name to Deployer.

func PVCSpecsMap

func PVCSpecsMap(config *Config) map[string]PVCSpec

PVCSpecMap returns a mapping from PVCSpec.Name to PVCSpec.

Types

type Channel

type Channel struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

Channel defines the name and namespace for the channel CR. This is not user-configurable and always uses default values.

type Cluster

type Cluster struct {
	Kubeconfig string `json:"kubeconfig"`
}

type Config

type Config struct {
	// User configurable values.
	Clusters        map[string]Cluster `json:"clusters"`
	ClusterSet      string             `json:"clusterSet"`
	Distro          string             `json:"distro"`
	Repo            Repo               `json:"repo"`
	DRPolicy        string             `json:"drPolicy"`
	NamespacePrefix string             `json:"namespacePrefix"`
	PVCSpecs        []PVCSpec          `json:"pvcSpecs"`
	Deployers       []Deployer         `json:"deployers"`
	Tests           []Test             `json:"tests"`

	// Generated values
	Channel    Channel    `json:"channel"`
	Namespaces Namespaces `json:"namespaces"`
}

Config keeps configuration for e2e tests.

func ReadConfig

func ReadConfig(configFile string, options Options) (*Config, error)

func (*Config) Equal

func (c *Config) Equal(o *Config) bool

Equal return true if config is equal to other config.

type Deployer

type Deployer struct {
	// Name of the deployer instance. Refer to this name in tests.
	Name string `json:"name"`
	// Type specifies the type of deployer.
	// Available types: appset, subscr, and disapp.
	Type string `json:"type"`
	// Description is a human-readable description of the deployer.
	Description string  `json:"description"`
	Recipe      *Recipe `json:"recipe,omitempty"`
}

Deployer is a deployer configuration.

func (*Deployer) Equal

func (a *Deployer) Equal(b *Deployer) bool

Equal returns true if deployer is equal to another deployer.

type Namespaces

type Namespaces struct {
	RamenHubNamespace       string `json:"ramenHubNamespace"`
	RamenDRClusterNamespace string `json:"ramenDRClusterNamespace"`
	RamenOpsNamespace       string `json:"ramenOpsNamespace"`
	ArgocdNamespace         string `json:"argocdNamespace"`
}

Namespaces are determined by distro and are not user-configurable.

type Options

type Options struct {
	Workloads []string
	Deployers []string
}

Options that can be used in a configuration file.

type PVCSpec

type PVCSpec struct {
	Name             string `json:"name"`
	StorageClassName string `json:"storageClassName"`
	AccessModes      string `json:"accessModes"`
}

type Recipe

type Recipe struct {
	// Type is the name of the recipe to use.
	// If Type is "generate", a recipe is generated to match the workload.
	// If Type is "vm", ramen internal recipe for the vm will be used.
	Type      string `json:"type"`
	CheckHook bool   `json:"checkHook,omitempty"`
	ExecHook  bool   `json:"execHook,omitempty"`
}

type Repo

type Repo struct {
	URL    string `json:"url"`
	Branch string `json:"branch"`
}

Repo represents the user-configurable git repository settings. It includes the repository url and branch to be used for deploying workload.

type Test

type Test struct {
	// Name is an optional unique name for the test. If empty, ContextName()
	// generates a name from the deployer, workload, and pvcSpec fields.
	// Use an explicit name to create multiple tests with the same
	// deployer, workload, and pvcSpec.
	Name     string `json:"name,omitempty"`
	Workload string `json:"workload"`
	Deployer string `json:"deployer"`
	PVCSpec  string `json:"pvcSpec"`
}

func (Test) ContextName

func (t Test) ContextName() string

ContextName returns the test context name. If Name is set, it is returned as-is. Otherwise, a name is generated from the deployer, workload, and pvcSpec.

Jump to

Keyboard shortcuts

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