Skip to content

Commit 26a335c

Browse files
fix(utils): close SSH client in GetKubeConfig
provisioner.New() opens an SSH connection that was never closed, leaking a TCP socket and SSH multiplexer goroutines on every call. Audit finding #4 (HIGH). Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
1 parent 86aa79d commit 26a335c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/utils/kubeconfig.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ func GetKubeConfig(log *logger.FunLogger, cfg *v1alpha1.Environment, hostUrl str
3535
if err != nil {
3636
return err
3737
}
38+
defer func() { _ = p.Client.Close() }()
3839

3940
session, err := p.Client.NewSession()
4041
if err != nil {

0 commit comments

Comments
 (0)