fix: use sudo for kubectl port-forward commands

This commit is contained in:
Reditus committed 2026-05-14 05:36:55 +01:00
1 parent 0418fba37c
commit 6a166b8ac0
1 file changed
+1 -1
+1 -1
View File
@@ -176,7 +176,7 @@ if ($pfCheck) {
}
$RemotePort = 15432
$remoteCmd = 'nohup kubectl port-forward -n ' + $Namespace + ' svc/' + $DBService + ' ' + $LocalPort + ':' + $RemotePort + ' > /tmp/pf.log 2>&1 &'
$remoteCmd = 'nohup sudo kubectl port-forward -n ' + $Namespace + ' svc/' + $DBService + ' ' + $LocalPort + ':' + $RemotePort + ' > /tmp/pf.log 2>&1 &'
$remoteCmdEscaped = $remoteCmd -replace '&', '`&'
$pfRemote = 'ssh -i "' + $SSHKey + '" -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 ' + $SSHUser + '@' + $ServerHost + ' "' + $remoteCmdEscaped + '"'
cmd /c $pfRemote