diff --git a/site/src/content/docs/commands/zarf_connect.md b/site/src/content/docs/commands/zarf_connect.md index a9c6ad18e1..f0eb9b84ce 100644 --- a/site/src/content/docs/commands/zarf_connect.md +++ b/site/src/content/docs/commands/zarf_connect.md @@ -30,10 +30,10 @@ zarf connect { REGISTRY | GIT | connect-name } [flags] --cli-only Disable browser auto-open -h, --help help for connect --local-port int (Optional, autogenerated if not provided) Specify the local port to bind to. E.g. local-port=42000. - --name string Specify the resource name. E.g. name=unicorns or name=unicorn-pod-7448499f4d-b5bk6. - --namespace string Specify the namespace. E.g. namespace=default. (default "zarf") - --remote-port int Specify the remote port of the resource to bind to. E.g. remote-port=8080. - --type string Specify the resource type. E.g. type=svc or type=pod. (default "svc") + --name string Specify the resource name. E.g. name=unicorns or name=unicorn-pod-7448499f4d-b5bk6. Ignored if connect-name is supplied. + --namespace string Specify the namespace. E.g. namespace=default. Ignored if connect-name is supplied. (default "zarf") + --remote-port int Specify the remote port of the resource to bind to. E.g. remote-port=8080. Ignored if connect-name is supplied. + --type string Specify the resource type. E.g. type=svc or type=pod. Ignored if connect-name is supplied. (default "svc") ``` ### Options inherited from parent commands diff --git a/src/cmd/connect.go b/src/cmd/connect.go index 59f7ed88e6..2aedd2f182 100644 --- a/src/cmd/connect.go +++ b/src/cmd/connect.go @@ -47,21 +47,9 @@ var ( if err != nil { return fmt.Errorf("unable to create tunnel: %w", err) } - if zt.ResourceType != cluster.SvcResource { - ti.ResourceType = zt.ResourceType - } - if zt.ResourceName != "" { - ti.ResourceName = zt.ResourceName - } - if zt.Namespace != cluster.ZarfNamespaceName { - ti.Namespace = zt.Namespace - } if zt.LocalPort != 0 { ti.LocalPort = zt.LocalPort } - if zt.RemotePort != 0 { - ti.RemotePort = zt.RemotePort - } tunnel, err = c.ConnectTunnelInfo(ctx, ti) } diff --git a/src/config/lang/english.go b/src/config/lang/english.go index 831fd8a920..9e8ae8f63b 100644 --- a/src/config/lang/english.go +++ b/src/config/lang/english.go @@ -76,11 +76,11 @@ const ( // zarf connect list CmdConnectListShort = "Lists all available connection shortcuts" - CmdConnectFlagName = "Specify the resource name. E.g. name=unicorns or name=unicorn-pod-7448499f4d-b5bk6." - CmdConnectFlagNamespace = "Specify the namespace. E.g. namespace=default." - CmdConnectFlagType = "Specify the resource type. E.g. type=svc or type=pod." + CmdConnectFlagName = "Specify the resource name. E.g. name=unicorns or name=unicorn-pod-7448499f4d-b5bk6. Ignored if connect-name is supplied." + CmdConnectFlagNamespace = "Specify the namespace. E.g. namespace=default. Ignored if connect-name is supplied." + CmdConnectFlagType = "Specify the resource type. E.g. type=svc or type=pod. Ignored if connect-name is supplied." CmdConnectFlagLocalPort = "(Optional, autogenerated if not provided) Specify the local port to bind to. E.g. local-port=42000." - CmdConnectFlagRemotePort = "Specify the remote port of the resource to bind to. E.g. remote-port=8080." + CmdConnectFlagRemotePort = "Specify the remote port of the resource to bind to. E.g. remote-port=8080. Ignored if connect-name is supplied." CmdConnectFlagCliOnly = "Disable browser auto-open" CmdConnectPreparingTunnel = "Preparing a tunnel to connect to %s" diff --git a/src/pkg/cluster/tunnel.go b/src/pkg/cluster/tunnel.go index 81c9b57417..86e952efa9 100644 --- a/src/pkg/cluster/tunnel.go +++ b/src/pkg/cluster/tunnel.go @@ -52,18 +52,6 @@ type TunnelInfo struct { urlSuffix string } -// NewTunnelInfo returns a new TunnelInfo object for connecting to a cluster -func NewTunnelInfo(namespace, resourceType, resourceName, urlSuffix string, localPort, remotePort int) TunnelInfo { - return TunnelInfo{ - Namespace: namespace, - ResourceType: resourceType, - ResourceName: resourceName, - urlSuffix: urlSuffix, - LocalPort: localPort, - RemotePort: remotePort, - } -} - // PrintConnectTable will print a table of all Zarf connect matches found in the cluster. func (c *Cluster) PrintConnectTable(ctx context.Context) error { selector, err := metav1.LabelSelectorAsSelector(&metav1.LabelSelector{