(composeCtx *composeBackupContext)
| 172 | } |
| 173 | |
| 174 | func loadComposeContainerNames(composeCtx *composeBackupContext) ([]string, error) { |
| 175 | options := container.ListOptions{All: true} |
| 176 | options.Filters = filters.NewArgs(filters.Arg("label", composeProjectLabel+"="+composeCtx.composeName)) |
| 177 | containers, err := composeCtx.dockerClient.ContainerList(context.Background(), options) |
| 178 | if err != nil { |
| 179 | return nil, err |
| 180 | } |
| 181 | names := make([]string, 0, len(containers)) |
| 182 | for _, item := range containers { |
| 183 | if len(item.Names) == 0 { |
| 184 | continue |
| 185 | } |
| 186 | names = append(names, strings.TrimPrefix(item.Names[0], "/")) |
| 187 | } |
| 188 | sort.Strings(names) |
| 189 | return names, nil |
| 190 | } |
| 191 | |
| 192 | func handleComposeRecover(req dto.CommonRecover, parentTask *task.Task) error { |
| 193 | var recoverCtx *composeRecoverContext |
no outgoing calls
no test coverage detected