(workdir, configFile string)
| 166 | } |
| 167 | |
| 168 | func composeFileExists(workdir, configFile string) bool { |
| 169 | workdir = strings.TrimSpace(workdir) |
| 170 | configFile = strings.TrimSpace(configFile) |
| 171 | if configFile == "" { |
| 172 | return false |
| 173 | } |
| 174 | for _, item := range strings.Split(configFile, ",") { |
| 175 | file := strings.TrimSpace(item) |
| 176 | if file == "" { |
| 177 | continue |
| 178 | } |
| 179 | if !filepath.IsAbs(file) && workdir != "" { |
| 180 | file = filepath.Join(workdir, file) |
| 181 | } |
| 182 | file = filepath.Clean(file) |
| 183 | info, err := os.Stat(file) |
| 184 | if err == nil && !info.IsDir() { |
| 185 | return true |
| 186 | } |
| 187 | } |
| 188 | return false |
| 189 | } |
| 190 | |
| 191 | func (u *ContainerService) TestCompose(req dto.ComposeCreate) (bool, error) { |
| 192 | if cmd.CheckIllegal(req.Path) { |
no test coverage detected