Skip to content

Commit

Permalink
Parse evar as 1
Browse files Browse the repository at this point in the history
Signed-off-by: Matei David <[email protected]>
  • Loading branch information
mateiidavid committed Feb 21, 2023
1 parent b1a31fc commit 7b18318
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions examples/dynamic_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ async fn main() -> anyhow::Result<()> {
let client = Client::try_default().await?;

// If set will receive only the metadata for watched resources
let should_watch_meta = {
let v = env::var("WATCH_METADATA").unwrap_or_else(|_| "false".into());
v.parse::<bool>().ok().unwrap_or_else(|| false)
};
let watch_metadata = env::var("WATCH_METADATA").map(|s| s == "1").unwrap_or(false);

// Take dynamic resource identifiers:
let group = env::var("GROUP").unwrap_or_else(|_| "clux.dev".into());
Expand All @@ -34,7 +31,7 @@ async fn main() -> anyhow::Result<()> {
let api = Api::<DynamicObject>::all_with(client, &ar);

// Fully compatible with kube-runtime
if should_watch_meta {
if watch_metadata {
let mut items = metadata_watcher(api, ListParams::default())
.applied_objects()
.boxed();
Expand Down

0 comments on commit 7b18318

Please sign in to comment.