config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSampleConfig

func CreateSampleConfig(filename, commandName, envFile string) error

CreateSampleConfig create a sample config that can be used by all commands. The file can be parsed using ReadConfig() or test.readConfig().

Types

type Config added in v0.8.0

type Config struct {
	// Clusters are part of this environment. Requires "hub", "c1", and "c2".
	Clusters map[string]config.Cluster `json:"clusters"`

	// ClusterSet name with the managed clusters.
	ClusterSet string `json:"clusterSet"`

	// Distro is either config.DistroK8s or config.DistroOcp. If unset the distro is detected
	// automatically when validating the config with the clusters.
	Distro string `json:"distro"`

	// Namespaces are set automatically based on Distro.
	Namespaces config.Namespaces `json:"namespaces"`
}

Config is used for all ramenctl commands except the test commands. It is a subset of ramen/e2e/config.Config.

func ReadConfig

func ReadConfig(filename string) (*Config, error)

ReadConfig reads the configuration file created by CreateSampleConfig, ignoring the test only configuration.

func (*Config) Equal added in v0.8.0

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

Equal return true if config is equal to other config.

func (*Config) SetDistro added in v0.8.0

func (c *Config) SetDistro(d string)

type EnvFile added in v0.2.0

type EnvFile struct {
	Name  string `json:"name"`
	Ramen Ramen  `json:"ramen"`
}

func ReadEnvFile added in v0.2.0

func ReadEnvFile(filePath string) (*EnvFile, error)

ReadEnvFile reads and parses an environment file into an EnvFile struct.

func (*EnvFile) KubeconfigPath added in v0.2.0

func (e *EnvFile) KubeconfigPath(name string) string

type Ramen added in v0.2.0

type Ramen struct {
	Hub      string   `json:"hub"`
	Clusters []string `json:"clusters"`
}

type Sample

type Sample struct {
	CommandName            string
	HubKubeconfig          string
	PrimaryKubeconfig      string
	SecondaryKubeconfig    string
	RBDStorageClassName    string
	CephFSStorageClassName string
}

func NewSample added in v0.3.5

func NewSample(commandName string) *Sample

func SampleFromEnv added in v0.3.5

func SampleFromEnv(commandName string, env *EnvFile) *Sample

func (*Sample) Bytes

func (s *Sample) Bytes() ([]byte, error)

Jump to

Keyboard shortcuts

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