Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: MIT Imports: 10 Imported by: 136

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Orchestrator      string `envconfig:"ORCHESTRATOR" default:"kubernetes"`
	Name              string `envconfig:"NAME"`                                                                  // Name allows you to set the name of a cluster already created
	Location          string `envconfig:"LOCATION" required:"true" default:"southcentralus"`                     // Location where you want to create the cluster
	ClusterDefinition string `envconfig:"CLUSTER_DEFINITION" required:"true" default:"examples/kubernetes.json"` // ClusterDefinition is the path on disk to the json template these are normally located in examples/
	CleanUpOnExit     bool   `envconfig:"CLEANUP_ON_EXIT" default:"true"`                                        // if set the tests will not clean up rgs when tests finish
	ProvisionRetries  int    `envcofnig:"PROVISION_RETRIES" default:"3"`
	CreateVNET        bool   `envconfig:"CREATE_VNET" default:"false"`
	CurrentWorkingDir string
}

Config holds global test configuration

func ParseConfig

func ParseConfig() (*Config, error)

ParseConfig will parse needed environment variables for running the tests

func (*Config) GenerateName

func (c *Config) GenerateName() string

GenerateName will generate a new name if one has not been set

func (*Config) GetKubeConfig

func (c *Config) GetKubeConfig() string

GetKubeConfig returns the absolute path to the kubeconfig for c.Location

func (*Config) GetSSHKeyPath

func (c *Config) GetSSHKeyPath() string

GetSSHKeyPath will return the absolute path to the ssh private key

func (*Config) IsDCOS added in v0.7.0

func (c *Config) IsDCOS() bool

IsDCOS will return true if the ORCHESTRATOR env var is set to dcos

func (*Config) IsKubernetes added in v0.7.0

func (c *Config) IsKubernetes() bool

IsKubernetes will return true if the ORCHESTRATOR env var is set to kubernetes or not set at all

func (*Config) IsSwarm added in v0.7.0

func (c *Config) IsSwarm() bool

IsSwarm will return true if the ORCHESTRATOR env var is set to dcos

func (*Config) IsSwarmMode added in v0.7.0

func (c *Config) IsSwarmMode() bool

IsSwarmMode will return true if the ORCHESTRATOR env var is set to dcos

func (*Config) ReadPublicSSHKey

func (c *Config) ReadPublicSSHKey() (string, error)

ReadPublicSSHKey will read the contents of the public ssh key on disk into a string

func (*Config) SetEnvVars added in v0.7.0

func (c *Config) SetEnvVars() error

SetEnvVars will determine if we need to

Jump to

Keyboard shortcuts

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