diff --git a/controllers/workspace/devworkspace_controller.go b/controllers/workspace/devworkspace_controller.go index 712243390..5be786163 100644 --- a/controllers/workspace/devworkspace_controller.go +++ b/controllers/workspace/devworkspace_controller.go @@ -281,9 +281,12 @@ func (r *DevWorkspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request } workspace.Spec.Template = *flattenedWorkspace - err = ssh.AddSshAgentPostStartEvent(&workspace.Spec.Template) - if err != nil { - return r.failWorkspace(workspace, "Failed to add ssh-agent post start event", metrics.ReasonWorkspaceEngineFailure, reqLogger, &reconcileStatus), nil + // Include to experimental features list because it is not clear how to handle post start events in containers without sh. + if *workspace.Config.EnableExperimentalFeatures { + err = ssh.AddSshAgentPostStartEvent(&workspace.Spec.Template) + if err != nil { + return r.failWorkspace(workspace, "Failed to add ssh-agent post start event", metrics.ReasonWorkspaceEngineFailure, reqLogger, &reconcileStatus), nil + } } reconcileStatus.setConditionTrue(conditions.DevWorkspaceResolved, "Resolved plugins and parents from DevWorkspace") diff --git a/docs/additional-configuration.adoc b/docs/additional-configuration.adoc index 113ba1003..39dad6bd6 100644 --- a/docs/additional-configuration.adoc +++ b/docs/additional-configuration.adoc @@ -225,6 +225,7 @@ you must add the following in your `~/.bashrc`: ---- [ -f $HOME/ssh-environment ] && source $HOME/ssh-environment ---- +*Note:* This is an experimental feature and is controlled by the `DevWorkspaceOperatorConfig.EnableExperimentalFeatures` option. 3. Annotate the secret to configure automatic mounting to DevWorkspaces +