Documentation
¶
Index ¶
- Constants
- Variables
- func ClassifyVersionSource(canonical string) sourceKind
- func CombineOptions(workspace *Workspace, machine *Machine, options map[string]config.OptionValue) map[string]config.OptionValue
- func DownloadBinaries(ctx context.Context, binaries map[string][]*ProviderBinary, ...) (map[string]string, error)
- func DownloadUpdateBinaries(ctx context.Context, binaries map[string][]*ProviderBinary, target string) (map[string]string, error)
- func GetBaseEnvironment(context, provider string) map[string]string
- func GetBinaries(context string, config *ProviderConfig) (map[string]string, error)
- func GetBinariesFrom(config *ProviderConfig, binariesDir string) (map[string]string, error)
- func GetDaemonDir(context, providerName string) (string, error)
- func GetLocksDir(context string) (string, error)
- func GetMachineDir(context, machineID string) (string, error)
- func GetMachinesDir(context string) (string, error)
- func GetProInstanceDir(context, proInstanceHost string) (string, error)
- func GetProInstanceOperationLock(contextName, host string) (*flock.Flock, error)
- func GetProInstancesDir(context string) (string, error)
- func GetProviderBinariesDir(context, providerName string) (string, error)
- func GetProviderDir(context, providerName string) (string, error)
- func GetProviderInitLock(contextName, name string) (*flock.Flock, error)
- func GetProviderOperationLock(contextName, providerName string) (*flock.Flock, error)
- func GetProviderOptions(workspace *Workspace, server *Machine, devConfig *config.Config) map[string]config.OptionValue
- func GetProviderSource(src ProviderSource, configName string) string
- func GetProvidersDir(context string) (string, error)
- func GetWorkspaceAgentDir(context, workspaceID string) (string, error)
- func GetWorkspaceContentDir(context, workspaceID string) (string, error)
- func GetWorkspaceContentsDir(context string) (string, error)
- func GetWorkspaceDir(context, workspaceID string) (string, error)
- func GetWorkspaceLogDir(context, workspaceID string) (string, error)
- func GetWorkspacesDir(context string) (string, error)
- func HashProviderSource(source string) string
- func LoadWorkspaceResult(context, workspaceID string) (*config2.Result, error)
- func LockProvider(contextName, providerName string) (func(), error)
- func LockProviderNamed(contextName, providerName string) (func(), error)
- func MachineExists(context, machineID string) bool
- func Merge(m1 map[string]string, m2 map[string]string) map[string]string
- func MoveProvider(devsyConfig *config.Config, oldName, newName string) error
- func ParseOptions(options []string) (map[string]string, error)
- func ProInstanceExists(context, proInstanceID string) bool
- func ProviderExists(context, provider string) bool
- func ResolveExternalRuntimeBinary(agent ProviderAgentConfig, binariesDir string) (string, error)
- func RewriteSourceTag(source, tag string) (string, error)
- func SaveMachineConfig(machine *Machine) error
- func SaveProInstanceConfig(context string, proInstance *ProInstance) error
- func SaveProviderConfig(context string, provider *ProviderConfig) error
- func SaveProviderVersionCache(c ProviderVersionCache) error
- func SaveWorkspaceConfig(workspace *Workspace) error
- func SaveWorkspaceResult(workspace *Workspace, result *config2.Result) error
- func SplitSourceAndTag(canonical string) (base, tag string)
- func StatUpdatePath(root *os.Root, name string) (fs.FileInfo, error)
- func ToEnvironment(workspace *Workspace, machine *Machine, options map[string]config.OptionValue, ...) []string
- func ToEnvironmentWithBinaries(opts EnvironmentOptions) ([]string, error)
- func ToOptions(workspace *Workspace, machine *Machine, options map[string]config.OptionValue) map[string]string
- func ToOptionsMachine(machine *Machine) map[string]string
- func ToOptionsWorkspace(workspace *Workspace) map[string]string
- func ToProInstanceID(url string) string
- func ValidateExternalDriverConfig(agent ProviderAgentConfig) error
- func WorkspaceExists(context, workspaceID string) bool
- func WriteFileAtomic(path string, data []byte, perm os.FileMode) error
- type AgentWorkspaceInfo
- type BuildOptions
- type CLIOptions
- type ContainerWorkspaceInfo
- type CreateProxyCommands
- type DaemonCommands
- type EnvironmentOptions
- type ExportConfig
- type ExportMachineConfig
- type ExportProviderConfig
- type ExportWorkspaceConfig
- type GetProxyCommands
- type GitToken
- type InitState
- type ListProxyCommands
- type ListVersionsOptions
- type Machine
- type MachineProviderConfig
- type ProInstance
- type ProMetadata
- type ProviderAgentConfig
- type ProviderAgentConfigExec
- type ProviderAppleDriverConfig
- type ProviderBinary
- type ProviderCommands
- type ProviderConfig
- type ProviderCustomDriverConfig
- type ProviderDockerDriverConfig
- type ProviderDockerlessOptions
- type ProviderExternalDriverConfig
- type ProviderKubernetesDriverConfig
- type ProviderMicrosandboxDriverConfig
- type ProviderOptionGroup
- type ProviderSource
- type ProviderVersion
- func ListGitHubReleases(baseURL, org, repo string, includePrerelease bool) ([]ProviderVersion, error)
- func ListManifestVersions(canonicalSource string, includePrerelease bool) ([]ProviderVersion, error)
- func ListVersionsForSource(source string, opts ListVersionsOptions) ([]ProviderVersion, error)
- func ListVersionsForSourceCached(providerName, source string, opts ListVersionsOptions) ([]ProviderVersion, error)
- func MarkCurrent(versions []ProviderVersion, canonicalSource string) []ProviderVersion
- type ProviderVersionCache
- type ProviderVersionCacheEntry
- type ProviderVersionCheckResult
- type ProxyCommands
- type SubOptions
- type UpdateProxyCommands
- type WatchProxyCommands
- type Workspace
- type WorkspaceIDEConfig
- type WorkspaceMachineConfig
- type WorkspaceProviderConfig
- type WorkspaceSource
Constants ¶
const ( WorkspaceConfigFile = "workspace.json" WorkspaceResultFile = "workspace_result.json" MachineConfigFile = "machine.json" ProInstanceConfigFile = "pro.json" ProviderConfigFile = "provider.json" DaemonStateFile = config.BinaryName + "_ts.state" )
const ( DockerDriver = "docker" KubernetesDriver = "kubernetes" CustomDriver = "custom" AppleDriver = "apple" MicrosandboxDriver = "microsandbox" ExternalDriver = "external" )
const (
CommandEnv = "COMMAND"
)
const DeprecatedMicrosandboxSource = "builtin:microsandbox"
DeprecatedMicrosandboxSource explicitly selects the legacy built-in provider.
Variables ¶
var ( WorkspaceSourceGit = "git:" WorkspaceSourceLocal = "local:" WorkspaceSourceImage = "image:" WorkspaceSourceContainer = "container:" WorkspaceSourceSnapshot = "snapshot:" WorkspaceSourceUnknown = "unknown:" )
var ErrVersionListUnsupported = errors.New("provider source does not support version listing")
ErrVersionListUnsupported indicates the provider's source type does not expose a list of versions.
var GithubAPIBaseURL = "https://api.github.com"
GithubAPIBaseURL is the base URL for GitHub API calls; overridden in tests.
var (
ProviderNameRegEx = regexp.MustCompile(`[^a-z0-9\-]+`)
)
Functions ¶
func ClassifyVersionSource ¶ added in v1.3.1
func ClassifyVersionSource(canonical string) sourceKind
ClassifyVersionSource categorises a canonical source string into its source kind.
func CombineOptions ¶
func CombineOptions( workspace *Workspace, machine *Machine, options map[string]config.OptionValue, ) map[string]config.OptionValue
func DownloadBinaries ¶
func DownloadUpdateBinaries ¶ added in v1.24.0
func DownloadUpdateBinaries( ctx context.Context, binaries map[string][]*ProviderBinary, target string, ) (map[string]string, error)
DownloadUpdateBinaries prepares an already isolated provider update tree. Unlike the ordinary downloader it confines archive materialization with os.Root. Caller validates/seeds the tree and separately handles absolute local references.
func GetBaseEnvironment ¶
func GetBinaries ¶
func GetBinaries(context string, config *ProviderConfig) (map[string]string, error)
func GetBinariesFrom ¶
func GetBinariesFrom(config *ProviderConfig, binariesDir string) (map[string]string, error)
func GetDaemonDir ¶
func GetLocksDir ¶
func GetMachineDir ¶
func GetMachinesDir ¶
func GetProInstanceDir ¶
func GetProInstanceOperationLock ¶ added in v1.20.0
GetProInstanceOperationLock serializes creation of one Pro host without sharing a lock file with provider rename or lifecycle operations.
func GetProInstancesDir ¶
func GetProviderBinariesDir ¶
func GetProviderDir ¶
func GetProviderInitLock ¶ added in v1.13.0
GetProviderInitLock returns the advisory lock held while a provider's init command runs, so ResolveInitState can tell a live "initializing" run apart from one abandoned by a crashed process.
func GetProviderOperationLock ¶ added in v1.20.0
GetProviderOperationLock returns a file-based lock that serializes broad lifecycle operations (add, set-source, update, set, init, delete, rename) for the given provider within the given context.
func GetProviderOptions ¶
func GetProviderSource ¶ added in v1.3.1
func GetProviderSource(src ProviderSource, configName string) string
GetProviderSource returns a canonical source string for the provider, used for version checks and updates.
func GetProvidersDir ¶
func GetWorkspaceAgentDir ¶ added in v1.3.1
GetWorkspaceAgentDir returns the host-side per-workspace agent dir (.../workspaces/<id>/agent). Container-side agent code keeps using FindAgentHomeDir.
func GetWorkspaceContentDir ¶ added in v1.3.1
GetWorkspaceContentDir returns the host-side bind-mount source for a workspace (.../contexts/<ctx>/contents/<id>).
func GetWorkspaceContentsDir ¶ added in v1.3.1
GetWorkspaceContentsDir returns the per-context parent of workspace content folders (.../contexts/<ctx>/contents).
func GetWorkspaceDir ¶
func GetWorkspaceLogDir ¶ added in v1.3.1
GetWorkspaceLogDir returns the per-workspace log dir (.../workspaces/<id>/logs) used by the desktop's streaming-log store.
func GetWorkspacesDir ¶
func HashProviderSource ¶ added in v1.3.1
func LoadWorkspaceResult ¶
func LockProvider ¶ added in v1.24.0
LockProvider acquires the operation lock for providerName in contextName and returns the func that releases it. Errors are wrapped as "get operation lock" or "acquire operation lock". Callers defer the returned func.
func LockProviderNamed ¶ added in v1.24.0
LockProviderNamed is LockProvider with the provider name in the error text ("get operation lock for <name>: ...").
func MachineExists ¶
func MoveProvider ¶ added in v1.3.1
MoveProvider renames a provider's directory on disk and migrates its state in config.json. This preserves all options, initialized flag, and other state that CloneProvider would lose.
func ProInstanceExists ¶
func ProviderExists ¶
func ResolveExternalRuntimeBinary ¶ added in v1.22.0
func ResolveExternalRuntimeBinary(agent ProviderAgentConfig, binariesDir string) (string, error)
ResolveExternalRuntimeBinary verifies an already prepared agent-side executable. It never downloads, executes, or removes a file, including on checksum failure.
func RewriteSourceTag ¶ added in v1.3.1
RewriteSourceTag returns the source with its version tag replaced by the given one.
func SaveMachineConfig ¶
func SaveProInstanceConfig ¶
func SaveProInstanceConfig(context string, proInstance *ProInstance) error
func SaveProviderConfig ¶
func SaveProviderConfig(context string, provider *ProviderConfig) error
func SaveProviderVersionCache ¶ added in v1.3.1
func SaveProviderVersionCache(c ProviderVersionCache) error
func SaveWorkspaceConfig ¶
func SaveWorkspaceResult ¶
func SplitSourceAndTag ¶ added in v1.3.1
SplitSourceAndTag splits a canonical provider source into its base and optional @tag suffix.
func StatUpdatePath ¶ added in v1.24.0
StatUpdatePath retains Root confinement while avoiding a Windows Root.Stat panic when a terminal relative link normalizes to its own parent directory. Windows cleans link targets before traversal; POSIX must retain kernel ordering.
func ToEnvironment ¶
func ToEnvironment( workspace *Workspace, machine *Machine, options map[string]config.OptionValue, extraEnv map[string]string, ) []string
ToEnvironment builds the full environment for provider subprocess execution. The provider name is available to subprocesses as PROVIDER_ID (set by GetBaseEnvironment). Do NOT add DEVSY_PROVIDER to the subprocess env - it is reserved by the --provider CLI flag via inheritFlagsFromEnvironment in cmd/root.go, and setting it would override the global provider selection for any child devsy process.
func ToEnvironmentWithBinaries ¶
func ToEnvironmentWithBinaries(opts EnvironmentOptions) ([]string, error)
func ToOptionsMachine ¶
func ToOptionsWorkspace ¶
func ToProInstanceID ¶
func ValidateExternalDriverConfig ¶ added in v1.22.0
func ValidateExternalDriverConfig(agent ProviderAgentConfig) error
ValidateExternalDriverConfig checks declarations without accessing the filesystem. Template-selected drivers must be validated again after option resolution.
func WorkspaceExists ¶
func WriteFileAtomic ¶ added in v1.3.1
WriteFileAtomic writes data to path atomically via a temp file and rename, so concurrent readers never see a partial write. On POSIX it also fsyncs the parent directory so the rename survives a crash; on Windows that sync is a no-op, so callers there should still tolerate re-resolving state.
Types ¶
type AgentWorkspaceInfo ¶
type AgentWorkspaceInfo struct {
// WorkspaceOrigin is the path where this workspace config originated from
WorkspaceOrigin string `json:"workspaceOrigin,omitempty"`
// Workspace holds the workspace info
Workspace *Workspace `json:"workspace,omitempty"`
// LastDevContainerConfig can be used as a fallback if the workspace was already started
// and we lost track of the devcontainer.json
LastDevContainerConfig *devcontainerconfig.DevContainerConfigWithPath `json:"lastDevContainerConfig,omitempty"`
// Machine holds the machine info
Machine *Machine `json:"machine,omitempty"`
// Agent holds the agent info
Agent ProviderAgentConfig `json:"agent"`
// CLIOptions holds the cli options
CLIOptions CLIOptions `json:"cliOptions"`
// Options holds the filled provider options for this workspace
Options map[string]config.OptionValue `json:"options,omitempty"`
// ContentFolder holds the folder where the content is stored
ContentFolder string `json:"contentFolder,omitempty"`
// Origin holds the folder where this config was loaded from
Origin string `json:"-"`
// WorkspaceWasExisting records same-UID reuse during agent initialization.
// It is local ownership state, never supplied or persisted through JSON.
WorkspaceWasExisting bool `json:"-"`
// InjectTimeout specifies how long to wait for the agent to be injected into the dev container
InjectTimeout time.Duration `json:"injectTimeout,omitempty"`
// RegistryCache defines the registry to use for caching builds
RegistryCache string `json:"registryCache,omitempty"`
}
func CloneAgentWorkspaceInfo ¶
func CloneAgentWorkspaceInfo(agentWorkspaceInfo *AgentWorkspaceInfo) *AgentWorkspaceInfo
type BuildOptions ¶
type BuildOptions struct {
CLIOptions
// Platform specifies the target platform for the build (e.g., linux/amd64).
Platform string
// RegistryCache specifies a registry location to use for build cache storage and retrieval.
// When set, BuildKit will use type=registry cache with this reference.
RegistryCache string
// ExportCache controls whether to export the build cache to the registry.
// Only applies when RegistryCache is set.
ExportCache bool
// NoBuild prevents building the container image. When true, the command will fail if the image
// does not already exist. Used to enforce that images must be pre-built.
NoBuild bool
// PushDuringBuild enables pushing the image directly to the registry during the build process,
// bypassing the load-to-daemon step. This improves build performance in CI/CD
// environments by avoiding the tar export/import overhead. When enabled, the image is pushed
// directly from BuildKit to the registry without being loaded into the local Docker daemon.
// This requires a repository to be specified and is mutually exclusive with SkipPush.
PushDuringBuild bool
}
BuildOptions extends CLIOptions with additional build-specific configuration.
type CLIOptions ¶
type CLIOptions struct {
// Platform are the platform options
Platform devsy.PlatformOptions `json:"platformOptions"`
// up options
ID string `json:"id,omitempty"`
Source string `json:"source,omitempty"`
IDE string `json:"ide,omitempty"`
IDEOptions []string `json:"ideOptions,omitempty"`
PrebuildRepositories []string `json:"prebuildRepositories,omitempty"`
DevContainerImage string `json:"devContainerImage,omitempty"`
DevContainerPath string `json:"devContainerPath,omitempty"`
DevContainerID string `json:"devContainerID,omitempty"`
DevContainerSource string `json:"devContainerSource,omitempty"`
WorkspaceEnv []string `json:"workspaceEnv,omitempty"`
WorkspaceEnvFile []string `json:"workspaceEnvFile,omitempty"`
SecretsEnv []string `json:"secretsEnv,omitempty"`
TerminalSecretEnvNames []string `json:"terminalSecretEnvNames,omitempty"`
SecretsMount []string `json:"secretsMount,omitempty"`
BuildSecrets []string `json:"buildSecrets,omitempty"`
GitToken *GitToken `json:"gitToken,omitempty"`
Secrets []string `json:"secrets,omitempty"`
EnvVars []string `json:"envVars,omitempty"`
BuildSecretNames []string `json:"buildSecretNames,omitempty"`
GitTokenSecret string `json:"gitTokenSecret,omitempty"`
GitTokenUsername string `json:"gitTokenUsername,omitempty"`
FeatureSecretsFile string `json:"featureSecretsFile,omitempty"`
InitEnv []string `json:"initEnv,omitempty"`
Recreate bool `json:"recreate,omitempty"`
Recovery bool `json:"recovery,omitempty"`
Prebuild bool `json:"prebuild,omitempty"`
Reset bool `json:"reset,omitempty"`
NoAutoStart bool `json:"noAutoStart,omitempty"`
DisableDaemon bool `json:"disableDaemon,omitempty"`
DaemonInterval string `json:"daemonInterval,omitempty"`
GitCloneStrategy git.CloneStrategy `json:"gitCloneStrategy,omitempty"`
GitCloneRecursiveSubmodules bool `json:"gitCloneRecursive,omitempty"`
GitLFSMode git.LFSMode `json:"gitLFSMode,omitempty"`
FallbackImage string `json:"fallbackImage,omitempty"`
// RunArgs are extra `docker run` arguments applied when a devcontainer
// source override (Source: image/none) suppresses discovery of a project
// devcontainer.json, so runArgs it would have set (e.g. --add-host) still
// take effect. Used by snapshot restore to replay the original
// devcontainer.json's runArgs onto the restored, image-sourced container.
RunArgs []string `json:"runArgs,omitempty"`
// ContainerEnv are extra container environment variables applied under
// the same suppressed-discovery circumstances as RunArgs, for the same
// reason: snapshot restore replaying the original devcontainer.json's
// containerEnv onto the restored, image-sourced container.
ContainerEnv map[string]string `json:"containerEnv,omitempty"`
GitSSHSigningKey string `json:"gitSshSigningKey,omitempty"`
// SSHAuthSockID is used when looking for SSH_AUTH_SOCK, defaults to a new
// random ID if not set (only used for browser IDEs).
SSHAuthSockID string `json:"sshAuthSockID,omitempty"`
StrictHostKeyChecking bool `json:"strictHostKeyChecking,omitempty"`
AdditionalFeatures string `json:"additionalFeatures,omitempty"`
ExtraDevContainerPath string `json:"extraDevContainerPath,omitempty"`
User string `json:"user,omitempty"`
DefaultUserEnvProbe string `json:"defaultUserEnvProbe,omitempty"`
Userns string `json:"userns,omitempty"`
UidMap []string `json:"uidMap,omitempty"`
GidMap []string `json:"gidMap,omitempty"`
IDLabels []string `json:"idLabels,omitempty"`
GPUAvailability string `json:"gpuAvailability,omitempty"`
WorkspaceMountConsistency string `json:"workspaceMountConsistency,omitempty"`
RunPlatform string `json:"runPlatform,omitempty"`
Mounts []string `json:"mounts,omitempty"`
UpdateRemoteUserUIDDefault string `json:"updateRemoteUserUIDDefault,omitempty"`
ContainerDataFolder string `json:"containerDataFolder,omitempty"`
MountWorkspaceGitRoot *bool `json:"mountWorkspaceGitRoot,omitempty"`
TerminalColumns int `json:"terminalColumns,omitempty"`
TerminalRows int `json:"terminalRows,omitempty"`
SkipNonBlockingCommands bool `json:"skipNonBlockingCommands,omitempty"`
ContainerUser string `json:"containerUser,omitempty"`
RemoteUser string `json:"remoteUser,omitempty"`
// nil = auto-detect; true/false = force clone-in-container or bind-mount.
PullFromInsideContainerOverride *bool `json:"pullFromInsideContainerOverride,omitempty"`
// skip lifecycle hook options
SkipPostCreate bool `json:"skipPostCreate,omitempty"`
SkipPostStart bool `json:"skipPostStart,omitempty"`
SkipPostAttach bool `json:"skipPostAttach,omitempty"`
SkipHostRequirements bool `json:"skipHostRequirements,omitempty"`
WaitFor string `json:"waitFor,omitempty"`
// dotfiles options
DotfilesRepo string `json:"dotfilesRepo,omitempty"`
DotfilesScript string `json:"dotfilesScript,omitempty"`
DotfilesTargetPath string `json:"dotfilesTargetPath,omitempty"`
// build options
// Repository specifies the container registry repository to push the built image to (e.g., ghcr.io/user/image).
// When set, the image will be tagged and pushed to this repository after building.
Repository string `json:"repository,omitempty"`
// SkipPush prevents pushing the built image to the repository. Useful for testing builds
// without affecting the registry. When true, the image is only built and loaded locally.
SkipPush bool `json:"skipPush,omitempty"`
// PushDuringBuild pushes the image directly to the registry during the build process,
// skipping the load-to-daemon step. This is an optimization for CI/CD workflows. When true,
// the build uses BuildKit's direct push capability (--push flag) instead of the default
// load behavior (--load flag). Requires Repository to be set and cannot be
// used with SkipPush.
PushDuringBuild bool `json:"pushDuringBuild,omitempty"`
// Platforms specifies the target platforms for multi-architecture builds (e.g., linux/amd64,linux/arm64).
Platforms []string `json:"platform,omitempty"`
// Tag specifies additional image tags to apply to the built image beyond the default prebuild hash tag.
Tag []string `json:"tag,omitempty"`
// CacheFrom specifies images to use as cache sources. When set, these take priority over
// devcontainer.json build.cacheFrom values.
CacheFrom []string `json:"cacheFrom,omitempty"`
NoCache bool `json:"noCache,omitempty"`
Labels []string `json:"labels,omitempty"`
Output string `json:"output,omitempty"`
ExperimentalLockfile string `json:"experimentalLockfile,omitempty"`
// FrozenLockfile enforces that the devcontainer-lock.json feature lockfile
// already exists and matches the resolved features; the build fails instead
// of creating or updating it.
FrozenLockfile bool `json:"frozenLockfile,omitempty"`
// NoLockfile disables devcontainer-lock.json generation and verification
// entirely. Mutually exclusive with FrozenLockfile.
NoLockfile bool `json:"noLockfile,omitempty"`
// ImageName specifies an alternative name for the built image.
ImageName string `json:"imageName,omitempty"`
// NoBuild prevents building; the command will fail if the image does not exist.
NoBuild bool `json:"noBuild,omitempty"`
// ForceBuild forces a rebuild even if a cached image exists.
ForceBuild bool `json:"forceBuild,omitempty"`
// Pull re-pulls base images during the build (docker build --pull) instead
// of reusing locally cached layers.
Pull bool `json:"pull,omitempty"`
// ForceDockerless forces the use of a dockerless build approach.
ForceDockerless bool `json:"forceDockerless,omitempty"`
// ForceInternalBuildKit forces the use of internal BuildKit instead of docker buildx.
ForceInternalBuildKit bool `json:"forceInternalBuildKit,omitempty"`
}
type ContainerWorkspaceInfo ¶
type ContainerWorkspaceInfo struct {
// IDE holds the ide config options
IDE WorkspaceIDEConfig `json:"ide"`
// CLIOptions holds the cli options
CLIOptions CLIOptions `json:"cliOptions"`
// Dockerless holds custom dockerless configuration
Dockerless ProviderDockerlessOptions `json:"dockerless"`
// ContainerTimeout is the timeout in minutes to wait until the agent tries
// to delete the container.
ContainerTimeout string `json:"containerInactivityTimeout,omitempty"`
// Source is a WorkspaceSource to be used inside the container
Source WorkspaceSource `json:"source"`
// ContentFolder holds the folder where the content is stored
ContentFolder string `json:"contentFolder,omitempty"`
// PullFromInsideContainer determines if project should be pulled from Source when container starts
PullFromInsideContainer types.StrBool `json:"pullFromInsideContainer,omitempty"`
// Agent holds the agent info
Agent ProviderAgentConfig `json:"agent"`
}
type CreateProxyCommands ¶
type DaemonCommands ¶
type EnvironmentOptions ¶
type EnvironmentOptions struct {
Context string
Workspace *Workspace
Machine *Machine
Options map[string]config.OptionValue
Config *ProviderConfig
ExtraEnv map[string]string
}
type ExportConfig ¶
type ExportConfig struct {
// Workspace is the workspace that was exported
Workspace *ExportWorkspaceConfig `json:"workspace,omitempty"`
// Machine is the machine that was exported
Machine *ExportMachineConfig `json:"machine,omitempty"`
// Provider is the provider that was exported
Provider *ExportProviderConfig `json:"provider,omitempty"`
// SnapshotRef, if set, is a snapshot the exported workspace's state should
// be restored from on import, carrying container/volume state rather than
// just metadata.
SnapshotRef string `json:"snapshotRef,omitempty"`
}
type ExportMachineConfig ¶
type ExportMachineConfig struct {
// ID is the machine id
ID string `json:"id,omitempty"`
// Context is the machine context
Context string `json:"context,omitempty"`
// Data is the machine folder data
Data string `json:"data,omitempty"`
}
func ExportMachine ¶
func ExportMachine(context, machineID string) (*ExportMachineConfig, error)
type ExportProviderConfig ¶
type ExportProviderConfig struct {
// ID is the provider id
ID string `json:"id,omitempty"`
// Context is the provider context
Context string `json:"context,omitempty"`
// Data is the provider folder data
Data string `json:"data,omitempty"`
// Config is the provider config within the config.yaml
Config *config.ProviderConfig `json:"config,omitempty"`
}
func ExportProvider ¶
func ExportProvider( devsyConfig *config.Config, context, providerID string, ) (*ExportProviderConfig, error)
type ExportWorkspaceConfig ¶
type ExportWorkspaceConfig struct {
// ID is the workspace id
ID string `json:"id,omitempty"`
// Context is the workspace context
Context string `json:"context,omitempty"`
// UID is used to identify this specific workspace
UID string `json:"uid,omitempty"`
// Data is the workspace folder data
Data string `json:"data,omitempty"`
}
func ExportWorkspace ¶
func ExportWorkspace(context, workspaceID string) (*ExportWorkspaceConfig, error)
type GetProxyCommands ¶
type GitToken ¶ added in v1.10.0
type GitToken struct {
Host string `json:"host,omitempty"`
Username string `json:"username,omitempty"`
Token string `json:"token,omitempty"`
}
GitToken is a resolved access token for cloning a private HTTP repository. It is scoped to a host so it is never offered to other hosts git contacts.
type InitState ¶ added in v1.13.0
type InitState string
InitState is the lifecycle state of a provider's initialization.
func ResolveInitState ¶ added in v1.13.0
func ResolveInitState(contextName, name string, state *config.ProviderConfig) (InitState, error)
ResolveInitState derives the current init lifecycle state for a provider from its persisted config and the live state of its init lock.
type ListProxyCommands ¶
type ListProxyCommands struct {
// Workspaces lists all workspaces
Workspaces types.StrArray `json:"workspaces,omitempty"`
// Projects lists all projects
Projects types.StrArray `json:"projects,omitempty"`
// Templates lists all templates in a project
Templates types.StrArray `json:"templates,omitempty"`
// Clusters lists all clusters and runners in a project
Clusters types.StrArray `json:"clusters,omitempty"`
}
type ListVersionsOptions ¶ added in v1.3.1
ListVersionsOptions tunes the lister.
type Machine ¶
type Machine struct {
// ID is the machine id to use
ID string `json:"id,omitempty"`
// Provider is the provider used to create this workspace
Provider MachineProviderConfig `json:"provider"`
// CreationTimestamp is the timestamp when this workspace was created
CreationTimestamp types.Time `json:"creationTimestamp"`
// Context is the context where this config file was loaded from
Context string `json:"context,omitempty"`
// Origin is the place where this config file was loaded from
Origin string `json:"-"`
}
func CloneMachine ¶
func LoadMachineConfig ¶
type MachineProviderConfig ¶
type MachineProviderConfig struct {
// Name is the provider name used to deploy this machine
Name string `json:"name,omitempty"`
// Options are the local options that override the global ones
Options map[string]config.OptionValue `json:"options,omitempty"`
}
type ProInstance ¶
type ProInstance struct {
// Provider is the provider name this pro instance belongs to
Provider string `json:"provider,omitempty"`
// Host is Devsy Pro host to use
Host string `json:"host,omitempty"`
// CreationTimestamp is the timestamp when this pro instance was created
CreationTimestamp types.Time `json:"creationTimestamp"`
}
func LoadProInstanceConfig ¶
func LoadProInstanceConfig(context, proInstanceHost string) (*ProInstance, error)
type ProMetadata ¶
type ProMetadata struct {
// InstanceName is the platform CRD name for this workspace
InstanceName string `json:"instanceName,omitempty"`
// Project is the platform project the workspace lives in
Project string `json:"project,omitempty"`
// DisplayName is the name intended to show users
DisplayName string `json:"displayName,omitempty"`
}
type ProviderAgentConfig ¶
type ProviderAgentConfig struct {
// Local defines if Devsy is running locally
Local types.StrBool `json:"local,omitempty"`
// Path is the binary path inside the server devsy will expect the agent binary
Path string `json:"path,omitempty"`
// DataPath is the agent path where data is stored
DataPath string `json:"dataPath,omitempty"`
// DownloadURL is the base url where to download the agent from
DownloadURL string `json:"downloadURL,omitempty"`
// Timeout is the timeout in minutes to wait until the agent tries
// to turn of the server.
Timeout string `json:"inactivityTimeout,omitempty"`
// ContainerTimeout is the timeout in minutes to wait until the agent tries
// to delete the container.
ContainerTimeout string `json:"containerInactivityTimeout,omitempty"`
// InjectGitCredentials signals Devsy if git credentials should get synced into
// the remote machine for cloning the repository.
InjectGitCredentials types.StrBool `json:"injectGitCredentials,omitempty"`
// InjectDockerCredentials signals Devsy if docker credentials should get synced
// into the remote machine for pulling and pushing images.
InjectDockerCredentials types.StrBool `json:"injectDockerCredentials,omitempty"`
// Exec commands that can be used on the remote
Exec ProviderAgentConfigExec `json:"exec"`
// Binaries is an optional field to specify a binary to execute the commands
Binaries map[string][]*ProviderBinary `json:"binaries,omitempty"`
// Dockerless holds custom dockerless configuration
Dockerless ProviderDockerlessOptions `json:"dockerless"`
// Driver selects the runtime used to deploy the devcontainer.
Driver string `json:"driver,omitempty"`
// Docker holds docker specific configuration
Docker ProviderDockerDriverConfig `json:"docker"`
// Custom holds custom driver specific configuration
Custom ProviderCustomDriverConfig `json:"custom"`
// Kubernetes holds kubernetes specific configuration
Kubernetes ProviderKubernetesDriverConfig `json:"kubernetes"`
// Apple holds Apple container specific configuration
Apple ProviderAppleDriverConfig `json:"apple"`
// Microsandbox holds microsandbox microVM specific configuration
Microsandbox ProviderMicrosandboxDriverConfig `json:"microsandbox"`
External ProviderExternalDriverConfig `json:"external,omitzero"`
}
func (ProviderAgentConfig) ContainerInstallPath ¶ added in v1.17.0
func (a ProviderAgentConfig) ContainerInstallPath() string
ContainerInstallPath is where the agent binary lives inside the container for this driver: config.ContainerDevsyHelperLocation by default, or the Kubernetes driver's AgentInstallPath override when set (a writable path for non-root containers, e.g. an OpenShift restricted-SCC pod).
func (ProviderAgentConfig) IsDockerDriver ¶
func (a ProviderAgentConfig) IsDockerDriver() bool
func (ProviderAgentConfig) RunsFixedNonRootUser ¶ added in v1.17.0
func (a ProviderAgentConfig) RunsFixedNonRootUser() bool
RunsFixedNonRootUser reports whether the effective Kubernetes container security context explicitly guarantees the container runs as a fixed non-root UID. STRICT_SECURITY can expose pod-level run-as fields because it removes the generated root defaults; an agent context can also omit those fields and inherit the pod-level values.
type ProviderAgentConfigExec ¶
type ProviderAppleDriverConfig ¶ added in v1.10.0
type ProviderAppleDriverConfig struct {
// Path where to find the `container` binary, defaults to 'container'
Path string `json:"path,omitempty"`
// Rosetta enables x86_64 emulation inside the guest.
Rosetta types.StrBool `json:"rosetta,omitempty"`
// Environment variables to set when running `container` commands
Env map[string]string `json:"env,omitempty"`
}
ProviderAppleDriverConfig holds configuration for the Apple container driver, which runs Linux containers as lightweight VMs on Apple silicon (macOS 26+).
type ProviderBinary ¶
type ProviderBinary struct {
// The current OS
OS string `json:"os,omitempty"`
// The current Arch
Arch string `json:"arch,omitempty"`
// Checksum is the sha256 hash of the binary
Checksum string `json:"checksum,omitempty"`
// Path is the binary url to download from or relative path to use
Path string `json:"path,omitempty"`
// ArchivePath is the path within the archive to extract
ArchivePath string `json:"archivePath,omitempty"`
// Name is the name of the binary to store locally
Name string `json:"name,omitempty"`
}
type ProviderCommands ¶
type ProviderCommands struct {
// Init is run directly after `devsy provider init`
Init types.StrArray `json:"init,omitempty"`
// Command executes a command on the server
Command types.StrArray `json:"command,omitempty"`
// Create creates a new server
Create types.StrArray `json:"create,omitempty"`
// Delete destroys a server
Delete types.StrArray `json:"delete,omitempty"`
// Start starts a stopped server
Start types.StrArray `json:"start,omitempty"`
// Stop stops a running server
Stop types.StrArray `json:"stop,omitempty"`
// Status retrieves the server status
Status types.StrArray `json:"status,omitempty"`
// Describe retrieves the server description
Describe types.StrArray `json:"describe,omitempty"`
// Proxy proxies commands
Proxy *ProxyCommands `json:"proxy,omitempty"`
// Daemon commands
Daemon *DaemonCommands `json:"daemon,omitempty"`
}
type ProviderConfig ¶
type ProviderConfig struct {
// Name is the name of the provider
Name string `json:"name,omitempty"`
// Version is the provider version
Version string `json:"version,omitempty"`
// Icon holds an image URL that will be displayed
Icon string `json:"icon,omitempty"`
// IconDark holds an image URL that will be displayed in dark mode
IconDark string `json:"iconDark,omitempty"`
// Home holds the provider home URL
Home string `json:"home,omitempty"`
// Source is the source the provider was loaded from
Source ProviderSource `json:"source"`
// Description is the provider description
Description string `json:"description,omitempty"`
// OptionGroups holds information how to display options
OptionGroups []ProviderOptionGroup `json:"optionGroups,omitempty"`
// Options are the provider options.
Options map[string]*types.Option `json:"options,omitempty"`
// Agent allows you to override agent configuration
Agent ProviderAgentConfig `json:"agent"`
// Exec holds the provider commands
Exec ProviderCommands `json:"exec"`
// Binaries is an optional field to specify a binary to execute the commands
Binaries map[string][]*ProviderBinary `json:"binaries,omitempty"`
}
func LoadProviderConfig ¶
func LoadProviderConfig(context, provider string) (*ProviderConfig, error)
func ParseProvider ¶
func ParseProvider(reader io.Reader) (*ProviderConfig, error)
func (*ProviderConfig) HasHealthCheck ¶
func (c *ProviderConfig) HasHealthCheck() bool
func (*ProviderConfig) IsDaemonProvider ¶
func (c *ProviderConfig) IsDaemonProvider() bool
func (*ProviderConfig) IsMachineProvider ¶
func (c *ProviderConfig) IsMachineProvider() bool
func (*ProviderConfig) IsProxyProvider ¶
func (c *ProviderConfig) IsProxyProvider() bool
type ProviderCustomDriverConfig ¶
type ProviderCustomDriverConfig struct {
// FindDevContainer is used to find an existing devcontainer
FindDevContainer types.StrArray `json:"findDevContainer,omitempty"`
// CommandDevContainer is used to execute a command in the devcontainer
CommandDevContainer types.StrArray `json:"commandDevContainer,omitempty"`
// TargetArchitecture is used to find out the target architecture
TargetArchitecture types.StrArray `json:"targetArchitecture,omitempty"`
// RunDevContainer is used to actually run the devcontainer
RunDevContainer types.StrArray `json:"runDevContainer,omitempty"`
// StartDevContainer is used to start the devcontainer
StartDevContainer types.StrArray `json:"startDevContainer,omitempty"`
// StopDevContainer is used to stop the devcontainer
StopDevContainer types.StrArray `json:"stopDevContainer,omitempty"`
// DeleteDevContainer is used to delete the devcontainer
DeleteDevContainer types.StrArray `json:"deleteDevContainer,omitempty"`
// CanReprovision returns true if the driver can reprovision the devcontainer
CanReprovision types.StrBool `json:"canReprovision,omitempty"`
// GetDevContainerLogs returns the logs of the devcontainer
GetDevContainerLogs types.StrArray `json:"getDevContainerLogs,omitempty"`
}
type ProviderDockerDriverConfig ¶
type ProviderDockerDriverConfig struct {
// Path where to find the docker binary, defaults to 'docker'
Path string `json:"path,omitempty"`
// If false, Devsy will not try to install docker into the machine.
Install types.StrBool `json:"install,omitempty"`
// Builder to use with docker
Builder string `json:"builder,omitempty"`
// Environment variables to set when running docker commands
Env map[string]string `json:"env,omitempty"`
// HelperImage overrides the helper image for volume operations. Empty falls
// back to DEVSY_HELPER_IMAGE, then config.DefaultHelperImage.
HelperImage string `json:"helperImage,omitempty"`
// Runtime identifies the container runtime explicitly (docker, podman, nerdctl).
// When empty, the runtime is auto-detected from the binary at Path.
Runtime string `json:"runtime,omitempty"`
// Elevation optionally runs docker commands through a privilege-elevation
// helper for rootful daemons whose socket is not accessible to the current
// user. One of "" / "none" (disabled), "pkexec", "sudo", or "doas".
Elevation string `json:"elevation,omitempty"`
}
type ProviderDockerlessOptions ¶
type ProviderDockerlessOptions struct {
// Disabled signals if dockerless building is disabled
Disabled types.StrBool `json:"disabled,omitempty"`
// Image is the image of the dockerless container to start
Image string `json:"image,omitempty"`
// IgnorePaths are additional ignore paths that should be ignored during deletion
IgnorePaths string `json:"ignorePaths,omitempty"`
// Registry to use as remote cache
RegistryCache string `json:"registryCache,omitempty"`
// DisableDockerCredentials prevents docker credentials from getting injected
DisableDockerCredentials types.StrBool `json:"disableDockerCredentials,omitempty"`
}
type ProviderExternalDriverConfig ¶ added in v1.22.0
type ProviderExternalDriverConfig struct {
Binary string `json:"binary,omitempty"`
// Args is static argv appended to the executable, without shell or option expansion.
Args types.StrArray `json:"args,omitempty"`
ImageBackend string `json:"imageBackend,omitempty"`
}
ProviderExternalDriverConfig selects a declared agent binary, not a PATH executable.
type ProviderKubernetesDriverConfig ¶
type ProviderKubernetesDriverConfig struct {
KubernetesContext string `json:"kubernetesContext,omitempty"`
KubernetesConfig string `json:"kubernetesConfig,omitempty"`
KubernetesNamespace string `json:"kubernetesNamespace,omitempty"`
PodTimeout string `json:"podTimeout,omitempty"`
KubernetesPullSecretsEnabled string `json:"kubernetesPullSecretsEnabled,omitempty"`
CreateNamespace string `json:"createNamespace,omitempty"`
ClusterRole string `json:"clusterRole,omitempty"`
ServiceAccount string `json:"serviceAccount,omitempty"`
Architecture string `json:"architecture,omitempty"`
InactivityTimeout string `json:"inactivityTimeout,omitempty"`
StorageClass string `json:"storageClass,omitempty"`
DiskSize string `json:"diskSize,omitempty"`
PvcAccessMode string `json:"pvcAccessMode,omitempty"`
PvcAnnotations string `json:"pvcAnnotations,omitempty"`
NodeSelector string `json:"nodeSelector,omitempty"`
Resources string `json:"resources,omitempty"`
WorkspaceVolumeMount string `json:"workspaceVolumeMount,omitempty"`
PodManifestTemplate string `json:"podManifestTemplate,omitempty"`
Labels string `json:"labels,omitempty"`
StrictSecurity string `json:"strictSecurity,omitempty"`
AgentSecurityContext string `json:"agentSecurityContext,omitempty"`
// AgentInstallPath overrides where the agent binary is installed inside
// the devsy/devsy-init containers. Defaults to /usr/local/bin/devsy,
// which requires root to write; set this (to a path under a writable
// mount, e.g. the workspace volume) when running non-root so delivery
// and the container's own entrypoint agree on a writable location.
AgentInstallPath string `json:"agentInstallPath,omitempty"`
// KubernetesUserNamespaces opts into setting spec.hostUsers to false
// (unless a pod template already sets it), so the kubelet maps the
// container's UIDs into a Linux user namespace instead of the host's.
// Defaults unset: STRICT_SECURITY and AGENT_SECURITY_CONTEXT also set
// HostUsers false for OpenShift restricted-v3 compatibility. The field's
// mere presence requires the cluster's UserNamespacesSupport feature gate
// (on by default only from Kubernetes 1.33) and node-level user-namespace
// support (Linux kernel 6.3+, containerd 2.0+/CRI-O 1.25+); use a pod
// template to override HostUsers on clusters without that support.
KubernetesUserNamespaces string `json:"kubernetesUserNamespaces,omitempty"`
}
type ProviderMicrosandboxDriverConfig ¶ added in v1.11.0
type ProviderMicrosandboxDriverConfig struct {
// Memory is the guest memory limit in MiB. Empty uses the runtime default.
Memory string `json:"memory,omitempty"`
// CPUs is the number of virtual CPUs. Empty uses the runtime default.
CPUs string `json:"cpus,omitempty"`
// MaxMemory is the hotplug memory ceiling in MiB. Empty uses the default.
MaxMemory string `json:"maxMemory,omitempty"`
// MaxCPUs is the hotplug CPU ceiling. Empty uses the default.
MaxCPUs string `json:"maxCpus,omitempty"`
// BlockEgress denies outbound public network (sandbox hardening).
BlockEgress types.StrBool `json:"blockEgress,omitempty"`
// Ephemeral removes the sandbox's disk state when it stops.
Ephemeral types.StrBool `json:"ephemeral,omitempty"`
// Storage is the OCI root disk size in GiB. Empty uses the runtime default.
Storage string `json:"storage,omitempty"`
// WorkspaceHostPermissions controls host permission mirroring for the primary workspace bind mount.
WorkspaceHostPermissions string `json:"workspaceHostPermissions,omitempty"`
// WorkspaceStatVirtualization controls stat virtualization for the primary workspace bind mount.
WorkspaceStatVirtualization string `json:"workspaceStatVirtualization,omitempty"`
}
ProviderMicrosandboxDriverConfig holds configuration for the microsandbox driver, which boots the devcontainer OCI image as a hardware-isolated microVM (libkrun) via the microsandbox runtime.
type ProviderOptionGroup ¶
type ProviderOptionGroup struct {
// Name is the display name of the option group
Name string `json:"name,omitempty"`
// Options are the options that belong to this group
Options []string `json:"options,omitempty"`
// DefaultVisible defines if the option group should be visible by default
DefaultVisible bool `json:"defaultVisible,omitempty"`
}
type ProviderSource ¶
type ProviderSource struct {
// Internal means provider was received internally
Internal bool `json:"internal,omitempty"`
// Github source for the provider
Github string `json:"github,omitempty"`
// File source for the provider
File string `json:"file,omitempty"`
// URL where the provider was downloaded from
URL string `json:"url,omitempty"`
// Raw is the exact string we used to load the provider
Raw string `json:"raw,omitempty"`
}
func ResolveProvider ¶ added in v1.3.1
func ResolveProvider( ctx context.Context, providerSource string, ) ([]byte, *ProviderSource, error)
ResolveProvider resolves a provider source string into raw provider YAML bytes and a ProviderSource describing the origin (internal, URL, file, or GitHub release).
type ProviderVersion ¶ added in v1.3.1
type ProviderVersion struct {
Tag string `json:"tag"`
PublishedAt time.Time `json:"publishedAt"`
Prerelease bool `json:"prerelease"`
Current bool `json:"current"`
}
ProviderVersion describes one upstream release.
func ListGitHubReleases ¶ added in v1.3.1
func ListGitHubReleases( baseURL, org, repo string, includePrerelease bool, ) ([]ProviderVersion, error)
ListGitHubReleases calls the GitHub Releases API (rooted at baseURL - pass "https://api.github.com" in production) and returns versions newest first. Drafts are always filtered out; prereleases only when includePrerelease is true.
func ListManifestVersions ¶ added in v1.3.1
func ListManifestVersions( canonicalSource string, includePrerelease bool, ) ([]ProviderVersion, error)
func ListVersionsForSource ¶ added in v1.3.1
func ListVersionsForSource(source string, opts ListVersionsOptions) ([]ProviderVersion, error)
ListVersionsForSource dispatches to the appropriate lister based on source shape.
func ListVersionsForSourceCached ¶ added in v1.3.1
func ListVersionsForSourceCached( providerName, source string, opts ListVersionsOptions, ) ([]ProviderVersion, error)
ListVersionsForSourceCached wraps ListVersionsForSource with cache read/write. providerName is used as the cache key. When opts.UseCache is true the cache is consulted; successful fetches always update the cache regardless.
func MarkCurrent ¶ added in v1.3.1
func MarkCurrent(versions []ProviderVersion, canonicalSource string) []ProviderVersion
MarkCurrent flags the version whose tag matches the source's pinned tag.
type ProviderVersionCache ¶ added in v1.3.1
type ProviderVersionCache map[string]ProviderVersionCacheEntry
ProviderVersionCache maps provider names to their cached version entries.
func LoadProviderVersionCache ¶ added in v1.3.1
func LoadProviderVersionCache() (ProviderVersionCache, error)
func (ProviderVersionCache) Get ¶ added in v1.3.1
func (c ProviderVersionCache) Get(name, sourceHash string) (ProviderVersionCacheEntry, bool)
type ProviderVersionCacheEntry ¶ added in v1.3.1
type ProviderVersionCacheEntry struct {
SourceHash string `json:"sourceHash"`
Versions []ProviderVersion `json:"versions"`
FetchedAt time.Time `json:"fetchedAt"`
}
ProviderVersionCacheEntry is one provider's cached version list.
type ProviderVersionCheckResult ¶ added in v1.3.1
type ProviderVersionCheckResult struct {
Current string `json:"current"`
Latest string `json:"latest"`
UpdateAvailable bool `json:"updateAvailable"`
Unsupported bool `json:"unsupported"`
Error string `json:"error,omitempty"`
}
ProviderVersionCheckResult is the per-provider result from CheckAllProviderVersions.
func BuildVersionCheckResult ¶ added in v1.3.1
func BuildVersionCheckResult( currentTag string, versions []ProviderVersion, ) ProviderVersionCheckResult
BuildVersionCheckResult constructs a ProviderVersionCheckResult from a current tag and list of versions.
type ProxyCommands ¶
type ProxyCommands struct {
// Up proxies the up command
Up types.StrArray `json:"up,omitempty"`
// Stop proxies the stop command
Stop types.StrArray `json:"stop,omitempty"`
// Delete proxies the delete command
Delete types.StrArray `json:"delete,omitempty"`
// Ssh proxies the ssh command
Ssh types.StrArray `json:"ssh,omitempty"`
// Status proxies the status command
Status types.StrArray `json:"status,omitempty"`
// Health checks the health of the platform
Health types.StrArray `json:"health,omitempty"`
// Create creates entities associated with this provider
Create CreateProxyCommands `json:"create"`
// Get gets entities associated with this provider
Get GetProxyCommands `json:"get"`
// List lists all entities associated with this provider
List ListProxyCommands `json:"list"`
// Watch lists all entities associated with this provider and then watches for changes
Watch WatchProxyCommands `json:"watch"`
// Update updates entities associated with this provider
Update UpdateProxyCommands `json:"update"`
}
type SubOptions ¶
type UpdateProxyCommands ¶
type WatchProxyCommands ¶
type Workspace ¶
type Workspace struct {
// ID is the workspace id to use
ID string `json:"id,omitempty"`
// UID is used to identify this specific workspace
UID string `json:"uid,omitempty"`
// Picture is the project social media image
Picture string `json:"picture,omitempty"`
// Provider is the provider used to create this workspace
Provider WorkspaceProviderConfig `json:"provider"`
// Machine is the machine to use for this workspace
Machine WorkspaceMachineConfig `json:"machine"`
// IDE holds IDE specific settings
IDE WorkspaceIDEConfig `json:"ide"`
// Source is the source where this workspace will be created from
Source WorkspaceSource `json:"source"`
// DevContainerImage is the container image to use, overriding whatever is in the devcontainer.json
DevContainerImage string `json:"devContainerImage,omitempty"`
// DevContainerPath is the path to the devcontainer.json relative to the
// workspace folder: the content root including the git subpath, if any.
DevContainerPath string `json:"devContainerPath,omitempty"`
// DevContainerID is the selected named devcontainer profile. It is persisted
// so lifecycle operations reuse the same profile instead of rediscovering it.
DevContainerID string `json:"devContainerID,omitempty"`
// DevContainerSource is the devcontainer source override (e.g. "image:<ref>"
// or "none") that ignores the project's devcontainer.json. It is persisted so
// restarts reuse the same override instead of falling back to discovery.
DevContainerSource string `json:"devContainerSource,omitempty"`
// DevContainerConfig holds the config for the devcontainer.json.
DevContainerConfig *devcontainerconfig.DevContainerConfig `json:"devContainerConfig,omitempty"`
// CreationTimestamp is the timestamp when this workspace was created
CreationTimestamp types.Time `json:"creationTimestamp"`
// LastUsedTimestamp holds the timestamp when this workspace was last accessed
LastUsedTimestamp types.Time `json:"lastUsed"`
// Context is the context where this config file was loaded from
Context string `json:"context,omitempty"`
// Imported signals that this workspace was imported
Imported bool `json:"imported,omitempty"`
// Origin is the place where this config file was loaded from
Origin string `json:"-"`
// Pro signals this workspace is remote and doesn't necessarily exist locally. It also has more metadata about the pro workspace
Pro *ProMetadata `json:"pro,omitempty"`
// Path to the file where the SSH config to access the workspace is stored
SSHConfigPath string `json:"sshConfigPath,omitempty"`
// Path to an alternate file where Devsy entries are written (for read-only SSH configs)
SSHConfigIncludePath string `json:"sshConfigIncludePath,omitempty"`
}
func CloneWorkspace ¶
func LoadWorkspaceConfig ¶
type WorkspaceIDEConfig ¶
type WorkspaceIDEConfig struct {
// Name is the name of the IDE
Name string `json:"name,omitempty"`
// Options are the local options that override the global ones
Options map[string]config.OptionValue `json:"options,omitempty"`
}
type WorkspaceMachineConfig ¶
type WorkspaceProviderConfig ¶
type WorkspaceProviderConfig struct {
// Name is the provider name
Name string `json:"name,omitempty"`
// Options are the local options that override the global ones
Options map[string]config.OptionValue `json:"options,omitempty"`
}
type WorkspaceSource ¶
type WorkspaceSource struct {
// GitRepository is the repository to clone
GitRepository string `json:"gitRepository,omitempty"`
// GitBranch is the branch to use
GitBranch string `json:"gitBranch,omitempty"`
// GitCommit is the commit SHA to checkout
GitCommit string `json:"gitCommit,omitempty"`
// GitPRReference is the pull request reference to checkout
GitPRReference string `json:"gitPRReference,omitempty"`
// GitSubPath is the subpath in the repo to use
GitSubPath string `json:"gitSubDir,omitempty"`
// LocalFolder is the local folder to use
LocalFolder string `json:"localFolder,omitempty"`
// Image is the docker image to use
Image string `json:"image,omitempty"`
// Container is the container to use
Container string `json:"container,omitempty"`
// Snapshot is the snapshot ref to restore from (registry/repo:tag)
Snapshot string `json:"snapshot,omitempty"`
}
func ParseWorkspaceSource ¶
func ParseWorkspaceSource(source string) *WorkspaceSource
func (WorkspaceSource) String ¶
func (w WorkspaceSource) String() string
func (WorkspaceSource) Type ¶
func (w WorkspaceSource) Type() string
Source Files
¶
- atomic.go
- atomic_posix.go
- dir.go
- download.go
- env.go
- export.go
- external.go
- external_unix.go
- initlock.go
- machine.go
- move.go
- operationlock.go
- parse.go
- persist.go
- pro.go
- provider.go
- resolve.go
- update_archive.go
- update_destination.go
- update_stat.go
- version_cache.go
- versions.go
- versions_github.go
- versions_manifest.go
- workspace.go