Browse Source

pref: 优化容器编排编辑逻辑 (#5556)

pull/5561/head
ssongliu 5 months ago committed by GitHub
parent
commit
6e191fc342
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      backend/app/service/container_compose.go

6
backend/app/service/container_compose.go

@ -232,12 +232,6 @@ func (u *ContainerService) ComposeUpdate(req dto.ComposeUpdate) error {
write.Flush() write.Flush()
global.LOG.Infof("docker-compose.yml %s has been replaced, now start to docker-compose restart", req.Path) global.LOG.Infof("docker-compose.yml %s has been replaced, now start to docker-compose restart", req.Path)
if stdout, err := compose.Down(req.Path); err != nil {
if err := recreateCompose(string(oldFile), req.Path); err != nil {
return fmt.Errorf("update failed when handle compose down, err: %s, recreate failed: %v", string(stdout), err)
}
return fmt.Errorf("update failed when handle compose down, err: %s", string(stdout))
}
if stdout, err := compose.Up(req.Path); err != nil { if stdout, err := compose.Up(req.Path); err != nil {
if err := recreateCompose(string(oldFile), req.Path); err != nil { if err := recreateCompose(string(oldFile), req.Path); err != nil {
return fmt.Errorf("update failed when handle compose up, err: %s, recreate failed: %v", string(stdout), err) return fmt.Errorf("update failed when handle compose up, err: %s, recreate failed: %v", string(stdout), err)

Loading…
Cancel
Save