Verified Commit 8efd5d8f authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

print errors when creating k8s client

parent 41be5b86
Pipeline #31680 passed with stages
in 10 minutes and 52 seconds
use std::time::Duration;
use anyhow::{Context, Result};
use anyhow::{bail, Context, Result};
use api::Pod;
use clap::{App, Arg, ArgMatches};
use k8s_openapi::api::core::v1 as api;
......@@ -9,7 +9,7 @@ use k8s_openapi::apimachinery::pkg::apis::meta::v1::ObjectMeta;
use k8s_openapi::{Metadata, NamespaceResourceScope, Resource};
use kube::api::ListParams;
use kube::{Api, Client};
use log::{debug, info};
use log::{debug, error, info};
use serde::{Deserialize, Serialize};
fn parse_config() -> ArgMatches<'static> {
......@@ -154,9 +154,14 @@ async fn main() -> Result<()> {
// let producer_configs = matches.value_of("producer_configs");
let client = Client::try_default().await.context("building client")?;
let client = Client::try_default().await.context("building client");
let pods: Api<Pod> = Api::namespaced(client, namespace);
if let Err(e) = client {
error!("{}", e);
bail!("Abort");
}
let pods: Api<Pod> = Api::namespaced(client.unwrap(), namespace);
debug!("entering loop");
loop {
let list_params = ListParams::default();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment