mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-22 15:41:47 +00:00
Merge pull request #455 from fluxcd/fix-gh-https
Fix GitHub bootstrap with token auth
This commit is contained in:
commit
16761e4fca
1 changed files with 4 additions and 1 deletions
|
|
@ -212,6 +212,8 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
logger.Successf("install completed")
|
logger.Successf("install completed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
repoURL := repository.GetURL()
|
||||||
|
|
||||||
if bootstrapTokenAuth {
|
if bootstrapTokenAuth {
|
||||||
// setup HTTPS token auth
|
// setup HTTPS token auth
|
||||||
secret := corev1.Secret{
|
secret := corev1.Secret{
|
||||||
|
|
@ -229,6 +231,7 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// setup SSH deploy key
|
// setup SSH deploy key
|
||||||
|
repoURL = repository.GetSSH()
|
||||||
if shouldCreateDeployKey(ctx, kubeClient, namespace) {
|
if shouldCreateDeployKey(ctx, kubeClient, namespace) {
|
||||||
logger.Actionf("configuring deploy key")
|
logger.Actionf("configuring deploy key")
|
||||||
u, err := url.Parse(repository.GetSSH())
|
u, err := url.Parse(repository.GetSSH())
|
||||||
|
|
@ -256,7 +259,7 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
|
|
||||||
// configure repo synchronization
|
// configure repo synchronization
|
||||||
logger.Actionf("generating sync manifests")
|
logger.Actionf("generating sync manifests")
|
||||||
if err := generateSyncManifests(repository.GetSSH(), bootstrapBranch, namespace, namespace, ghPath, tmpDir, ghInterval); err != nil {
|
if err := generateSyncManifests(repoURL, bootstrapBranch, namespace, namespace, ghPath, tmpDir, ghInterval); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue