platform

package
v0.6.2-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkspaceIDEnv       = "WORKSPACE_ID"
	WorkspaceUIDEnv      = "WORKSPACE_UID"
	WorkspaceContextEnv  = "WORKSPACE_CONTEXT"
	WorkspaceProviderEnv = "WORKSPACE_PROVIDER"
	WorkspaceInstanceEnv = "WORKSPACE_INSTANCE"
	WorkspacePictureEnv  = "WORKSPACE_PICTURE"
	WorkspaceSourceEnv   = "WORKSPACE_SOURCE"

	ConfigEnv  = "LOFT_CONFIG"
	ProjectEnv = "LOFT_PROJECT"
	RunnerEnv  = "LOFT_RUNNER"

	TemplateOptionEnv        = "LOFT_TEMPLATE"
	TemplateVersionOptionEnv = "LOFT_TEMPLATE_VERSION"

	TimeoutEnv        = "LOFT_TIMEOUT"
	ProviderBinaryEnv = "PRO_PROVIDER"
)

Variables

View Source
var CriticalStatus = map[string]bool{
	"Error":                      true,
	"Unknown":                    true,
	"ImagePullBackOff":           true,
	"CrashLoopBackOff":           true,
	"RunContainerError":          true,
	"ErrImagePull":               true,
	"CreateContainerConfigError": true,
	"InvalidImageName":           true,
}

CriticalStatus container status

Functions

func DialInstance

func DialInstance(baseClient client.Client, workspace *managementv1.DevPodWorkspaceInstance, subResource string, values url.Values, log log.Logger) (*websocket.Conn, error)

func DisplayName

func DisplayName(name string, displayName string) string

func FindInstance

func FindInstance(ctx context.Context, baseClient client.Client, uid string) (*managementv1.DevPodWorkspaceInstance, error)

func FindInstanceByName

func FindInstanceByName(ctx context.Context, baseClient client.Client, name, projectName string) (*managementv1.DevPodWorkspaceInstance, error)

func FindInstanceInProject

func FindInstanceInProject(ctx context.Context, baseClient client.Client, uid, projectName string) (*managementv1.DevPodWorkspaceInstance, error)

func GetDevPodVersion

func GetDevPodVersion(url string) (string, error)

func GetProInstanceDevPodVersion

func GetProInstanceDevPodVersion(proInstance *provider.ProInstance) (string, error)

func InitClientFromHost

func InitClientFromHost(ctx context.Context, devPodConfig *config.Config, devPodProHost string, log log.Logger) (client.Client, error)

func InitClientFromProvider

func InitClientFromProvider(ctx context.Context, devPodConfig *config.Config, providerName string, log log.Logger) (client.Client, error)

func IsOwner

func IsOwner(self *managementv1.Self, owner *storagev1.UserOrTeam) bool

func LoftConfigPath

func LoftConfigPath(devPodConfig *config.Config, providerName string) (string, error)

func OptionsFromEnv

func OptionsFromEnv(name string) url.Values

func ProviderFromHost

func ProviderFromHost(ctx context.Context, devPodConfig *config.Config, devPodProHost string, log log.Logger) (*provider.ProviderConfig, error)

func Timeout

func Timeout() time.Duration

func WaitForPodReady

func WaitForPodReady(ctx context.Context, kubeClient kubernetes.Interface, namespace string, log log.Logger) (*corev1.Pod, error)

Types

type VersionObject

type VersionObject struct {
	// Version is the server version
	Version string `json:"version,omitempty"`

	// Version is the remote devpod version
	DevPodVersion string `json:"devPodVersion,omitempty"`
}

func GetPlatformVersion

func GetPlatformVersion(url string) (*VersionObject, error)

type WorkspaceInfo

type WorkspaceInfo struct {
	ID          string
	UID         string
	ProjectName string
}

func GetWorkspaceInfoFromEnv

func GetWorkspaceInfoFromEnv() (*WorkspaceInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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