Skip to content

Commit 7ec07f9

Browse files
committed
fix(controller): path used in manifest
1 parent fc3a91f commit 7ec07f9

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

deploy/exemple/min-local-talos.crd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ spec:
88
Insecure: true
99
service:
1010
ExternalService:
11-
url: "https://10.5.0.20:6443"
11+
url: "https://10.5.0.2:6443"

libs/controller/src/proxy_kube_api/reconcile.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use crate::error::{ControllerError, Result};
1111
pub async fn reconcile_proxy_kube_api(proxy: &ProxyKubeApi, ctx: Arc<State>) -> Result<Action> {
1212
info!("Reconciling ProxyKubeApi: {}", proxy.to_identifier());
1313
let id = proxy.to_identifier();
14+
let path = proxy.to_path();
1415
let ps: PatchParams = PatchParams::apply("proxy-kube-api-controller").force();
1516
let proxy_cloned = proxy.clone();
1617
let metadata = proxy_cloned.clone().metadata;
@@ -75,7 +76,8 @@ pub async fn reconcile_proxy_kube_api(proxy: &ProxyKubeApi, ctx: Arc<State>) ->
7576
}
7677
}
7778
}
78-
let new_status = ProxyKubeApiStatus::new(true, Some(format!("/{}", id)), None).get_patch();
79+
let new_status =
80+
ProxyKubeApiStatus::new(true, Some(format!("/clusters/{}", path)), None).get_patch();
7981
let _ = proxys
8082
.patch_status(name, &ps, &new_status)
8183
.await

libs/crd/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ impl ProxyKubeApi {
5656
self.name_any()
5757
)
5858
}
59+
pub fn to_path(&self) -> String {
60+
format!(
61+
"{}/{}",
62+
self.namespace().unwrap_or_default(),
63+
self.name_any()
64+
)
65+
}
5966
pub fn to_json(&self) -> String {
6067
serde_json::to_string_pretty(self).unwrap_or_default()
6168
}

0 commit comments

Comments
 (0)