aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/kubernetes.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-03-16 12:09:50 +0100
committerAlex Auvolat <alex@adnab.me>2022-03-16 12:12:33 +0100
commit4fc6a2ef554ec5e69522905ca4c18d2a39d22051 (patch)
treea6ac34a8dbd8623b390c182529dc393bc7e8444d /src/rpc/kubernetes.rs
parentba6b56ae68d5842d814769418d484093865261aa (diff)
downloadgarage-4fc6a2ef554ec5e69522905ca4c18d2a39d22051.tar.gz
garage-4fc6a2ef554ec5e69522905ca4c18d2a39d22051.zip
Add feature flag for Kubernetes discovery
Diffstat (limited to 'src/rpc/kubernetes.rs')
-rw-r--r--src/rpc/kubernetes.rs8
1 files changed, 3 insertions, 5 deletions
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<CustomResourceDefinition> = 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<Vec<(NodeID, SocketAddr)>, Error> {
+) -> Result<Vec<(NodeID, SocketAddr)>, kube::Error> {
let client = Client::try_default().await?;
let nodes: Api<GarageNode> = 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(