configuration

package
v0.0.0-...-4e12832 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const HostName = "host"

Variables

View Source
var (
	ConfigFileFlag string
	Verbose        bool
)
View Source
var ClusterTypes = []ClusterType{Host, Member}

Functions

This section is empty.

Types

type ClusterAccessDefinition

type ClusterAccessDefinition struct {
	ClusterDefinition `yaml:",inline"`
	Token             string `yaml:"token"`
}

func LoadClusterAccessDefinition

func LoadClusterAccessDefinition(term ioutils.Terminal, clusterName string) (ClusterAccessDefinition, error)

LoadClusterAccessDefinition loads ClusterAccessDefinition object from the config file and checks that all required parameters are set

type ClusterAccessDefinitions

type ClusterAccessDefinitions map[string]ClusterAccessDefinition

type ClusterConfig

type ClusterConfig struct {
	ClusterAccessDefinition
	AllClusterNames   []string
	ClusterName       string
	Token             string
	OperatorNamespace string // namespace where either the host-operator or the member-operator is deployed (depends on the cluster context)
}

ClusterConfig contains all parameters of a cluster loaded from KsctlConfig plus all cluster names defined in the KsctlConfig

func LoadClusterConfig

func LoadClusterConfig(term ioutils.Terminal, clusterName string) (ClusterConfig, error)

LoadClusterConfig loads ClusterConfig object from the config file and checks that all required parameters are set as well as the token for the given name

func (ClusterConfig) ConfigurePath

func (c ClusterConfig) ConfigurePath(term ioutils.Terminal, clusterConfigName, component string) (string, error)

ConfigurePath returns the path to the 'configure' directory, using the clusterConfigName arg if it's not empty, or the Host cluster's server name (even if the current config applies to a Member cluster)

func (ClusterConfig) GetNamespaceParam

func (c ClusterConfig) GetNamespaceParam() string

GetNamespaceParam returns the `--namespace=` param along with its actual value

func (ClusterConfig) GetServerParam

func (c ClusterConfig) GetServerParam() string

GetServerParam returns the `--server=` param along with its actual value

func (ClusterConfig) InstallPath

func (c ClusterConfig) InstallPath(term ioutils.Terminal, clusterConfigName, component string) (string, error)

InstallPath returns the path to the 'install' directory, using the clusterConfigName arg if it's not empty, or the Host cluster's server name (even if the current config applies to a Member cluster)

func (ClusterConfig) Path

func (c ClusterConfig) Path(term ioutils.Terminal, clusterConfigName, section, component string) (string, error)

Path returns the path to the directory for the given action, using the clusterConfigName arg if it's not empty, or the Host cluster's server name (even if the current config applies to a Member cluster)

type ClusterDefinition

type ClusterDefinition struct {
	ClusterType ClusterType `yaml:"clusterType"`
	ServerAPI   string      `yaml:"serverAPI"`
	ServerName  string      `yaml:"serverName"`
}

type ClusterNamespaces

type ClusterNamespaces map[string]string

type ClusterType

type ClusterType string
var Host ClusterType = "host"
var Member ClusterType = "member"

func (ClusterType) AsSuffix

func (cluster ClusterType) AsSuffix(prefix string) string

func (ClusterType) String

func (cluster ClusterType) String() string

func (ClusterType) TheOtherType

func (cluster ClusterType) TheOtherType() ClusterType

type KsctlConfig

type KsctlConfig struct {
	ClusterAccessDefinitions `yaml:",inline"`
	Name                     string `yaml:"name"`
}

func Load

func Load(term ioutils.Terminal) (KsctlConfig, error)

Load reads in config file and ENV variables if set.

Jump to

Keyboard shortcuts

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