From 514ea3741bd1ce151ce51eba8686ae8e7ef91105 Mon Sep 17 00:00:00 2001 From: jswxstw Date: Wed, 22 Jan 2025 11:04:43 +0800 Subject: [PATCH] chore: remove leftover code (#14109) Signed-off-by: oninowang --- go.mod | 2 +- workflow/common/util.go | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/go.mod b/go.mod index c0009a9eaa39..9196edd92fb1 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,6 @@ require ( github.com/google/go-containerregistry v0.17.0 github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20220720195016-31786c6cbb82 github.com/gorilla/handlers v1.5.2 - github.com/gorilla/websocket v1.5.1 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -105,6 +104,7 @@ require ( github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/s2a-go v0.1.7 // indirect + github.com/gorilla/websocket v1.5.1 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgconn v1.14.3 // indirect diff --git a/workflow/common/util.go b/workflow/common/util.go index b7ffbe291494..ba1c892f9633 100644 --- a/workflow/common/util.go +++ b/workflow/common/util.go @@ -5,11 +5,9 @@ import ( "context" "encoding/json" "fmt" - "net/http" "sort" "strings" - "github.com/gorilla/websocket" log "github.com/sirupsen/logrus" apiv1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -19,7 +17,6 @@ import ( "github.com/argoproj/argo-workflows/v3/errors" wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1" - "github.com/argoproj/argo-workflows/v3/util" "github.com/argoproj/argo-workflows/v3/util/template" ) @@ -44,21 +41,6 @@ func isSubPath(path string, normalizedMountPath string) bool { return strings.HasPrefix(path, normalizedMountPath+"/") } -type RoundTripCallback func(conn *websocket.Conn, resp *http.Response, err error) error - -type WebsocketRoundTripper struct { - Dialer *websocket.Dialer - Do RoundTripCallback -} - -func (d *WebsocketRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { - conn, resp, err := d.Dialer.Dial(r.URL.String(), r.Header) - if err == nil { - defer util.Close(conn) - } - return resp, d.Do(conn, resp, err) -} - // ExecPodContainer runs a command in a container in a pod and returns the remotecommand.Executor func ExecPodContainer(restConfig *rest.Config, namespace string, pod string, container string, stdout bool, stderr bool, command ...string) (exec remotecommand.Executor, err error) { defer func() {