Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a79d81989f | ||
|
|
655f578563 |
@@ -382,15 +382,15 @@ func (rc *RunContext) startJobContainer() common.Executor {
|
|||||||
if err := rc.stopServiceContainers()(ctx); err != nil {
|
if err := rc.stopServiceContainers()(ctx); err != nil {
|
||||||
logger.Errorf("Error while cleaning services: %v", err)
|
logger.Errorf("Error while cleaning services: %v", err)
|
||||||
}
|
}
|
||||||
if createAndDeleteNetwork {
|
}
|
||||||
// clean network if it has been created by act
|
if createAndDeleteNetwork {
|
||||||
// if using service containers
|
// clean network if it has been created by act
|
||||||
// it means that the network to which containers are connecting is created by `act_runner`,
|
// if using service containers
|
||||||
// so, we should remove the network at last.
|
// it means that the network to which containers are connecting is created by `act_runner`,
|
||||||
logger.Infof("Cleaning up network for job %s, and network name is: %s", rc.JobName, networkName)
|
// so, we should remove the network at last.
|
||||||
if err := container.NewDockerNetworkRemoveExecutor(networkName)(ctx); err != nil {
|
logger.Infof("Cleaning up network for job %s, and network name is: %s", rc.JobName, networkName)
|
||||||
logger.Errorf("Error while cleaning network: %v", err)
|
if err := container.NewDockerNetworkRemoveExecutor(networkName)(ctx); err != nil {
|
||||||
}
|
logger.Errorf("Error while cleaning network: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -410,8 +410,8 @@ func (rc *RunContext) startJobContainer() common.Executor {
|
|||||||
jobContainerNetwork = networkName
|
jobContainerNetwork = networkName
|
||||||
|
|
||||||
rc.JobContainer = container.NewContainer(&container.NewContainerInput{
|
rc.JobContainer = container.NewContainer(&container.NewContainerInput{
|
||||||
Cmd: nil,
|
Cmd: []string{"/bin/sleep", fmt.Sprint(rc.Config.ContainerMaxLifetime.Round(time.Second).Seconds())},
|
||||||
Entrypoint: []string{"/bin/sleep", fmt.Sprint(rc.Config.ContainerMaxLifetime.Round(time.Second).Seconds())},
|
Entrypoint: nil,
|
||||||
WorkingDir: ext.ToContainerPath(rc.Config.Workdir),
|
WorkingDir: ext.ToContainerPath(rc.Config.Workdir),
|
||||||
Image: image,
|
Image: image,
|
||||||
Username: username,
|
Username: username,
|
||||||
|
|||||||
Reference in New Issue
Block a user