mirror of
https://github.com/fluxcd/flux2.git
synced 2026-04-19 02:05:43 +00:00
Add caBundle to bitbucket
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
This commit is contained in:
parent
43c6a1531a
commit
a03574f8c3
2 changed files with 14 additions and 0 deletions
|
|
@ -141,12 +141,22 @@ func bootstrapBServerCmdRun(cmd *cobra.Command, args []string) error {
|
|||
user = bServerArgs.owner
|
||||
}
|
||||
|
||||
var caBundle []byte
|
||||
if bootstrapArgs.caFile != "" {
|
||||
var err error
|
||||
caBundle, err = os.ReadFile(bootstrapArgs.caFile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to read TLS CA file: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Build Bitbucket Server provider
|
||||
providerCfg := provider.Config{
|
||||
Provider: provider.GitProviderStash,
|
||||
Hostname: bServerArgs.hostname,
|
||||
Username: user,
|
||||
Token: bitbucketToken,
|
||||
CaBundle: caBundle,
|
||||
}
|
||||
|
||||
providerClient, err := provider.BuildGitProvider(providerCfg)
|
||||
|
|
@ -243,6 +253,7 @@ func bootstrapBServerCmdRun(cmd *cobra.Command, args []string) error {
|
|||
bootstrap.WithReadWriteKeyPermissions(bServerArgs.readWriteKey),
|
||||
bootstrap.WithKubeconfig(rootArgs.kubeconfig, rootArgs.kubecontext),
|
||||
bootstrap.WithLogger(logger),
|
||||
bootstrap.WithCABundle(caBundle),
|
||||
}
|
||||
if bootstrapArgs.sshHostname != "" {
|
||||
bootstrapOpts = append(bootstrapOpts, bootstrap.WithSSHHostname(bootstrapArgs.sshHostname))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue