From 7d776fe03b88c483910040f0633935018cb53552 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 17 Jun 2026 14:52:19 +0200 Subject: [PATCH] fix(home): skip persistent home init container for ephemeral workspaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a DevWorkspaceOperatorConfig defines an init-persistent-home entry in workspace.initContainers, the config merge logic only checked whether persistent home was globally enabled (PersistUserHomeEnabled) but not whether the specific workspace actually needs it. Ephemeral workspaces passed this check, causing an init container to be injected that references a non-existent persistent-home volume and potentially has no image — resulting in an invalid Deployment. Add a NeedsPersistentHomeDirectory check to also skip the config-level init container when the workspace storage strategy does not support home persistence (e.g. ephemeral storage). Fixes: https://github.com/eclipse-che/che/issues/23884 Assisted-by: Claude Code Co-Authored-By: Claude Opus 4.6 Signed-off-by: Anatolii Bazko --- controllers/workspace/devworkspace_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controllers/workspace/devworkspace_controller.go b/controllers/workspace/devworkspace_controller.go index 6a25994da..be28dc79b 100644 --- a/controllers/workspace/devworkspace_controller.go +++ b/controllers/workspace/devworkspace_controller.go @@ -417,6 +417,11 @@ func (r *DevWorkspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request reqLogger.Info("Skipping init-persistent-home container: persistent home is disabled") continue } + // Skip if workspace does not need persistent home (e.g. ephemeral storage) + if !home.NeedsPersistentHomeDirectory(workspace) { + reqLogger.Info("Skipping init-persistent-home container: workspace does not need persistent home directory") + continue + } // Skip if init container is explicitly disabled if disableHomeInit { reqLogger.Info("Skipping init-persistent-home container: DisableInitContainer is true")