Skip to content

Commit

Permalink
refactor: move input args check into getForwardablePorts
Browse files Browse the repository at this point in the history
  • Loading branch information
vvagaytsev committed Sep 13, 2023
1 parent 50cd2f1 commit 668a246
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/plugins/kubernetes/kubernetes-type/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions core/src/plugins/kubernetes/port-forward.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ export function getForwardablePorts({
parentAction: Resolved<KubernetesDeployAction | HelmDeployAction> | undefined
mode: ActionMode
}): ForwardablePort[] {
if (resources.length === 0) {
return []
}

const spec = parentAction?.getSpec()

// Note: Local mode has its own port-forwarding configuration
Expand Down

0 comments on commit 668a246

Please sign in to comment.