diff --git a/controllers/devbox/api/v1alpha1/runtime_types.go b/controllers/devbox/api/v1alpha1/runtime_types.go index cf333960a37..436e94bb269 100644 --- a/controllers/devbox/api/v1alpha1/runtime_types.go +++ b/controllers/devbox/api/v1alpha1/runtime_types.go @@ -39,10 +39,18 @@ type Config struct { // kubebuilder:validation:Optional Args []string `json:"args,omitempty"` // +kubebuilder:validation:Optional + // +kubebuilder:default=/home/sealos/project WorkingDir string `json:"workingDir,omitempty"` // +kubebuilder:validation:Optional Env []corev1.EnvVar `json:"env,omitempty"` + // +kubebuilder:validation:Optional + // +kubebuilder:default={/bin/bash,-c} + ReleaseCommand []string `json:"releaseCommand,omitempty"` + // +kubebuilder:validation:Optional + // +kubebuilder:default={/home/sealos/project/entrypoint.sh} + ReleaseArgs []string `json:"releaseArgs,omitempty"` + // +kubebuilder:validation:Optional // +kubebuilder:default={{name:"devbox-ssh-port",containerPort:22,protocol:TCP}} Ports []corev1.ContainerPort `json:"ports,omitempty"` diff --git a/controllers/devbox/config/crd/bases/devbox.sealos.io_runtimes.yaml b/controllers/devbox/config/crd/bases/devbox.sealos.io_runtimes.yaml index 369a069ad04..0ed11827a4a 100644 --- a/controllers/devbox/config/crd/bases/devbox.sealos.io_runtimes.yaml +++ b/controllers/devbox/config/crd/bases/devbox.sealos.io_runtimes.yaml @@ -247,6 +247,19 @@ spec: - containerPort type: object type: array + releaseArgs: + default: + - /home/sealos/project/entrypoint.sh + items: + type: string + type: array + releaseCommand: + default: + - /bin/bash + - -c + items: + type: string + type: array user: default: sealos type: string @@ -1902,6 +1915,7 @@ spec: type: object type: array workingDir: + default: /home/sealos/project type: string required: - image diff --git a/controllers/devbox/config/samples/devbox_v1alpha1_runtime.yaml b/controllers/devbox/config/samples/devbox_v1alpha1_runtime.yaml index c137eddb342..1b34a17b207 100644 --- a/controllers/devbox/config/samples/devbox_v1alpha1_runtime.yaml +++ b/controllers/devbox/config/samples/devbox_v1alpha1_runtime.yaml @@ -23,6 +23,12 @@ spec: description: go1.22.5 config: image: ghcr.io/cbluebird/devbox/go1.22.5:2f4067 + workingDir: /home/sealos/project + releaseCommand: + - /bin/bash + - -c + releaseArgs: + - /home/sealos/project/entrypoint.sh category: - ubuntu - go diff --git a/controllers/devbox/deploy/manifests/deploy.yaml.tmpl b/controllers/devbox/deploy/manifests/deploy.yaml.tmpl index ced102d183b..6a23b3346cc 100644 --- a/controllers/devbox/deploy/manifests/deploy.yaml.tmpl +++ b/controllers/devbox/deploy/manifests/deploy.yaml.tmpl @@ -3230,6 +3230,19 @@ spec: - containerPort type: object type: array + releaseArgs: + default: + - /home/sealos/project/entrypoint.sh + items: + type: string + type: array + releaseCommand: + default: + - /bin/bash + - -c + items: + type: string + type: array user: default: sealos type: string @@ -4885,6 +4898,7 @@ spec: type: object type: array workingDir: + default: /home/sealos/project type: string required: - image