mirror of
				https://github.com/fluxcd/flux2.git
				synced 2025-10-31 08:17:19 +08:00 
			
		
		
		
	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:
		| @ -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 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Sanskar Jaiswal
					Sanskar Jaiswal