Skip to content

Commit

Permalink
adds automatic browser open (#622)
Browse files Browse the repository at this point in the history
* adds automatic browser open

* adds argo workflows port forward
  • Loading branch information
jarededwards authored Oct 26, 2022
1 parent a6d4107 commit 376606f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 0 additions & 1 deletion cmd/createGithubK3d.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ var createGithubK3dCmd = &cobra.Command{
//* vault in running state
executionControl = viper.GetBool("vault.status.running")
if !executionControl {
// TODO: K3D => We need to check what changes for vault on raft mode, without terraform to unseal it
informUser("Waiting for vault to be ready", globalFlags.SilentMode)
waitVaultToBeRunning(globalFlags.DryRun)
if err != nil {
Expand Down
13 changes: 11 additions & 2 deletions cmd/postInstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package cmd

import (
"fmt"
"github.com/kubefirst/kubefirst/internal/k8s"
"log"
"net/http"
"runtime"
"sync"
"time"

"github.com/kubefirst/kubefirst/internal/k8s"

"github.com/kubefirst/kubefirst/internal/flagset"
"github.com/kubefirst/kubefirst/internal/reports"

Expand Down Expand Up @@ -151,7 +152,15 @@ func isConsoleUIAvailable(url string) error {
func openPortForwardForKubeConConsole() error {

var wg sync.WaitGroup
wg.Add(7)
wg.Add(8)
// argo workflows
go func() {
_, err := k8s.PortForward(false, "argo", "svc/argo-server", "2746:2746")
if err != nil {
log.Println("error opening Argo Workflows port forward")
}
wg.Done()
}()
// argocd
go func() {
_, err := k8s.PortForward(false, "argocd", "svc/argocd-server", "8080:80")
Expand Down
5 changes: 3 additions & 2 deletions internal/handlers/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"log"
"net/http"
"os/exec"
"time"

"github.com/kubefirst/kubefirst/internal/reports"
Expand Down Expand Up @@ -79,8 +80,8 @@ func (handler GitHubHandler) AuthenticateUser() (string, error) {
fmt.Println(reports.StyleMessage(gitHubTokenReport))

// todo add a 10 second countdown to warn browser open
//time.Sleep(8 * time.Second)
//exec.Command("open", "https://github.com/login/device").Start()
time.Sleep(5 * time.Second)
exec.Command("open", "https://github.com/login/device").Start()

// todo: improve the logic for the counter
var gitHubAccessToken string
Expand Down

0 comments on commit 376606f

Please sign in to comment.