Skip to content

Commit 4ec1a35

Browse files
committed
fix
1 parent 563dc11 commit 4ec1a35

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/controller/codeserver_controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,11 @@ func (r *CodeServerReconciler) reconcileDeployment(ctx context.Context, codeServ
288288
)
289289
}
290290

291-
command := fmt.Sprintf("%s && /usr/bin/entrypoint.sh --bind-addr 0.0.0.0:%d", codeServer.Spec.InitCommand, codeServer.Spec.ContainerPort)
291+
command := fmt.Sprintf("/usr/bin/entrypoint.sh --bind-addr 0.0.0.0:%d", codeServer.Spec.ContainerPort)
292+
if codeServer.Spec.InitCommand != "" {
293+
command = fmt.Sprintf("%s && %s", codeServer.Spec.InitCommand, command)
294+
}
295+
292296
if _, ok := codeServer.Spec.InitPlugins["git"]; ok {
293297
command = fmt.Sprintf("%s /home/coder/work", command)
294298
}

0 commit comments

Comments
 (0)