mirror of
				https://github.com/fluxcd/flux2.git
				synced 2025-10-31 16:26:36 +08:00 
			
		
		
		
	Remove file reading from bootstrap package
Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
		| @ -204,16 +204,13 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error { | ||||
| 	if bootstrapArgs.tokenAuth { | ||||
| 		secretOpts.Username = "git" | ||||
| 		secretOpts.Password = ghToken | ||||
|  | ||||
| 		if bootstrapArgs.caFile != "" { | ||||
| 			secretOpts.CAFilePath = bootstrapArgs.caFile | ||||
| 		} | ||||
| 		secretOpts.CAFile = caBundle | ||||
| 	} else { | ||||
| 		secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(bootstrapArgs.keyAlgorithm) | ||||
| 		secretOpts.RSAKeyBits = int(bootstrapArgs.keyRSABits) | ||||
| 		secretOpts.ECDSACurve = bootstrapArgs.keyECDSACurve.Curve | ||||
| 		secretOpts.SSHHostname = githubArgs.hostname | ||||
|  | ||||
| 		secretOpts.SSHHostname = githubArgs.hostname | ||||
| 		if bootstrapArgs.sshHostname != "" { | ||||
| 			secretOpts.SSHHostname = bootstrapArgs.sshHostname | ||||
| 		} | ||||
| @ -232,6 +229,11 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error { | ||||
| 		RecurseSubmodules: bootstrapArgs.recurseSubmodules, | ||||
| 	} | ||||
|  | ||||
| 	entityList, err := bootstrap.LoadEntityListFromPath(bootstrapArgs.gpgKeyRingPath) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// Bootstrap config | ||||
| 	bootstrapOpts := []bootstrap.GitProviderOption{ | ||||
| 		bootstrap.WithProviderRepository(githubArgs.owner, githubArgs.repository, githubArgs.personal), | ||||
| @ -244,7 +246,7 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error { | ||||
| 		bootstrap.WithKubeconfig(kubeconfigArgs, kubeclientOptions), | ||||
| 		bootstrap.WithLogger(logger), | ||||
| 		bootstrap.WithCABundle(caBundle), | ||||
| 		bootstrap.WithGitCommitSigning(bootstrapArgs.gpgKeyRingPath, bootstrapArgs.gpgPassphrase, bootstrapArgs.gpgKeyID), | ||||
| 		bootstrap.WithGitCommitSigning(entityList, bootstrapArgs.gpgPassphrase, bootstrapArgs.gpgKeyID), | ||||
| 	} | ||||
| 	if bootstrapArgs.sshHostname != "" { | ||||
| 		bootstrapOpts = append(bootstrapOpts, bootstrap.WithSSHHostname(bootstrapArgs.sshHostname)) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Philip Laine
					Philip Laine