Skip to content

Commit 78c4225

Browse files
author
Achille Roussel
committed
cleanup
1 parent 177fcec commit 78c4225

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

curl.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ func run(ctx context.Context) error {
186186

187187
f, err := openPortForwarder(ctx, portForwarderConfig{
188188
config: restConfig,
189-
namespace: namespace,
190-
podName: podName,
189+
pod: pod,
191190
localPort: localPort,
192191
remotePort: remotePort,
193192
stdout: stdout,
@@ -262,8 +261,7 @@ func selectContainerPort(pod *corev1.Pod, containerName, portName string) (selec
262261

263262
type portForwarderConfig struct {
264263
config *rest.Config
265-
namespace string
266-
podName string
264+
pod *corev1.Pod
267265
localPort int32
268266
remotePort int32
269267
stdout io.Writer
@@ -277,7 +275,7 @@ func openPortForwarder(ctx context.Context, fwd portForwarderConfig) (*portforwa
277275
}
278276

279277
host := strings.TrimLeft(fwd.config.Host, "htps:/")
280-
path := fmt.Sprintf("/api/v1/namespaces/%s/pods/%s/portforward", fwd.namespace, fwd.podName)
278+
path := fmt.Sprintf("/api/v1/namespaces/%s/pods/%s/portforward", fwd.pod.Namespace, fwd.pod.Name)
281279

282280
client := &http.Client{
283281
Transport: transport,

0 commit comments

Comments
 (0)