cloud

package
v2.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2018 License: Apache-2.0 Imports: 16 Imported by: ? 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

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

Functions

func CheckAuth

func CheckAuth(provider *Provider) (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) (string, *api.Cluster, *api.AuthInfo, error)

GetClusterConfig retrieves the cluster and authconfig from the devspace cloud

func Login

func Login(provider *Provider) (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, cloudProvider string, dsConfig *v1.Config, useKubeContext, switchKubeContext bool) 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

Jump to

Keyboard shortcuts

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