diff --git a/core/src/plugins/kubernetes/kubernetes-type/handlers.ts b/core/src/plugins/kubernetes/kubernetes-type/handlers.ts index da862f22e6..10bbb6b729 100644 --- a/core/src/plugins/kubernetes/kubernetes-type/handlers.ts +++ b/core/src/plugins/kubernetes/kubernetes-type/handlers.ts @@ -300,7 +300,7 @@ export const getKubernetesDeployStatus: DeployActionHandler<"getStatus", Kuberne } // Note: Local mode has its own port-forwarding configuration - if (deployedMode !== "local" && remoteResources && remoteResources.length > 0) { + if (deployedMode !== "local") { try { forwardablePorts = getForwardablePorts({ resources: remoteResources, parentAction: action, mode: deployedMode }) } catch (error) { diff --git a/core/src/plugins/kubernetes/port-forward.ts b/core/src/plugins/kubernetes/port-forward.ts index 1821fab2fe..ed7bc7a7ab 100644 --- a/core/src/plugins/kubernetes/port-forward.ts +++ b/core/src/plugins/kubernetes/port-forward.ts @@ -228,6 +228,10 @@ export function getForwardablePorts({ parentAction: Resolved | undefined mode: ActionMode }): ForwardablePort[] { + if (resources.length === 0) { + return [] + } + const spec = parentAction?.getSpec() // Note: Local mode has its own port-forwarding configuration