mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-05 06:01:32 +00:00
feature(krata): prepare for workload rework (#276)
* chore(code): simple code cleanup * chore(code): additional code cleanup * feature(krata): rework api and make ip assignment persistent to database * rework and cleanup * fix daemon config references
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
use crate::format::metrics_value_pretty;
|
||||
use anyhow::Result;
|
||||
use krata::v1::common::ZoneState;
|
||||
use krata::{
|
||||
events::EventStream,
|
||||
v1::{
|
||||
common::{Zone, ZoneMetricNode, ZoneStatus},
|
||||
common::{Zone, ZoneMetricNode},
|
||||
control::{
|
||||
control_service_client::ControlServiceClient, watch_events_reply::Event,
|
||||
ListZonesRequest, ReadZoneMetricsRequest,
|
||||
@ -19,8 +21,6 @@ use tokio::{
|
||||
};
|
||||
use tonic::transport::Channel;
|
||||
|
||||
use crate::format::metrics_value_pretty;
|
||||
|
||||
pub struct MetricState {
|
||||
pub zone: Zone,
|
||||
pub root: Option<ZoneMetricNode>,
|
||||
@ -86,11 +86,11 @@ impl MultiMetricCollector {
|
||||
let Some(zone) = changed.zone else {
|
||||
continue;
|
||||
};
|
||||
let Some(ref state) = zone.state else {
|
||||
let Some(ref status) = zone.status else {
|
||||
continue;
|
||||
};
|
||||
zones.retain(|x| x.id != zone.id);
|
||||
if state.status() != ZoneStatus::Destroying {
|
||||
if status.state() != ZoneState::Destroying {
|
||||
zones.push(zone);
|
||||
}
|
||||
false
|
||||
@ -112,11 +112,11 @@ impl MultiMetricCollector {
|
||||
|
||||
let mut metrics = Vec::new();
|
||||
for zone in &zones {
|
||||
let Some(ref state) = zone.state else {
|
||||
let Some(ref status) = zone.status else {
|
||||
continue;
|
||||
};
|
||||
|
||||
if state.status() != ZoneStatus::Started {
|
||||
if status.state() != ZoneState::Created {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user