Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sebastian Schüpbach
Metrics Client
Commits
8efd5d8f
Verified
Commit
8efd5d8f
authored
Aug 23, 2021
by
Sebastian Schüpbach
Browse files
print errors when creating k8s client
parent
41be5b86
Pipeline
#31680
passed with stages
in 10 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main.rs
View file @
8efd5d8f
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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment