From 2da5d336ff091d9d1dcb1b22740bc7208dfa916d Mon Sep 17 00:00:00 2001 From: Scott Hawkins Date: Fri, 30 Jun 2023 21:35:00 -0400 Subject: [PATCH] fix: fix k3d git final push and port forward issue (#1669) --- cmd/k3d/create.go | 11 +++++++---- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cmd/k3d/create.go b/cmd/k3d/create.go index 302cf471d..4f26eaecc 100644 --- a/cmd/k3d/create.go +++ b/cmd/k3d/create.go @@ -23,7 +23,7 @@ import ( argocdapi "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned" "github.com/go-git/go-git/v5" githttps "github.com/go-git/go-git/v5/plumbing/transport/http" - gitssh "github.com/go-git/go-git/v5/plumbing/transport/ssh" + "github.com/go-git/go-git/v5/plumbing/transport/ssh" "github.com/kubefirst/kubefirst/internal/gitShim" "github.com/kubefirst/kubefirst/internal/telemetryShim" "github.com/kubefirst/kubefirst/internal/utilities" @@ -471,6 +471,12 @@ func runK3d(cmd *cobra.Command, args []string) error { telemetryShim.Transmit(useTelemetryFlag, segmentClient, segment.MetricInitCompleted, "") telemetryShim.Transmit(useTelemetryFlag, segmentClient, segment.MetricClusterInstallStarted, "") + //* generate public keys for ssh + publicKeys, err := ssh.NewPublicKeys("git", []byte(viper.GetString("kbot.private-key")), "") + if err != nil { + log.Info().Msgf("generate public keys failed: %s\n", err.Error()) + } + gitopsTemplateTokens := k3d.GitopsTokenValues{ GithubOwner: cGitOwner, GithubUser: cGitUser, @@ -508,9 +514,6 @@ func runK3d(cmd *cobra.Command, args []string) error { gitopsTemplateTokens.UseTelemetry = "false" } - //* generate public keys for ssh - publicKeys, err := gitssh.NewPublicKeys("git", []byte(viper.GetString("kbot.private-key")), "") - //* generate http credentials for git auth over https httpAuth := &githttps.BasicAuth{ Username: cGitUser, diff --git a/go.mod b/go.mod index 5a5e81ae8..852ce9b8b 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/dustin/go-humanize v1.0.1 github.com/go-git/go-git/v5 v5.6.1 github.com/hashicorp/vault/api v1.9.0 - github.com/kubefirst/runtime v0.1.73 + github.com/kubefirst/runtime v0.1.74 github.com/rs/zerolog v1.29.0 github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.7.0 diff --git a/go.sum b/go.sum index 8af5d40c2..a51a6a6aa 100644 --- a/go.sum +++ b/go.sum @@ -711,8 +711,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubefirst/runtime v0.1.73 h1:7Twp48ukpejM/56dc+8EItEVSof4hjeVLCUaMfGfOQ8= -github.com/kubefirst/runtime v0.1.73/go.mod h1:hbV3BuyzKp7hgMDLYQCuXFMn5ERl9pzqiotDDpRrLhc= +github.com/kubefirst/runtime v0.1.74 h1:4r8l8WnK8peXGSV3snwY+rZiVeVnGeUtCbPGCtklXT0= +github.com/kubefirst/runtime v0.1.74/go.mod h1:hbV3BuyzKp7hgMDLYQCuXFMn5ERl9pzqiotDDpRrLhc= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80 h1:6Yzfa6GP0rIo/kULo2bwGEkFvCePZ3qHDDTC3/J9Swo=