bootstrap: fallback to default known_hosts

Use default known_hosts and ssh configuration when no private key file
is provided while bootstraping using ssh.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
This commit is contained in:
Sanskar Jaiswal
2022-12-06 17:36:28 +05:30
parent f4d898cb92
commit 28feb8b1d7
6 changed files with 28 additions and 22 deletions

View File

@ -169,14 +169,15 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
}
defer os.RemoveAll(tmpDir)
clientOpts := []gogit.ClientOption{gogit.WithDiskStorage(), gogit.WithFallbackToDefaultKnownHosts()}
gitClient, err := gogit.NewClient(tmpDir, &git.AuthOptions{
Transport: git.HTTPS,
Username: githubArgs.owner,
Password: ghToken,
CAFile: caBundle,
})
}, clientOpts...)
if err != nil {
return err
return fmt.Errorf("failed to create a Git client: %w", err)
}
// Install manifest config