Skip to content

chore: Remove instrumentation from trivial functions #1023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions crates/stackable-operator/src/builder/pod/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use k8s_openapi::api::core::v1::{
SecurityContext, VolumeMount,
};
use snafu::{ResultExt as _, Snafu};
use tracing::instrument;
#[cfg(doc)]
use {k8s_openapi::api::core::v1::PodSpec, std::collections::BTreeMap};

Expand Down Expand Up @@ -211,7 +210,6 @@ impl ContainerBuilder {
///
/// Previously, this function unconditionally added [`VolumeMount`]s, which resulted in invalid
/// [`PodSpec`]s.
#[instrument(skip(self))]
fn add_volume_mount_impl(&mut self, volume_mount: VolumeMount) -> Result<&mut Self> {
if let Some(existing_volume_mount) = self.volume_mounts.get(&volume_mount.mount_path) {
if existing_volume_mount != &volume_mount {
Expand Down
10 changes: 4 additions & 6 deletions crates/stackable-operator/src/builder/pod/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use k8s_openapi::{
apimachinery::pkg::{api::resource::Quantity, apis::meta::v1::ObjectMeta},
};
use snafu::{OptionExt, ResultExt, Snafu};
use tracing::{instrument, warn};

use crate::{
builder::{
Expand Down Expand Up @@ -291,7 +290,6 @@ impl PodBuilder {
///
/// Previously, this function unconditionally added [`Volume`]s, which resulted in invalid
/// [`PodSpec`]s.
#[instrument(skip(self))]
pub fn add_volume(&mut self, volume: Volume) -> Result<&mut Self> {
if let Some(existing_volume) = self.volumes.get(&volume.name) {
if existing_volume != &volume {
Expand Down Expand Up @@ -610,19 +608,19 @@ impl PodBuilder {

pod_spec
.check_resource_requirement(ResourceRequirementsType::Limits, "cpu")
.unwrap_or_else(|err| warn!("{}", err));
.unwrap_or_else(|err| tracing::warn!("{err}"));

pod_spec
.check_resource_requirement(ResourceRequirementsType::Limits, "memory")
.unwrap_or_else(|err| warn!("{}", err));
.unwrap_or_else(|err| tracing::warn!("{err}"));

pod_spec
.check_limit_to_request_ratio(&ComputeResource::Cpu, LIMIT_REQUEST_RATIO_CPU)
.unwrap_or_else(|err| warn!("{}", err));
.unwrap_or_else(|err| tracing::warn!("{err}"));

pod_spec
.check_limit_to_request_ratio(&ComputeResource::Memory, LIMIT_REQUEST_RATIO_MEMORY)
.unwrap_or_else(|err| warn!("{}", err));
.unwrap_or_else(|err| tracing::warn!("{err}"));

pod_spec
}
Expand Down