• ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/agent/DockerExecutorUtils.java
    skipped 238 lines
    239 239   for (Map.Entry<CacheInstance, String> entry: cacheAllocations.entrySet()) {
    240 240   if (!PathUtils.isCurrent(entry.getValue())) {
    241 241   String hostCachePath = entry.getKey().getDirectory(hostCacheHome).getAbsolutePath();
    242  - for (String each: KubernetesHelper.resolveCachePath(containerWorkspace, entry.getValue()))
    243  - docker.addArgs("-v", hostCachePath + ":" + each);
     242 + String containerCachePath = PathUtils.resolve(containerWorkspace, entry.getValue());
     243 + docker.addArgs("-v", hostCachePath + ":" + containerCachePath);
    244 244   }
    245 245   }
    246 246  
    skipped 608 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/agent/ShellExecutorUtils.java
    skipped 326 lines
    327 327   }
    328 328  
    329 329   public static File resolveCachePath(File workspaceDir, String cachePath) {
    330  - if (cachePath.startsWith(KubernetesHelper.HOME_PREFIX)) {
    331  - File homeDir = new File(System.getProperty("user.home"));
    332  - return new File(homeDir, cachePath.substring(KubernetesHelper.HOME_PREFIX.length()));
    333  - } else {
    334  - File cacheDir = new File(cachePath);
    335  - if (cacheDir.isAbsolute())
    336  - throw new ExplicitException("Shell executor does not support absolute cache path: " + cachePath);
    337  - else
    338  - return new File(workspaceDir, cachePath);
    339  - }
     330 + File cacheDir = new File(cachePath);
     331 + if (cacheDir.isAbsolute())
     332 + throw new ExplicitException("Shell executor does not support absolute cache path: " + cachePath);
     333 + else
     334 + return new File(workspaceDir, cachePath);
    340 335   }
    341 336  
    342 337   public static void testCommands(Commandline git, List<String> commands, TaskLogger jobLogger) {
    skipped 56 lines
Please wait...
Page is in error, reload to recover