cloud

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: Apache-2.0 Imports: 16 Imported by: 6

Documentation

Index

Constants

View Source
const DefaultDeployTarget = "production"

DefaultDeployTarget is the default deployment target that is written to the config.yaml during the init process

View Source
const DevSpaceCloudConfigPath = ".devspace/clouds.yaml"

DevSpaceCloudConfigPath holds the path to the cloud config file

View Source
const DevSpaceCloudProviderName = "devspace-cloud"

DevSpaceCloudProviderName is the name of the default devspace-cloud provider

View Source
const DevSpaceKubeContextName = "devspace"

DevSpaceKubeContextName is the name for the kube config context

View Source
const GetClusterConfigEndpoint = "/clusterConfig"

GetClusterConfigEndpoint is the endpoint where to get the kubernetes context data

View Source
const LoginEndpoint = "/login"

LoginEndpoint is the cloud endpoint that will log you in

View Source
const LoginSuccessEndpoint = "/loginSuccess"

LoginSuccessEndpoint is the url redirected to after successful login

Variables

View Source
var DevSpaceCloudProviderConfig = &Provider{
	Name: DevSpaceCloudProviderName,
	Host: "http://cli.devspace-cloud.com",
}

DevSpaceCloudProviderConfig holds the information for the devspace-cloud

View Source
var DevSpaceURL = ""

DevSpaceURL holds the domain name of the connected devspace TODO: Change this

View Source
var UseDeployTarget = false

UseDeployTarget uses the config deploy target TODO: Refactor this

Functions

func CheckAuth

func CheckAuth(provider *Provider, devSpaceID, target string, log log.Logger) (string, string, *api.Cluster, *api.AuthInfo, error)

CheckAuth verifies if the user is logged into the devspace cloud and if not logs the user in

func GetClusterConfig

func GetClusterConfig(provider *Provider, devSpaceID, target string, log log.Logger) (string, string, *api.Cluster, *api.AuthInfo, error)

GetClusterConfig retrieves the cluster and authconfig from the devspace cloud

func Login

func Login(provider *Provider, namespace, target string, log log.Logger) (string, string, *api.Cluster, *api.AuthInfo, error)

Login logs the user into the devspace cloud

func SaveCloudConfig

func SaveCloudConfig(config ProviderConfig) error

SaveCloudConfig saves the provider configuration to file

func Update

func Update(providerConfig ProviderConfig, options *UpdateOptions, log log.Logger) error

Update updates the cloud provider information if necessary

func UpdateKubeConfig

func UpdateKubeConfig(contextName, namespace string, cluster *api.Cluster, authInfo *api.AuthInfo, switchContext bool) error

UpdateKubeConfig adds the devspace-cloud context if necessary and switches the current context

Types

type Provider

type Provider struct {
	Name  string `yaml:"name,omitempty"`
	Host  string `yaml:"host,omitempty"`
	Token string `yaml:"token,omitempty"`
}

Provider describes the struct to hold the cloud configuration

type ProviderConfig

type ProviderConfig map[string]*Provider

ProviderConfig holds all the different providers and their configuration

func ParseCloudConfig

func ParseCloudConfig() (ProviderConfig, error)

ParseCloudConfig parses the cloud configuration and returns a map containing the configurations

type UpdateOptions

type UpdateOptions struct {
	UseKubeContext    bool
	SwitchKubeContext bool
}

UpdateOptions specifies the possible options for the update command

Jump to

Keyboard shortcuts

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