Skip to content

Commit

Permalink
fix: get target pod instead port
Browse files Browse the repository at this point in the history
  • Loading branch information
hcavarsan committed Dec 27, 2023
1 parent 401bb98 commit 66f0bbc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src-tauri/utils/kubeforward/src/kubecontext.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use anyhow::Result;
use k8s_openapi::api::core::v1::{Namespace, Service};
use k8s_openapi::{
api::core::v1::{Namespace, Service},
apimachinery::pkg::util::intstr::IntOrString,
};
use kube::{
api::{Api, ListParams},
config::{Config, KubeConfigOptions, Kubeconfig},
Expand Down Expand Up @@ -37,7 +40,7 @@ pub struct KubeServiceInfo {
#[derive(Serialize)]
pub struct KubeServicePortInfo {
pub name: Option<String>,
pub port: u16,
pub port: Option<IntOrString>,
}

#[tauri::command]
Expand Down Expand Up @@ -126,7 +129,7 @@ pub async fn list_service_ports(
.into_iter()
.map(|p| KubeServicePortInfo {
name: p.name,
port: p.port as u16,
port: p.target_port as Option<IntOrString>,
})
.collect()
});
Expand Down

0 comments on commit 66f0bbc

Please sign in to comment.