Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■
    pom.xml
    skipped 9 lines
    10 10   <version>1.0.5</version>
    11 11   </parent>
    12 12   <artifactId>k8s-helper</artifactId>
    13  - <version>2.1.8</version>
     13 + <version>2.1.9</version>
    14 14   <build>
    15 15   <plugins>
    16 16   <plugin>
    skipped 74 lines
  • ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/SshCloneInfo.java
    skipped 28 lines
    29 29   public void writeAuthData(File homeDir, Commandline git, LineConsumer infoLogger, LineConsumer errorLogger) {
    30 30   File sshDir = new File(homeDir, ".ssh");
    31 31   FileUtils.createDir(sshDir);
    32  - FileUtils.writeFile(new File(sshDir, "id_rsa"), privateKey);
     32 +
     33 + File privateKeyFile = new File(sshDir, "id_rsa");
     34 + FileUtils.writeFile(privateKeyFile, privateKey);
     35 + File knownHostsFile = new File(sshDir, "known_hosts");
     36 + FileUtils.writeFile(knownHostsFile, knownHosts);
    33 37   if (!SystemUtils.IS_OS_WINDOWS) {
    34 38   Commandline chmod = new Commandline("chmod");
    35 39   chmod.workingDir(sshDir).addArgs("400", "id_rsa");
    36 40   chmod.execute(infoLogger, errorLogger).checkReturnCode();
     41 +
     42 + git.clearArgs();
     43 + git.addArgs("config", "--global", "core.sshCommand", "ssh -i \"" + privateKeyFile.getAbsolutePath() + "\" -o UserKnownHostsFile=\"" + knownHostsFile.getAbsolutePath() + "\" -F /dev/null");
     44 + git.execute(infoLogger, errorLogger).checkReturnCode();
    37 45   }
    38  - FileUtils.writeFile(new File(sshDir, "known_hosts"), knownHosts);
    39 46   }
    40 47   
    41 48   @Override
    skipped 9 lines
Please wait...
Page is in error, reload to recover