From 4fc6a2ef554ec5e69522905ca4c18d2a39d22051 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 16 Mar 2022 12:09:50 +0100 Subject: Add feature flag for Kubernetes discovery --- src/rpc/kubernetes.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/rpc/kubernetes.rs') diff --git a/src/rpc/kubernetes.rs b/src/rpc/kubernetes.rs index 272d9162..939a0eed 100644 --- a/src/rpc/kubernetes.rs +++ b/src/rpc/kubernetes.rs @@ -12,8 +12,6 @@ use serde::{Deserialize, Serialize}; use netapp::NodeID; -use garage_util::error::Error; - static K8S_GROUP: &str = "deuxfleurs.fr"; #[derive(CustomResource, Debug, Serialize, Deserialize, Clone, JsonSchema)] @@ -29,7 +27,7 @@ pub struct Node { port: u16, } -pub async fn create_kubernetes_crd() -> Result<(), Error> { +pub async fn create_kubernetes_crd() -> Result<(), kube::Error> { let client = Client::try_default().await?; let crds: Api = Api::all(client.clone()); @@ -45,7 +43,7 @@ pub async fn create_kubernetes_crd() -> Result<(), Error> { pub async fn get_kubernetes_nodes( kubernetes_service_name: &str, kubernetes_namespace: &str, -) -> Result, Error> { +) -> Result, kube::Error> { let client = Client::try_default().await?; let nodes: Api = Api::namespaced(client.clone(), kubernetes_namespace); @@ -80,7 +78,7 @@ pub async fn publish_kubernetes_node( node_id: NodeID, hostname: &str, rpc_public_addr: SocketAddr, -) -> Result<(), Error> { +) -> Result<(), kube::Error> { let node_pubkey = hex::encode(node_id); let mut node = GarageNode::new( -- cgit v1.2.3