config

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SkipTest            bool          `envconfig:"SKIP_TEST" default:"false"`
	SkipLogsCollection  bool          `envconfig:"SKIP_LOGS_COLLECTION" default:"false"`
	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"`                                                              // Location where you want to create the cluster
	Regions             []string      `envconfig:"REGIONS"`                                                               // A whitelist of availableregions
	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:"false"`                                       // if true the tests will clean up rgs when tests finish
	CleanUpIfFail       bool          `envconfig:"CLEANUP_IF_FAIL" default:"true"`
	RetainSSH           bool          `envconfig:"RETAIN_SSH" default:"true"`
	StabilityIterations int           `envconfig:"STABILITY_ITERATIONS"`
	Timeout             time.Duration `envconfig:"TIMEOUT" default:"10m"`
	CurrentWorkingDir   string
	SoakClusterName     string `envconfig:"SOAK_CLUSTER_NAME"`
	ForceDeploy         bool   `envconfig:"FORCE_DEPLOY"`
	UseDeployCommand    bool   `envconfig:"USE_DEPLOY_COMMAND"`
	GinkgoFocus         string `envconfig:"GINKGO_FOCUS"`
	GinkgoSkip          string `envconfig:"GINKGO_SKIP"`
}

Config holds global test configuration

func ParseConfig

func ParseConfig() (*Config, error)

ParseConfig will parse needed environment variables for running the tests

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) IsAzureStackCloud added in v0.37.0

func (c *Config) IsAzureStackCloud() bool

IsAzureStackCloud returns true if the cloud is AzureStack

func (*Config) IsKubernetes

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

func (c *Config) SetEnvVars() error

SetEnvVars will determine if we need to

func (*Config) SetKubeConfig

func (c *Config) SetKubeConfig()

SetKubeConfig will set the KUBECONIFG env var

func (*Config) SetRandomRegion

func (c *Config) SetRandomRegion()

SetRandomRegion sets Location to a random region

func (*Config) SetSSHKeyPermissions

func (c *Config) SetSSHKeyPermissions() error

SetSSHKeyPermissions will change the ssh file permission to 0600

func (*Config) UpdateCustomCloudClusterDefinition added in v0.37.0

func (c *Config) UpdateCustomCloudClusterDefinition(ccc *CustomCloudConfig) error

UpdateCustomCloudClusterDefinition updates the cluster definition from environment variables

type CustomCloudConfig added in v0.37.0

type CustomCloudConfig struct {
	ServiceManagementEndpoint    string `envconfig:"SERVICE_MANAGEMENT_ENDPOINT"`
	ResourceManagerEndpoint      string `envconfig:"RESOURCE_MANAGER_ENDPOINT"`
	ActiveDirectoryEndpoint      string `envconfig:"ACTIVE_DIRECTORY_ENDPOINT"`
	GalleryEndpoint              string `envconfig:"GALLERY_ENDPOINT"`
	StorageEndpointSuffix        string `envconfig:"STORAGE_ENDPOINT_SUFFIX"`
	KeyVaultDNSSuffix            string `envconfig:"KEY_VAULT_DNS_SUFFIX"`
	GraphEndpoint                string `envconfig:"GRAPH_ENDPOINT"`
	ServiceManagementVMDNSSuffix string `envconfig:"SERVICE_MANAGEMENT_VM_DNS_SUFFIX"`
	ResourceManagerVMDNSSuffix   string `envconfig:"RESOURCE_MANAGER_VM_DNS_SUFFIX"`
	IdentitySystem               string `envconfig:"IDENTITY_SYSTEM"`
	AuthenticationMethod         string `envconfig:"AUTHENTICATION_METHOD"`
	VaultID                      string `envconfig:"VAULT_ID"`
	SecretName                   string `envconfig:"SECRET_NAME"`
	CustomCloudClientID          string `envconfig:"CUSTOM_CLOUD_CLIENT_ID"`
	CustomCloudSecret            string `envconfig:"CUSTOM_CLOUD_SECRET"`
	APIProfile                   string `envconfig:"API_PROFILE"`
	PortalURL                    string `envconfig:"PORTAL_ENDPOINT"`
	TimeoutCommands              bool
}

CustomCloudConfig holds configurations for custom clould

func ParseCustomCloudConfig added in v0.37.0

func ParseCustomCloudConfig() (*CustomCloudConfig, error)

ParseCustomCloudConfig will parse needed environment variables for running the tests

func (*CustomCloudConfig) SetEnvironment added in v0.37.0

func (ccc *CustomCloudConfig) SetEnvironment() error

SetEnvironment will set the cloud context

Jump to

Keyboard shortcuts

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