config

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// UsernameKeyInSecret is the username key in secret
	UsernameKeyInSecret = "username"
	// PasswordKeyInSecret is the password key in secret
	PasswordKeyInSecret = "password"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// NSX-T username.
	User string
	// NSX-T password in clear text.
	Password string
	// NSX-T host.
	Host string
	// InsecureFlag is to be set to true if NSX-T uses self-signed cert.
	InsecureFlag bool
	// RemoteAuth is to be set to true if NSX-T uses remote authentication (authentication done through the vIDM).
	RemoteAuth bool
	// SecretName is the secret name for NSX-T username and password
	SecretName string
	// SecretNamespace is the secret namespace for NSX-T username and password
	SecretNamespace string

	VMCAccessToken     string
	VMCAuthHost        string
	ClientAuthCertFile string
	ClientAuthKeyFile  string
	CAFile             string
}

Config is used to read and store information from the cloud configuration file

func ReadConfigINI

func ReadConfigINI(configData []byte) (*Config, error)

ReadConfigINI parses vSphere cloud config file and stores it into Config

func ReadConfigYAML

func ReadConfigYAML(configData []byte) (*Config, error)

ReadConfigYAML parses vSphere cloud config file and stores it into Config

func ReadNsxtConfig

func ReadNsxtConfig(configData []byte) (*Config, error)

ReadNsxtConfig parses vSphere cloud config file and stores it into VSphereConfig. Environment variables are also checked

func (*Config) FromEnv

func (cfg *Config) FromEnv() error

FromEnv initializes the provided configuration object with values obtained from environment variables. If an environment variable is set for a property that's already initialized, the environment variable's value takes precedence.

type NsxtConfigINI

type NsxtConfigINI struct {
	NSXT NsxtINI `gcfg:"nsxt"`
}

NsxtConfigINI is used to read and store information from the cloud configuration file

func ReadRawConfigINI

func ReadRawConfigINI(configData []byte) (*NsxtConfigINI, error)

ReadRawConfigINI parses vSphere cloud config file and stores it into ConfigINI

func (*NsxtConfigINI) CompleteAndValidate

func (nci *NsxtConfigINI) CompleteAndValidate() error

CompleteAndValidate sets default values, overrides by env and validates the resulting config

func (*NsxtConfigINI) CreateConfig

func (nci *NsxtConfigINI) CreateConfig() *Config

CreateConfig generates a common Config object based on what other structs and funcs are already dependent upon in other packages.

type NsxtConfigYAML

type NsxtConfigYAML struct {
	NSXT NsxtYAML `yaml:"nsxt"`
}

NsxtConfigYAML is used to read and store information from the cloud configuration file

func ReadRawConfigYAML

func ReadRawConfigYAML(configData []byte) (*NsxtConfigYAML, error)

ReadRawConfigYAML parses vSphere cloud config file and stores it into ConfigYAML

func (*NsxtConfigYAML) CompleteAndValidate

func (ncy *NsxtConfigYAML) CompleteAndValidate() error

CompleteAndValidate sets default values, overrides by env and validates the resulting config

func (*NsxtConfigYAML) CreateConfig

func (ncy *NsxtConfigYAML) CreateConfig() *Config

CreateConfig generates a common Config object based on what other structs and funcs are already dependent upon in other packages.

type NsxtINI

type NsxtINI struct {
	// NSX-T username.
	User string `gcfg:"user"`
	// NSX-T password in clear text.
	Password string `gcfg:"password"`
	// NSX-T host.
	Host string `gcfg:"host"`
	// InsecureFlag is to be set to true if NSX-T uses self-signed cert.
	InsecureFlag bool `gcfg:"insecure-flag"`
	// RemoteAuth is to be set to true if NSX-T uses remote authentication (authentication done through the vIDM).
	RemoteAuth bool `gcfg:"remote-auth"`
	// SecretName is the secret name for NSX-T username and password
	SecretName string `gcfg:"secret-name"`
	// SecretNamespace is the secret namespace for NSX-T username and password
	SecretNamespace string `gcfg:"secret-namespace"`

	VMCAccessToken     string `gcfg:"vmc-access-token"`
	VMCAuthHost        string `gcfg:"vmc-auth-host"`
	ClientAuthCertFile string `gcfg:"client-auth-cert-file"`
	ClientAuthKeyFile  string `gcfg:"client-auth-key-file"`
	CAFile             string `gcfg:"ca-file"`
}

NsxtINI contains the NSX-T specific configuration

type NsxtYAML

type NsxtYAML struct {
	// NSX-T username.
	User string `yaml:"user"`
	// NSX-T password in clear text.
	Password string `yaml:"password"`
	// NSX-T host.
	Host string `yaml:"host"`
	// InsecureFlag is to be set to true if NSX-T uses self-signed cert.
	InsecureFlag bool `yaml:"insecureFlag"`
	// RemoteAuth is to be set to true if NSX-T uses remote authentication (authentication done through the vIDM).
	RemoteAuth bool `yaml:"remoteAuth"`
	// SecretName is the secret name for NSX-T username and password
	SecretName string `yaml:"secretName"`
	// SecretNamespace is the secret namespace for NSX-T username and password
	SecretNamespace string `yaml:"secretNamespace"`

	VMCAccessToken     string `yaml:"vmcAccessToken"`
	VMCAuthHost        string `yaml:"vmcAuthHost"`
	ClientAuthCertFile string `yaml:"clientAuthCertFile"`
	ClientAuthKeyFile  string `yaml:"clientAuthKeyFile"`
	CAFile             string `yaml:"caFile"`
}

NsxtYAML contains the NSX-T specific configuration

Jump to

Keyboard shortcuts

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