Skip to content

Commit 202cef0

Browse files
chore: Replace deprecated AsyncFd::new with AsyncFd::register
1 parent 088cbe9 commit 202cef0

8 files changed

Lines changed: 14 additions & 8 deletions

File tree

‎rust/stackable-cockpit/src/platform/demo/params.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use yaml_serde::Mapping;
21
use stackable_operator::kvp::Labels;
2+
use yaml_serde::Mapping;
33

44
use crate::platform::operator::ChartSourceType;
55

‎rust/stackable-cockpit/src/platform/operator/listener_operator.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use clap::ValueEnum;
2-
use yaml_serde::Value;
32
use snafu::ResultExt;
43
use stackable_operator::{
54
k8s_openapi::api::core::v1::Node,
65
kube::{Api, Client, api::ListParams},
76
};
87
use tokio::sync::OnceCell;
98
use tracing::{debug, info, instrument};
9+
use yaml_serde::Value;
1010

1111
pub static LISTENER_CLASS_PRESET: OnceCell<ListenerClassPreset> = OnceCell::const_new();
1212

‎rust/stackable-cockpit/src/platform/operator/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ use std::{fmt::Display, str::FromStr};
33
use listener_operator::LISTENER_CLASS_PRESET;
44
use semver::Version;
55
use serde::Serialize;
6-
use yaml_serde::{Mapping, Value};
76
use snafu::{ResultExt, Snafu, ensure};
87
use tracing::{Span, info, instrument};
98
use tracing_indicatif::{indicatif_println, span_ext::IndicatifSpanExt};
9+
use yaml_serde::{Mapping, Value};
1010

1111
use crate::{
1212
constants::{

‎rust/stackable-cockpit/src/platform/release/spec.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ use futures::{StreamExt as _, TryStreamExt};
22
use indexmap::IndexMap;
33
use reqwest::StatusCode;
44
use serde::{Deserialize, Serialize};
5-
use yaml_serde::Mapping;
65
use snafu::{ResultExt, Snafu};
76
use tokio::task::JoinError;
87
use tracing::{Instrument, Span, debug, info, instrument};
98
use tracing_indicatif::span_ext::IndicatifSpanExt as _;
109
#[cfg(feature = "openapi")]
1110
use utoipa::ToSchema;
11+
use yaml_serde::Mapping;
1212

1313
use crate::{
1414
PROGRESS_BAR_STYLE, helm,

‎rust/stackable-cockpit/src/platform/stack/params.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use yaml_serde::Mapping;
21
use stackable_operator::kvp::Labels;
2+
use yaml_serde::Mapping;
33

44
use crate::platform::operator::ChartSourceType;
55

‎rust/stackable-cockpit/src/platform/stack/spec.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use serde::{Deserialize, Serialize};
2-
use yaml_serde::Mapping;
32
use snafu::{OptionExt, ResultExt, Snafu};
43
use stackable_operator::kvp::{Label, LabelError};
54
use tracing::{Span, debug, info, instrument, log::warn};
65
use tracing_indicatif::span_ext::IndicatifSpanExt as _;
76
#[cfg(feature = "openapi")]
87
use utoipa::ToSchema;
8+
use yaml_serde::Mapping;
99

1010
use crate::{
1111
common::manifest::ManifestSpec,

‎rust/stackablectl/src/cmds/debug.rs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,13 @@ impl AsyncStdin {
335335
}
336336
};
337337
Ok(Self {
338-
fd: AsyncFd::new(stdin).context(AsyncFdStdinSnafu)?,
338+
// SAFETY: `stdin` is a handle to the process-wide standard input. Its file
339+
// descriptor is valid and open, and `Stdin` neither closes nor replaces it, so it
340+
// keeps referring to the same file description for the entire lifetime of the
341+
// `AsyncFd`.
342+
fd: unsafe { AsyncFd::register(stdin) }
343+
.map_err(|err| err.into_parts().1)
344+
.context(AsyncFdStdinSnafu)?,
339345
old_flags,
340346
})
341347
}

‎rust/stackablectl/src/utils.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::env;
22

3-
use yaml_serde::{Mapping, Value};
43
use snafu::{ResultExt, Snafu};
54
use stackable_cockpit::{
65
constants::{HELM_REPO_NAME_DEV, HELM_REPO_NAME_STABLE, HELM_REPO_NAME_TEST},
76
utils::path::PathOrUrl,
87
xfer::{self, processor::Yaml},
98
};
9+
use yaml_serde::{Mapping, Value};
1010

1111
use crate::constants::{HELM_REPO_URL_DEV, HELM_REPO_URL_STABLE, HELM_REPO_URL_TEST};
1212

0 commit comments

Comments
 (0)