File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ const (
4545
4646 HomeInitEventId = "init-persistent-home"
4747
48- SshAgentStartEventId = "init-ssh-agent"
48+ SshAgentStartEventId = "init-ssh-agent-command "
4949
5050 ServiceAccount = "devworkspace"
5151
Original file line number Diff line number Diff line change 1414package ssh
1515
1616import (
17+ "fmt"
18+
1719 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
1820 "github.com/devfile/devworkspace-operator/pkg/constants"
1921 "github.com/devfile/devworkspace-operator/pkg/library/lifecycle"
@@ -38,20 +40,21 @@ func AddSshAgentPostStartEvent(spec *v1alpha2.DevWorkspaceTemplateSpec) error {
3840 }
3941
4042 _ , mainComponents , err := lifecycle .GetInitContainers (spec .DevWorkspaceTemplateSpecContent )
41- for _ , component := range mainComponents {
43+ for id , component := range mainComponents {
4244 if component .Container == nil {
4345 continue
4446 }
47+ commandId := fmt .Sprintf ("%s-%d" , constants .SshAgentStartEventId , id )
4548 spec .Commands = append (spec .Commands , v1alpha2.Command {
46- Id : constants . SshAgentStartEventId ,
49+ Id : commandId ,
4750 CommandUnion : v1alpha2.CommandUnion {
4851 Exec : & v1alpha2.ExecCommand {
4952 CommandLine : commandLine ,
5053 Component : component .Name ,
5154 },
5255 },
5356 })
57+ spec .Events .PostStart = append (spec .Events .PostStart , commandId )
5458 }
55- spec .Events .PostStart = append (spec .Events .PostStart , constants .SshAgentStartEventId )
5659 return err
5760}
You can’t perform that action at this time.
0 commit comments