Skip to content

Commit

Permalink
let kube get in-cluster default namespace given kube-rs/kube#74
Browse files Browse the repository at this point in the history
  • Loading branch information
alecmocatta committed Oct 15, 2019
1 parent 19766b1 commit 6f8d692
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ crossbeam = "0.7"
docopt = "1.0"
either = "1.5"
futures-preview = "0.3.0-alpha.18"
kube = { version = "0.16", features = ["openapi"], optional = true }
kube = { version = "0.16.2", features = ["openapi"], optional = true }
log = "0.4"
notifier = { version = "0.1", features = ["tcp_typed"] }
once_cell = "1.0"
Expand Down
7 changes: 2 additions & 5 deletions src/bin/constellation/kube.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ 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 client = APIClient::new(config);

let jobs = Api::v1ReplicaSet(client.clone()).within(&namespace); //.group("extensions").version("v1beta1");
let jobs = Api::v1ReplicaSet(client.clone()).within(&config.default_ns); //.group("extensions").version("v1beta1");

let replicas = replicas - 1; // one is this master

Expand All @@ -36,7 +33,7 @@ pub fn kube_master(
)
.unwrap();

let pods = Api::v1Pod(client).within(&namespace);
let pods = Api::v1Pod(client).within(&config.default_ns);

let ips = loop {
let pods = pods
Expand Down

0 comments on commit 6f8d692

Please sign in to comment.