Documentation
¶
Index ¶
Constants ¶
const ( // DevSpaceCloudNamespace is the namespace to create DevSpaceCloudNamespace = "devspace-cloud" // DevSpaceServiceAccount is the service account to create DevSpaceServiceAccount = "devspace-cloud-user" // DevSpaceClusterRoleBinding is the name of the clusterrolebinding to create for the service account DevSpaceClusterRoleBinding = "devspace-cloud-user-binding" )
const DevSpaceKubeContextName = "devspace"
DevSpaceKubeContextName is the name for the kube config context
const LoginEndpoint = "/login?cli=true"
LoginEndpoint is the cloud endpoint that will log you in
const LoginSuccessEndpoint = "/login-success"
LoginSuccessEndpoint is the url redirected to after successful login
const SettingDefaultClusterEncryptToken = "DEFAULT_CLUSTER_ENCRYPT_TOKEN"
SettingDefaultClusterEncryptToken is the setting name to check if we need an encryption key
const TokenEndpoint = "/auth/token"
TokenEndpoint is the endpoint where to get a token from
Variables ¶
var ClusterNameValidationRegEx = regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9-]{1,30}[a-zA-Z0-9]$")
ClusterNameValidationRegEx is the cluster name validation regex
var SpaceNameValidationRegEx = regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9-]{1,30}[a-zA-Z0-9]$")
SpaceNameValidationRegEx is the sapace name validation regex
Functions ¶
func GetKubeContextNameFromSpace ¶
GetKubeContextNameFromSpace returns the kube context name for a space
Types ¶
type ConnectClusterOptions ¶
type ConnectClusterOptions struct {
DeployAdmissionController bool
DeployGatekeeper bool
DeployGatekeeperRules bool
DeployIngressController bool
DeployCertManager bool
UseHostNetwork *bool
ClusterName string
KubeContext string
Key string
OpenUI bool
Public bool
UseDomain bool
Domain string
}
ConnectClusterOptions holds the options for connecting a cluster
type Provider ¶
type Provider interface {
GetAndUpdateSpaceCache(spaceID int, forceUpdate bool) (*latest.SpaceCache, bool, error)
CacheSpace(space *latest.Space, serviceAccount *latest.ServiceAccount) error
ConnectCluster(options *ConnectClusterOptions) error
ResetKey(clusterName string) error
UpdateKubeConfig(contextName string, serviceAccount *latest.ServiceAccount, spaceID int, setActive bool) error
DeleteKubeContext(space *latest.Space) error
GetClusterKey(cluster *latest.Cluster) (string, error)
PrintToken(spaceID int) error
PrintSpaces(cluster, name string, all bool) error
Save() error
Client() client.Client
GetConfig() latest.Provider
}
Provider interacts with one cloud provider
func GetProvider ¶
GetProvider returns the current specified cloud provider