From dfc9ebdc9ed39094a5341b31357bfb4488412450 Mon Sep 17 00:00:00 2001 From: alecmocatta Date: Tue, 15 Oct 2019 14:32:37 +0100 Subject: [PATCH] let kube get in-cluster default namespace given https://github.com/clux/kube-rs/pull/74 --- src/bin/constellation/kube.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bin/constellation/kube.rs b/src/bin/constellation/kube.rs index e17ce21..33f5651 100644 --- a/src/bin/constellation/kube.rs +++ b/src/bin/constellation/kube.rs @@ -5,7 +5,7 @@ use ::kube::{ }; use serde_json::json; use std::{ - collections::HashMap, env, fs::read_to_string, net::{IpAddr, SocketAddr}, thread + collections::HashMap, env, net::{IpAddr, SocketAddr}, thread }; use super::master; @@ -15,10 +15,8 @@ pub fn kube_master( master_bind: SocketAddr, fabric_port: u16, bridge_bind: SocketAddr, mem: u64, cpu: u32, replicas: u32, ) { - let namespace = - read_to_string("/var/run/secrets/kubernetes.io/serviceaccount/namespace").unwrap(); - let config = config::incluster_config().expect("failed to load in-cluster kubeconfig"); + let namespace = config.default_ns.clone(); let client = APIClient::new(config); let jobs = Api::v1ReplicaSet(client.clone()).within(&namespace); //.group("extensions").version("v1beta1");