configuration

package
v0.0.0-...-2de7ce9 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 10 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

func GetMemberClusterName

func GetMemberClusterName(term ioutils.Terminal, ctlClusterName string) (string, error)

GetMemberClusterName returns the full name of the member cluster (used in ToolchainCluster CRs) for the provided shot cluster name such as member-1 (used in ksctl.yaml)

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) 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

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