From c8142cc4d10bfed267a5af44fb2baf580bdfb50f Mon Sep 17 00:00:00 2001 From: Anton Kosyakov Date: Tue, 17 Jan 2023 11:13:25 +0000 Subject: [PATCH] initial --- components/gitpod-cli/cmd/rebuild.go | 219 +++++++++++++++--- components/gitpod-cli/go.mod | 22 +- components/gitpod-cli/go.sum | 77 +++++- .../gitpod-cli/pkg/supervisor/client.go | 16 +- components/supervisor/cmd/debug-env.go | 51 ++++ components/supervisor/cmd/debug-proxy.go | 56 +++++ components/supervisor/cmd/init.go | 10 + components/ws-daemon/pkg/iws/iws.go | 2 +- components/ws-proxy/pkg/proxy/config.go | 10 +- components/ws-proxy/pkg/proxy/routes.go | 14 +- components/ws-proxy/pkg/proxy/routes_test.go | 26 ++- .../ws-proxy/pkg/proxy/workspacerouter.go | 20 +- .../testdata/render/aws-setup/output.golden | 3 +- .../testdata/render/azure-setup/output.golden | 3 +- .../custom-pull-repository/output.golden | 3 +- .../render/customization/output.golden | 3 +- .../render/external-registry/output.golden | 3 +- .../testdata/render/gcp-setup/output.golden | 3 +- .../testdata/render/http-proxy/output.golden | 3 +- .../render/kind-workspace/output.golden | 3 +- .../cmd/testdata/render/minimal/output.golden | 3 +- .../testdata/render/shortname/output.golden | 3 +- .../statefulset-customization/output.golden | 3 +- .../use-pod-security-policies/output.golden | 3 +- .../render/vsxproxy-pvc/output.golden | 3 +- .../workspace-requests-limits/output.golden | 3 +- .../pkg/components/workspace/constants.go | 1 + .../pkg/components/ws-proxy/configmap.go | 11 +- 28 files changed, 480 insertions(+), 97 deletions(-) create mode 100644 components/supervisor/cmd/debug-env.go create mode 100644 components/supervisor/cmd/debug-proxy.go diff --git a/components/gitpod-cli/cmd/rebuild.go b/components/gitpod-cli/cmd/rebuild.go index e6d26514cef9f4..7ad2b8c5efe0ba 100644 --- a/components/gitpod-cli/cmd/rebuild.go +++ b/components/gitpod-cli/cmd/rebuild.go @@ -5,18 +5,27 @@ package cmd import ( + "bufio" "context" + "encoding/json" "fmt" + "io" + "net/url" "os" "os/exec" "path/filepath" "strings" "time" + "github.com/gitpod-io/gitpod/common-go/log" "github.com/gitpod-io/gitpod/gitpod-cli/pkg/supervisor" "github.com/gitpod-io/gitpod/gitpod-cli/pkg/utils" "github.com/gitpod-io/gitpod/supervisor/api" + "github.com/sirupsen/logrus" "github.com/spf13/cobra" + + supervisorapi "github.com/gitpod-io/gitpod/supervisor/api" + prefixed "github.com/x-cray/logrus-prefixed-formatter" ) func TerminateExistingContainer() error { @@ -54,6 +63,11 @@ func runRebuild(ctx context.Context, supervisorClient *supervisor.SupervisorClie return err } + workspaceLocation := rebuildOpts.Workspace + if workspaceLocation == "" { + workspaceLocation = wsInfo.CheckoutLocation + } + tmpDir, err := os.MkdirTemp("", "gp-rebuild-*") if err != nil { event.Set("ErrorCode", utils.SystemErrorCode) @@ -61,7 +75,7 @@ func runRebuild(ctx context.Context, supervisorClient *supervisor.SupervisorClie } defer os.RemoveAll(tmpDir) - gitpodConfig, err := utils.ParseGitpodConfig(wsInfo.CheckoutLocation) + gitpodConfig, err := utils.ParseGitpodConfig(workspaceLocation) if err != nil { fmt.Println("The .gitpod.yml file cannot be parsed: please check the file and try again") fmt.Println("") @@ -89,7 +103,7 @@ func runRebuild(ctx context.Context, supervisorClient *supervisor.SupervisorClie case string: baseimage = "FROM " + img case map[interface{}]interface{}: - dockerfilePath := filepath.Join(wsInfo.CheckoutLocation, img["file"].(string)) + dockerfilePath := filepath.Join(workspaceLocation, img["file"].(string)) if _, err := os.Stat(dockerfilePath); os.IsNotExist(err) { fmt.Println("Your .gitpod.yml points to a Dockerfile that doesn't exist: " + dockerfilePath) @@ -127,7 +141,8 @@ func runRebuild(ctx context.Context, supervisorClient *supervisor.SupervisorClie return err } - err = os.WriteFile(filepath.Join(tmpDir, "Dockerfile"), []byte(baseimage), 0644) + dockerFile := filepath.Join(tmpDir, "Dockerfile") + err = os.WriteFile(dockerFile, []byte(baseimage), 0644) if err != nil { fmt.Println("Could not write the temporary Dockerfile") event.Set("ErrorCode", utils.RebuildErrorCode_DockerfileCannotWirte) @@ -141,10 +156,9 @@ func runRebuild(ctx context.Context, supervisorClient *supervisor.SupervisorClie return err } - tag := "gp-rebuild-temp-build" + imageTag := "gp-rebuild-temp-build" - dockerCmd := exec.Command(dockerPath, "build", "-t", tag, "--progress=tty", ".") - dockerCmd.Dir = tmpDir + dockerCmd := exec.Command(dockerPath, "build", "-t", imageTag, "-f", dockerFile, workspaceLocation) dockerCmd.Stdout = os.Stdout dockerCmd.Stderr = os.Stderr @@ -168,47 +182,191 @@ func runRebuild(ctx context.Context, supervisorClient *supervisor.SupervisorClie return err } - messages := []string{ - "\n\nYou are now connected to the container", - "You can inspect the container and make sure the necessary tools & libraries are installed.", - "When you are done, just type exit to return to your Gitpod workspace\n", + workspaceUrl, err := url.Parse(wsInfo.WorkspaceUrl) + if err != nil { + return err } + workspaceUrl.Host = "debug-" + workspaceUrl.Host - welcomeMessage := strings.Join(messages, "\n") + // TODO what about auto derived by server, i.e. JB for prebuilds? we should move them into the workspace then + tasks, err := json.Marshal(gitpodConfig.Tasks) + if err != nil { + return err + } - dockerRunCmd := exec.Command( + // TODO run under sudo - a hack to get tokens properly + supervisorEnvs, err := exec.CommandContext(ctx, "sudo", "/.supervisor/supervisor", "debug-env").CombinedOutput() + if err != nil { + return err + } + + var debugEnvs []string + debugEnvs = append(debugEnvs, "SUPERVISOR_DEBUG_WORKSPACE=true") + debugEnvs = append(debugEnvs, fmt.Sprintf("GITPOD_TASKS=%s", string(tasks))) + // TODO pass prebuild option or gp rebuild prebuild? + debugEnvs = append(debugEnvs, fmt.Sprintf("GITPOD_HEADLESS=%s", "false")) + debugEnvs = append(debugEnvs, fmt.Sprintf("GITPOD_PREVENT_METADATA_ACCESS=%s", "false")) + debugEnvs = append(debugEnvs, fmt.Sprintf("GITPOD_WORKSPACE_URL=%s", workspaceUrl)) + + // TODO project? - should not it be covered by gp env + userEnvs, err := exec.CommandContext(ctx, "gp", "env").CombinedOutput() + if err != nil { + return err + } + + envs := string(supervisorEnvs) + for _, env := range debugEnvs { + envs += env + "\n" + } + envs += string(userEnvs) + + envFile := filepath.Join(tmpDir, ".env") + err = os.WriteFile(envFile, []byte(envs), 0644) + if err != nil { + return err + } + + runCmd := exec.CommandContext( + ctx, dockerPath, "run", "--rm", + "--user", "root", + "--privileged", "--label", "gp-rebuild=true", - "-it", - tag, - "bash", - "-c", - fmt.Sprintf("echo '%s'; bash", welcomeMessage), + "--env-file", envFile, + + // ports + "-p", "24999:22999", // supervisor + "-p", "25000:23000", // Web IDE + "-p", "25001:23001", // SSH + // 23002 dekstop IDE port, but it is covered by debug workspace proxy + "-p", "25003:23003", // debug workspace proxy + + // volumes + "-v", "/workspace:/workspace", + "-v", "/.supervisor:/.supervisor", + "-v", "/var/run/docker.sock:/var/run/docker.sock", + "-v", "/ide:/ide", + "-v", "/ide-desktop:/ide-desktop", + "-v", "/ide-desktop-plugins:/ide-desktop-plugins", // TODO refactor to keep all IDE deps under ide or ide-desktop + + imageTag, + "/.supervisor/supervisor", "init", ) - dockerRunCmd.Stdout = os.Stdout - dockerRunCmd.Stderr = os.Stderr - dockerRunCmd.Stdin = os.Stdin + debugSupervisor, err := supervisor.New(ctx, &supervisor.SupervisorClientOption{ + Address: "localhost:24999", + }) + if err != nil { + return err + } + go func() { + debugSupervisor.WaitForIDEReady(ctx) + if ctx.Err() != nil { + return + } + err := notify(supervisorClient, workspaceUrl.String()) + if err != nil && ctx.Err() == nil { + log.WithError(err).Error("failed to notify") + } + }() + + pipeLogs := func(input io.Reader, output io.Writer) { + pipeLog := log.New() + pipeLog.Logger.SetFormatter(&prefixed.TextFormatter{ + TimestampFormat: "2006-01-02 15:04:05", + FullTimestamp: true, + ForceFormatting: true, + ForceColors: true, + }) + pipeLog.Logger.SetOutput(output) + + reader := bufio.NewReader(input) + for { + line, _, err := reader.ReadLine() + if err != nil { + return + } + msg := make(logrus.Fields) + err = json.Unmarshal(line, &msg) + if err != nil { + pipeLog.Info(string(line)) + } else { + message := fmt.Sprintf("%v", msg["message"]) + level, err := logrus.ParseLevel(fmt.Sprintf("%v", msg["level"])) + if err != nil { + level = logrus.DebugLevel + } + if level == logrus.FatalLevel { + level = logrus.ErrorLevel + } + + delete(msg, "message") + delete(msg, "level") + delete(msg, "file") + delete(msg, "func") + delete(msg, "serviceContext") + delete(msg, "time") + delete(msg, "severity") + delete(msg, "@type") + + pipeLog.WithFields(msg).Log(level, message) + } + } + } + + stdout, err := runCmd.StdoutPipe() + if err != nil { + return err + } + go pipeLogs(stdout, os.Stdout) - err = dockerRunCmd.Run() - if _, ok := err.(*exec.ExitError); ok { - fmt.Println("Docker Run Command Failed") - event.Set("ErrorCode", utils.RebuildErrorCode_DockerRunFailed) + stderr, err := runCmd.StderrPipe() + if err != nil { return err - } else if err != nil { - fmt.Println("Docker error") - event.Set("ErrorCode", utils.RebuildErrorCode_DockerErr) + } + go pipeLogs(stderr, os.Stdout) + + err = runCmd.Start() + if err != nil { + fmt.Println("Docker Run Command Failed") return err } + _ = runCmd.Wait() return nil } -var buildCmd = &cobra.Command{ +func notify(supervisorClient *supervisor.SupervisorClient, workspaceUrl string) error { + response, err := supervisorClient.Notification.Notify(context.Background(), &supervisorapi.NotifyRequest{ + Level: supervisorapi.NotifyRequest_INFO, + Message: fmt.Sprintf("The debug workspace is available on: %s.", workspaceUrl), + Actions: []string{"Open Browser"}, + }) + if err != nil { + return err + } + if response.Action == "Open Browser" { + gpPath, err := exec.LookPath("gp") + if err != nil { + return err + } + gpCmd := exec.Command(gpPath, "preview", "--external", workspaceUrl) + gpCmd.Stdout = os.Stdout + gpCmd.Stderr = os.Stderr + return gpCmd.Run() + } + return nil +} + +var rebuildOpts struct { + Workspace string +} + +var rebuildCmd = &cobra.Command{ Use: "rebuild", - Short: "Re-builds the workspace image (useful to debug a workspace custom image)", + Short: "Re-builds the workspace (useful to debug a workspace configuration)", Hidden: false, Run: func(cmd *cobra.Command, args []string) { ctx := context.Background() @@ -237,5 +395,6 @@ var buildCmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(buildCmd) + rootCmd.AddCommand(rebuildCmd) + rebuildCmd.PersistentFlags().StringVarP(&rebuildOpts.Workspace, "workspace", "w", "", "Path to the workspace directory") } diff --git a/components/gitpod-cli/go.mod b/components/gitpod-cli/go.mod index 38d37d006d1fa9..f59996068108df 100644 --- a/components/gitpod-cli/go.mod +++ b/components/gitpod-cli/go.mod @@ -10,7 +10,7 @@ require ( github.com/gitpod-io/gitpod/supervisor/api v0.0.0-00010101000000-000000000000 github.com/go-errors/errors v1.4.2 github.com/golang/mock v1.6.0 - github.com/google/go-cmp v0.5.8 + github.com/google/go-cmp v0.5.9 github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf github.com/google/tcpproxy v0.0.0-20180808230851-dfa16c61dad2 github.com/gorilla/handlers v1.5.1 @@ -20,13 +20,23 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/sourcegraph/jsonrpc2 v0.0.0-20200429184054-15c2290dcb37 github.com/spf13/cobra v1.1.3 - golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d - golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 + golang.org/x/sys v0.3.0 + golang.org/x/term v0.3.0 golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f google.golang.org/grpc v1.49.0 gopkg.in/yaml.v2 v2.4.0 ) +require ( + github.com/mattn/go-colorable v0.0.9 // indirect + github.com/mattn/go-isatty v0.0.3 // indirect + github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect + github.com/onsi/ginkgo v1.16.5 // indirect + github.com/onsi/gomega v1.24.2 // indirect + golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect + google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect +) + require ( github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect @@ -37,9 +47,9 @@ require ( github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect - golang.org/x/text v0.3.7 // indirect - google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect + github.com/x-cray/logrus-prefixed-formatter v0.5.2 + golang.org/x/net v0.4.0 // indirect + golang.org/x/text v0.5.0 // indirect google.golang.org/protobuf v1.28.1 // indirect ) diff --git a/components/gitpod-cli/go.sum b/components/gitpod-cli/go.sum index 937a756a5aa8f9..47e248b203cb9f 100644 --- a/components/gitpod-cli/go.sum +++ b/components/gitpod-cli/go.sum @@ -50,6 +50,8 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= @@ -58,6 +60,7 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -71,6 +74,12 @@ github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+Licev github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -78,9 +87,11 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -123,6 +134,7 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -142,11 +154,15 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= +github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -159,9 +175,20 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE= +github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -208,10 +235,14 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg= +github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -225,6 +256,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -243,9 +276,11 @@ golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -258,9 +293,11 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -269,10 +306,12 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -284,21 +323,27 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d h1:Zu/JngovGLVi6t2J3nmAf3AoTDwuzw85YZ3b9o4yU7s= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -319,6 +364,7 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -351,6 +397,12 @@ google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiq google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= @@ -360,11 +412,16 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/components/gitpod-cli/pkg/supervisor/client.go b/components/gitpod-cli/pkg/supervisor/client.go index 034ea6c3cb6652..493de83f24070b 100644 --- a/components/gitpod-cli/pkg/supervisor/client.go +++ b/components/gitpod-cli/pkg/supervisor/client.go @@ -21,9 +21,10 @@ type SupervisorClient struct { conn *grpc.ClientConn closeOnce sync.Once - Status api.StatusServiceClient - Terminal api.TerminalServiceClient - Info api.InfoServiceClient + Status api.StatusServiceClient + Terminal api.TerminalServiceClient + Info api.InfoServiceClient + Notification api.NotificationServiceClient } type SupervisorClientOption struct { @@ -43,10 +44,11 @@ func New(ctx context.Context, options ...*SupervisorClientOption) (*SupervisorCl } return &SupervisorClient{ - conn: conn, - Status: api.NewStatusServiceClient(conn), - Terminal: api.NewTerminalServiceClient(conn), - Info: api.NewInfoServiceClient(conn), + conn: conn, + Status: api.NewStatusServiceClient(conn), + Terminal: api.NewTerminalServiceClient(conn), + Info: api.NewInfoServiceClient(conn), + Notification: api.NewNotificationServiceClient(conn), }, nil } diff --git a/components/supervisor/cmd/debug-env.go b/components/supervisor/cmd/debug-env.go new file mode 100644 index 00000000000000..6e0b18ae2ec87c --- /dev/null +++ b/components/supervisor/cmd/debug-env.go @@ -0,0 +1,51 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +package cmd + +import ( + "fmt" + "io/ioutil" + "strings" + + "github.com/gitpod-io/gitpod/common-go/log" + "github.com/spf13/cobra" +) + +var debugEnvCmd = &cobra.Command{ + Use: "debug-env", + Run: func(cmd *cobra.Command, args []string) { + // TODO supervisor - hardcode for now, but how to separate from workspace envs? + // TODO are there any other env vars which are not picked up by supervisor, but has to propagated from ws-manager to support docker or something? + initEnvs, err := ioutil.ReadFile("/proc/1/environ") + if err != nil { + log.Fatal(err) + } + initEnviron := strings.Split(string(initEnvs), "\x00") + for _, env := range initEnviron { + if env == "" { + continue + } + parts := strings.SplitN(env, "=", 2) + key := parts[0] + if key == "THEIA_SUPERVISOR_TOKENS" || + strings.HasPrefix(key, "GITPOD_") || + // TODO IDE - get rid of env vars in images, use supervisor api as a mediator to support many IDEs running in the same worksapce? + // TODO PATH - use well defined locations to pick up binaries, i.e. /ide/bin or /ide-desktop/bin in supervisor? + key == "VSX_REGISTRY_URL" || + key == "EDITOR" || + key == "VISUAL" || + key == "GP_OPEN_EDITOR" || + key == "GIT_EDITOR" || + key == "GP_PREVIEW_BROWSER" || + key == "GP_EXTERNAL_BROWSER" { + fmt.Println(env) + } + } + }, +} + +func init() { + rootCmd.AddCommand(debugEnvCmd) +} diff --git a/components/supervisor/cmd/debug-proxy.go b/components/supervisor/cmd/debug-proxy.go new file mode 100644 index 00000000000000..2286a2f21fc41a --- /dev/null +++ b/components/supervisor/cmd/debug-proxy.go @@ -0,0 +1,56 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +package cmd + +import ( + "fmt" + "net/http" + "net/http/httputil" + "net/url" + "strconv" + + "github.com/gitpod-io/gitpod/common-go/log" + "github.com/spf13/cobra" +) + +func NewSingleHostReverseProxy(target *url.URL) *httputil.ReverseProxy { + director := func(req *http.Request) { + req.URL.Scheme = target.Scheme + req.URL.Host = target.Host + if _, ok := req.Header["User-Agent"]; !ok { + // explicitly disable User-Agent so it's not set to default value + req.Header.Set("User-Agent", "") + } + req.Header.Del("X-WS-Proxy-Debug-Port") + } + return &httputil.ReverseProxy{Director: director} +} + +var debugProxyCmd = &cobra.Command{ + Use: "debug-proxy", + Short: "forward request to debug workspace", + Run: func(cmd *cobra.Command, args []string) { + log.Fatal(http.ListenAndServe(":23003", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + portStr := r.Header.Get("X-WS-Proxy-Debug-Port") + port, err := strconv.Atoi(portStr) + if err != nil || port < 1 || port > 65535 { + w.WriteHeader(502) + return + } + dst, err := url.Parse("http://10.0.6.2:" + portStr) + if err != nil { + w.WriteHeader(502) + return + } + fmt.Printf("%+v\n", dst) + proxy := NewSingleHostReverseProxy(dst) + proxy.ServeHTTP(w, r) + }))) + }, +} + +func init() { + rootCmd.AddCommand(debugProxyCmd) +} diff --git a/components/supervisor/cmd/init.go b/components/supervisor/cmd/init.go index e08e9cbe0b2f25..8f7273b2fca581 100644 --- a/components/supervisor/cmd/init.go +++ b/components/supervisor/cmd/init.go @@ -51,6 +51,16 @@ var initCmd = &cobra.Command{ if err != nil { supervisorPath = "/.supervisor/supervisor" } + + debugProxyCtx, stopDebugProxy := context.WithCancel(context.Background()) + if os.Getenv("SUPERVISOR_DEBUG_WORKSPACE") == "true" { + err = exec.CommandContext(debugProxyCtx, supervisorPath, "debug-proxy").Start() + if err != nil { + log.WithError(err).Fatal("cannot run debug workspace proxy") + } + } + defer stopDebugProxy() + runCommand := exec.Command(supervisorPath, "run") runCommand.Args[0] = "supervisor" runCommand.Stdin = os.Stdin diff --git a/components/ws-daemon/pkg/iws/iws.go b/components/ws-daemon/pkg/iws/iws.go index b3f4b6e431fa27..5e83a4ad417950 100644 --- a/components/ws-daemon/pkg/iws/iws.go +++ b/components/ws-daemon/pkg/iws/iws.go @@ -186,7 +186,7 @@ func (wbs *InWorkspaceServiceServer) Start() error { UseOnce: true, }, "/iws.InWorkspaceService/WorkspaceInfo": ratelimit{ - Limiter: rate.NewLimiter(rate.Every(1500*time.Millisecond), 4), + Limiter: rate.NewLimiter(rate.Every(1500*time.Millisecond), 8), }, } diff --git a/components/ws-proxy/pkg/proxy/config.go b/components/ws-proxy/pkg/proxy/config.go index 98f3a916e40ae9..e037b52f24013d 100644 --- a/components/ws-proxy/pkg/proxy/config.go +++ b/components/ws-proxy/pkg/proxy/config.go @@ -71,10 +71,11 @@ func (c *HostBasedIngressConfig) Validate() error { // WorkspacePodConfig contains config around the workspace pod. type WorkspacePodConfig struct { - TheiaPort uint16 `json:"theiaPort"` - IDEDebugPort uint16 `json:"ideDebugPort"` - SupervisorPort uint16 `json:"supervisorPort"` - SupervisorDebugPort uint16 `json:"supervisorDebugPort"` + TheiaPort uint16 `json:"theiaPort"` + IDEDebugPort uint16 `json:"ideDebugPort"` + SupervisorPort uint16 `json:"supervisorPort"` + SupervisorDebugPort uint16 `json:"supervisorDebugPort"` + DebugWorkspaceProxyPort uint16 `json:"debugWorkspaceProxyPort"` // SupervisorImage is deprecated SupervisorImage string `json:"supervisorImage"` } @@ -90,6 +91,7 @@ func (c *WorkspacePodConfig) Validate() error { validation.Field(&c.IDEDebugPort, validation.Required), validation.Field(&c.SupervisorPort, validation.Required), validation.Field(&c.SupervisorDebugPort, validation.Required), + validation.Field(&c.DebugWorkspaceProxyPort, validation.Required), ) if len(c.SupervisorImage) > 0 { log.Warn("config value 'workspacePodConfig.supervisorImage' is deprected, use it only to be backwards compatible") diff --git a/components/ws-proxy/pkg/proxy/routes.go b/components/ws-proxy/pkg/proxy/routes.go index 5476a47846f872..7d581e31cfe08a 100644 --- a/components/ws-proxy/pkg/proxy/routes.go +++ b/components/ws-proxy/pkg/proxy/routes.go @@ -419,6 +419,12 @@ func installWorkspacePortRoutes(r *mux.Router, config *RouteHandlerConfig, infoP r.Header.Add("X-Forwarded-Proto", "https") r.Header.Add("X-Forwarded-Host", r.Host) r.Header.Add("X-Forwarded-Port", "443") + + coords := getWorkspaceCoords(r) + if coords.Debug { + r.Header.Add("X-WS-Proxy-Debug-Port", coords.Port) + } + proxyPass( config, infoProvider, @@ -449,7 +455,13 @@ func workspacePodResolver(config *Config, infoProvider WorkspaceInfoProvider, re func workspacePodPortResolver(config *Config, infoProvider WorkspaceInfoProvider, req *http.Request) (url *url.URL, err error) { coords := getWorkspaceCoords(req) workspaceInfo := infoProvider.WorkspaceInfo(coords.ID) - return buildWorkspacePodURL(workspaceInfo.IPAddress, coords.Port) + var port string + if coords.Debug { + port = fmt.Sprint(config.WorkspacePodConfig.DebugWorkspaceProxyPort) + } else { + port = coords.Port + } + return buildWorkspacePodURL(workspaceInfo.IPAddress, port) } // workspacePodSupervisorResolver resolves to the workspace pods Supervisor url from the given request. diff --git a/components/ws-proxy/pkg/proxy/routes_test.go b/components/ws-proxy/pkg/proxy/routes_test.go index 45dcc2e22ff1d1..e99516908ecdfb 100644 --- a/components/ws-proxy/pkg/proxy/routes_test.go +++ b/components/ws-proxy/pkg/proxy/routes_test.go @@ -56,14 +56,15 @@ var ( }, } - ideServerHost = "localhost:20000" - workspacePort = uint16(20001) - supervisorPort = uint16(20002) - workspaceDebugPort = uint16(20004) - supervisorDebugPort = uint16(20005) - workspaceHost = fmt.Sprintf("localhost:%d", workspacePort) - portServeHost = fmt.Sprintf("localhost:%d", workspaces[0].Ports[0].Port) - blobServeHost = "localhost:20003" + ideServerHost = "localhost:20000" + workspacePort = uint16(20001) + supervisorPort = uint16(20002) + workspaceDebugPort = uint16(20004) + supervisorDebugPort = uint16(20005) + debugWorkspaceProxyPort = uint16(20006) + workspaceHost = fmt.Sprintf("localhost:%d", workspacePort) + portServeHost = fmt.Sprintf("localhost:%d", workspaces[0].Ports[0].Port) + blobServeHost = "localhost:20003" config = Config{ TransportConfig: &TransportConfig{ @@ -82,10 +83,11 @@ var ( Scheme: "http", }, WorkspacePodConfig: &WorkspacePodConfig{ - TheiaPort: workspacePort, - SupervisorPort: supervisorPort, - IDEDebugPort: workspaceDebugPort, - SupervisorDebugPort: supervisorDebugPort, + TheiaPort: workspacePort, + SupervisorPort: supervisorPort, + IDEDebugPort: workspaceDebugPort, + SupervisorDebugPort: supervisorDebugPort, + DebugWorkspaceProxyPort: debugWorkspaceProxyPort, }, BuiltinPages: BuiltinPagesConfig{ Location: "../../public", diff --git a/components/ws-proxy/pkg/proxy/workspacerouter.go b/components/ws-proxy/pkg/proxy/workspacerouter.go index 14ff9ccf514cad..18226c1413f8c0 100644 --- a/components/ws-proxy/pkg/proxy/workspacerouter.go +++ b/components/ws-proxy/pkg/proxy/workspacerouter.go @@ -80,7 +80,7 @@ type hostHeaderProvider func(req *http.Request) string func matchWorkspaceHostHeader(wsHostSuffix string, headerProvider hostHeaderProvider, matchPort bool) mux.MatcherFunc { var regexPrefix string if matchPort { - regexPrefix = workspacePortRegex + workspaceIDRegex + regexPrefix = workspacePortRegex + debugWorkspaceRegex + workspaceIDRegex } else { regexPrefix = debugWorkspaceRegex + workspaceIDRegex } @@ -95,17 +95,23 @@ func matchWorkspaceHostHeader(wsHostSuffix string, headerProvider hostHeaderProv var workspaceID, workspacePort, debugWorkspace string matches := r.FindStringSubmatch(hostname) - if len(matches) < 3 { - return false - } if matchPort { - // https://3000-coral-dragon-ilr0r6eq.ws-eu10.gitpod.io/index.html - // debugWorkspace: + if len(matches) < 4 { + return false + } + if matches[2] != "" { + debugWorkspace = "true" + } + // https://3000-debug-coral-dragon-ilr0r6eq.ws-eu10.gitpod.io/index.html + // debugWorkspace: true // workspaceID: coral-dragon-ilr0r6eq // workspacePort: 3000 - workspaceID = matches[2] + workspaceID = matches[3] workspacePort = matches[1] } else { + if len(matches) < 3 { + return false + } // https://debug-coral-dragon-ilr0r6eq.ws-eu10.gitpod.io/index.html // debugWorkspace: true // workspaceID: coral-dragon-ilr0r6eq diff --git a/install/installer/cmd/testdata/render/aws-setup/output.golden b/install/installer/cmd/testdata/render/aws-setup/output.golden index 08e7b246691505..8babe737c2a216 100644 --- a/install/installer/cmd/testdata/render/aws-setup/output.golden +++ b/install/installer/cmd/testdata/render/aws-setup/output.golden @@ -5715,6 +5715,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -10450,7 +10451,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 714740065966c437ee71b41e8953aa6bb77ac83596e2326b267a2b954f60242d + gitpod.io/checksum_config: 50975660db033ea3555b3ced8dcb5e88a95b63142b5402732d0bc8355f3daaed creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/azure-setup/output.golden b/install/installer/cmd/testdata/render/azure-setup/output.golden index f933eee00388ac..c004bb10cbdbad 100644 --- a/install/installer/cmd/testdata/render/azure-setup/output.golden +++ b/install/installer/cmd/testdata/render/azure-setup/output.golden @@ -5691,6 +5691,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -10519,7 +10520,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 714740065966c437ee71b41e8953aa6bb77ac83596e2326b267a2b954f60242d + gitpod.io/checksum_config: 50975660db033ea3555b3ced8dcb5e88a95b63142b5402732d0bc8355f3daaed creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/custom-pull-repository/output.golden b/install/installer/cmd/testdata/render/custom-pull-repository/output.golden index 9697de7d48c5ed..719ec76f5ad5b5 100644 --- a/install/installer/cmd/testdata/render/custom-pull-repository/output.golden +++ b/install/installer/cmd/testdata/render/custom-pull-repository/output.golden @@ -6098,6 +6098,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "registry.mydomain.com/namespace/supervisor:test" }, "builtinPages": { @@ -11323,7 +11324,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: f0a077b5cee652ccf128621f7f7cc23ae4cdb4225b4aa32942eccaa2be4e528e + gitpod.io/checksum_config: 8d2c99a864e5f9f28f96628cf5f56f5abae0de8a43206e0523784ce039d20a90 creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/customization/output.golden b/install/installer/cmd/testdata/render/customization/output.golden index 54c13edc944582..1f04fe1a40a7e3 100644 --- a/install/installer/cmd/testdata/render/customization/output.golden +++ b/install/installer/cmd/testdata/render/customization/output.golden @@ -6721,6 +6721,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -12204,7 +12205,7 @@ spec: metadata: annotations: gitpod.io: hello - gitpod.io/checksum_config: be61210a63646185a45ed41810fa0ff56fb433059593b7eaea7a23d9a3cc4bdf + gitpod.io/checksum_config: 91f8cea7c5bfea1b90f1426ef89c453853e01b7c692851fc25af41491d5734a7 hello: world creationTimestamp: null labels: diff --git a/install/installer/cmd/testdata/render/external-registry/output.golden b/install/installer/cmd/testdata/render/external-registry/output.golden index d7845a68bf2b0a..56f294ba4a9833 100644 --- a/install/installer/cmd/testdata/render/external-registry/output.golden +++ b/install/installer/cmd/testdata/render/external-registry/output.golden @@ -5878,6 +5878,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -10946,7 +10947,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 714740065966c437ee71b41e8953aa6bb77ac83596e2326b267a2b954f60242d + gitpod.io/checksum_config: 50975660db033ea3555b3ced8dcb5e88a95b63142b5402732d0bc8355f3daaed creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/gcp-setup/output.golden b/install/installer/cmd/testdata/render/gcp-setup/output.golden index e5c6795c96ac48..89bd8db388c12f 100644 --- a/install/installer/cmd/testdata/render/gcp-setup/output.golden +++ b/install/installer/cmd/testdata/render/gcp-setup/output.golden @@ -5650,6 +5650,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -10409,7 +10410,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 714740065966c437ee71b41e8953aa6bb77ac83596e2326b267a2b954f60242d + gitpod.io/checksum_config: 50975660db033ea3555b3ced8dcb5e88a95b63142b5402732d0bc8355f3daaed creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/http-proxy/output.golden b/install/installer/cmd/testdata/render/http-proxy/output.golden index e7130bd2773d76..a946b0d46f16a7 100644 --- a/install/installer/cmd/testdata/render/http-proxy/output.golden +++ b/install/installer/cmd/testdata/render/http-proxy/output.golden @@ -6101,6 +6101,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -13011,7 +13012,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 714740065966c437ee71b41e8953aa6bb77ac83596e2326b267a2b954f60242d + gitpod.io/checksum_config: 50975660db033ea3555b3ced8dcb5e88a95b63142b5402732d0bc8355f3daaed creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/kind-workspace/output.golden b/install/installer/cmd/testdata/render/kind-workspace/output.golden index 8854f19f9eb2fd..42f922c1d820d0 100644 --- a/install/installer/cmd/testdata/render/kind-workspace/output.golden +++ b/install/installer/cmd/testdata/render/kind-workspace/output.golden @@ -2135,6 +2135,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -3910,7 +3911,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 714740065966c437ee71b41e8953aa6bb77ac83596e2326b267a2b954f60242d + gitpod.io/checksum_config: 50975660db033ea3555b3ced8dcb5e88a95b63142b5402732d0bc8355f3daaed creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/minimal/output.golden b/install/installer/cmd/testdata/render/minimal/output.golden index 3e62de2144bebf..c2e068da2e54d4 100644 --- a/install/installer/cmd/testdata/render/minimal/output.golden +++ b/install/installer/cmd/testdata/render/minimal/output.golden @@ -6098,6 +6098,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -11323,7 +11324,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 714740065966c437ee71b41e8953aa6bb77ac83596e2326b267a2b954f60242d + gitpod.io/checksum_config: 50975660db033ea3555b3ced8dcb5e88a95b63142b5402732d0bc8355f3daaed creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/shortname/output.golden b/install/installer/cmd/testdata/render/shortname/output.golden index 8a8499e307ffa7..b58a15fafceb16 100644 --- a/install/installer/cmd/testdata/render/shortname/output.golden +++ b/install/installer/cmd/testdata/render/shortname/output.golden @@ -6098,6 +6098,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -11323,7 +11324,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 1d3e519239eb23a1e2f00e30f73abf47a1a18a74052043e6dc8d1196eed4fd1f + gitpod.io/checksum_config: 9a39727d1f0fad7df2a842459983ecd049b262fa12be3a72b29809d844b3365b creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/statefulset-customization/output.golden b/install/installer/cmd/testdata/render/statefulset-customization/output.golden index 1e172bd1356f78..696f4f7a2fdd27 100644 --- a/install/installer/cmd/testdata/render/statefulset-customization/output.golden +++ b/install/installer/cmd/testdata/render/statefulset-customization/output.golden @@ -6110,6 +6110,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -11335,7 +11336,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 714740065966c437ee71b41e8953aa6bb77ac83596e2326b267a2b954f60242d + gitpod.io/checksum_config: 50975660db033ea3555b3ced8dcb5e88a95b63142b5402732d0bc8355f3daaed creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/use-pod-security-policies/output.golden b/install/installer/cmd/testdata/render/use-pod-security-policies/output.golden index 0873c4ff624500..b7352c7ea2a7d5 100644 --- a/install/installer/cmd/testdata/render/use-pod-security-policies/output.golden +++ b/install/installer/cmd/testdata/render/use-pod-security-policies/output.golden @@ -6431,6 +6431,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -11767,7 +11768,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 714740065966c437ee71b41e8953aa6bb77ac83596e2326b267a2b954f60242d + gitpod.io/checksum_config: 50975660db033ea3555b3ced8dcb5e88a95b63142b5402732d0bc8355f3daaed creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/vsxproxy-pvc/output.golden b/install/installer/cmd/testdata/render/vsxproxy-pvc/output.golden index 7f5708bc8da59a..3b71feb61c85ab 100644 --- a/install/installer/cmd/testdata/render/vsxproxy-pvc/output.golden +++ b/install/installer/cmd/testdata/render/vsxproxy-pvc/output.golden @@ -6100,6 +6100,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -11313,7 +11314,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 714740065966c437ee71b41e8953aa6bb77ac83596e2326b267a2b954f60242d + gitpod.io/checksum_config: 50975660db033ea3555b3ced8dcb5e88a95b63142b5402732d0bc8355f3daaed creationTimestamp: null labels: app: gitpod diff --git a/install/installer/cmd/testdata/render/workspace-requests-limits/output.golden b/install/installer/cmd/testdata/render/workspace-requests-limits/output.golden index 3486eea8d7f07e..40b3f163b07d6f 100644 --- a/install/installer/cmd/testdata/render/workspace-requests-limits/output.golden +++ b/install/installer/cmd/testdata/render/workspace-requests-limits/output.golden @@ -6101,6 +6101,7 @@ data: "ideDebugPort": 25000, "supervisorPort": 22999, "supervisorDebugPort": 24999, + "debugWorkspaceProxyPort": 25003, "supervisorImage": "eu.gcr.io/gitpod-core-dev/build/supervisor:test" }, "builtinPages": { @@ -11326,7 +11327,7 @@ spec: template: metadata: annotations: - gitpod.io/checksum_config: 714740065966c437ee71b41e8953aa6bb77ac83596e2326b267a2b954f60242d + gitpod.io/checksum_config: 50975660db033ea3555b3ced8dcb5e88a95b63142b5402732d0bc8355f3daaed creationTimestamp: null labels: app: gitpod diff --git a/install/installer/pkg/components/workspace/constants.go b/install/installer/pkg/components/workspace/constants.go index 339710b6adc016..4cfa42bbdeee0b 100644 --- a/install/installer/pkg/components/workspace/constants.go +++ b/install/installer/pkg/components/workspace/constants.go @@ -15,4 +15,5 @@ const ( SupervisorPort = 22999 SupervisorDebugPort = 24999 IDEDebugPort = 25000 + DebugWorkspaceProxyPort = 25003 ) diff --git a/install/installer/pkg/components/ws-proxy/configmap.go b/install/installer/pkg/components/ws-proxy/configmap.go index f5e8f950b90e5d..d75003e505f279 100644 --- a/install/installer/pkg/components/ws-proxy/configmap.go +++ b/install/installer/pkg/components/ws-proxy/configmap.go @@ -108,11 +108,12 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { WorkspaceHostSuffixRegex: gitpodInstallationWorkspaceHostSuffixRegex, }, WorkspacePodConfig: &proxy.WorkspacePodConfig{ - TheiaPort: workspace.ContainerPort, - IDEDebugPort: workspace.IDEDebugPort, - SupervisorPort: workspace.SupervisorPort, - SupervisorDebugPort: workspace.SupervisorDebugPort, - SupervisorImage: ctx.ImageName(ctx.Config.Repository, workspace.SupervisorImage, ctx.VersionManifest.Components.Workspace.Supervisor.Version), + TheiaPort: workspace.ContainerPort, + IDEDebugPort: workspace.IDEDebugPort, + SupervisorPort: workspace.SupervisorPort, + SupervisorDebugPort: workspace.SupervisorDebugPort, + DebugWorkspaceProxyPort: workspace.DebugWorkspaceProxyPort, + SupervisorImage: ctx.ImageName(ctx.Config.Repository, workspace.SupervisorImage, ctx.VersionManifest.Components.Workspace.Supervisor.Version), }, BuiltinPages: proxy.BuiltinPagesConfig{ Location: "/app/public",