Skip to content

Commit 280c303

Browse files
committed
feat(config): make home directory mount point configurable
Adds HomeDirMountBase to BaseConfig, allowing the host path prefix for per-developer home and linuxbrew volumes to be configured rather than being hardcoded to /mnt/devenv in the StatefulSet template. Defaults to /mnt/devenv to preserve existing behavior. Also removes stray trailing whitespace from the StatefulSet golden file.
1 parent c0226fa commit 280c303

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

internal/config/types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ type BaseConfig struct {
2222

2323
// Storage configuration
2424
Volumes []VolumeMount `yaml:"volumes,omitempty" validate:"dive"`
25+
// HomeDirMountBase is the host path prefix under which per-developer home
26+
// and linuxbrew volumes are created (e.g. /mnt/devenv → /mnt/devenv/<name>/homedir).
27+
HomeDirMountBase string `yaml:"homeDirMountBase,omitempty" validate:"omitempty,mount_path"`
2528

2629
// Access configuration
2730
SSHPublicKey any `yaml:"sshPublicKey,omitempty" validate:"omitempty,ssh_keys"` // Can be string or []string
@@ -128,6 +131,7 @@ func NewBaseConfigWithDefaults() BaseConfig {
128131
},
129132
GitRepos: []GitRepo{}, // Empty slice - no default git repositories
130133
Volumes: []VolumeMount{}, // Empty slice - no default volumes
134+
HomeDirMountBase: "/mnt/devenv", // Default host path prefix for home/linuxbrew volumes
131135
Namespace: "devenv", // Default namespace
132136
EnvironmentName: "development", // Default environment name
133137
}

internal/templates/renderer_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func TestRenderTemplate(t *testing.T) {
2828
Image: "ubuntu:22.04",
2929
Namespace: "devenv-test",
3030
HostName: "devenv.example.com",
31+
HomeDirMountBase: "/mnt/devenv",
3132
Packages: config.PackageConfig{
3233
Python: []string{"numpy", "pandas"},
3334
APT: []string{"vim", "curl"},

internal/templates/template_files/dev/manifests/statefulset.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ spec:
113113
volumes:
114114
- name: dev-storage
115115
hostPath:
116-
path: /mnt/devenv/{{.Name}}/homedir
116+
path: {{.HomeDirMountBase}}/{{.Name}}/homedir
117117
type: DirectoryOrCreate
118118
- name: dev-linuxbrew
119119
hostPath:
120-
path: /mnt/devenv/{{.Name}}/linuxbrew
120+
path: {{.HomeDirMountBase}}/{{.Name}}/linuxbrew
121121
type: DirectoryOrCreate
122122
- name: startup-scripts
123123
configMap:

internal/templates/testdata/golden/statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ spec:
9494
type: DirectoryOrCreate
9595
- name: dev-linuxbrew
9696
hostPath:
97-
path: /mnt/devenv/testuser/linuxbrew
97+
path: /mnt/devenv/testuser/linuxbrew
9898
type: DirectoryOrCreate
9999
- name: startup-scripts
100100
configMap:

0 commit comments

Comments
 (0)