From 038a8301fc583aba4e71e5991b6a9e0d6702d93f Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Fri, 25 Apr 2025 14:22:47 +0200 Subject: [PATCH 1/4] chore: Remove instrumentation from trivial functions Note: These functions are not cpu/io bound, so they are rather uninteresting in the context of tracing. --- crates/stackable-operator/src/builder/pod/container.rs | 2 -- crates/stackable-operator/src/builder/pod/mod.rs | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/stackable-operator/src/builder/pod/container.rs b/crates/stackable-operator/src/builder/pod/container.rs index fc5cafec..7ab5cbc5 100644 --- a/crates/stackable-operator/src/builder/pod/container.rs +++ b/crates/stackable-operator/src/builder/pod/container.rs @@ -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}; @@ -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 { diff --git a/crates/stackable-operator/src/builder/pod/mod.rs b/crates/stackable-operator/src/builder/pod/mod.rs index 03aab690..f94e802c 100644 --- a/crates/stackable-operator/src/builder/pod/mod.rs +++ b/crates/stackable-operator/src/builder/pod/mod.rs @@ -10,7 +10,7 @@ use k8s_openapi::{ apimachinery::pkg::{api::resource::Quantity, apis::meta::v1::ObjectMeta}, }; use snafu::{OptionExt, ResultExt, Snafu}; -use tracing::{instrument, warn}; +use tracing::warn; use crate::{ builder::{ @@ -291,7 +291,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 { From 67adc8e111af16cd58678956e736b6ad0a3f3ef7 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Fri, 25 Apr 2025 14:25:44 +0200 Subject: [PATCH 2/4] chore: Use fully-qualified tracing::warn! --- crates/stackable-operator/src/builder/pod/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/stackable-operator/src/builder/pod/mod.rs b/crates/stackable-operator/src/builder/pod/mod.rs index f94e802c..197a8517 100644 --- a/crates/stackable-operator/src/builder/pod/mod.rs +++ b/crates/stackable-operator/src/builder/pod/mod.rs @@ -10,7 +10,6 @@ use k8s_openapi::{ apimachinery::pkg::{api::resource::Quantity, apis::meta::v1::ObjectMeta}, }; use snafu::{OptionExt, ResultExt, Snafu}; -use tracing::warn; use crate::{ builder::{ @@ -609,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 } From 1b8fe0c26f25a5d70ef8b6c847717e96b9b47a5d Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 21 May 2025 15:05:12 +0200 Subject: [PATCH 3/4] chore: Update changelog --- crates/stackable-operator/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index 8c5dcb8f..155b94b1 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Removed + +- Remove instrumenation from uninteresting funtions ([#1023]). + +[#1023]: https://github.com/stackabletech/operator-rs/pull/1023 + ## [0.93.1] - 2025-05-20 ### Added From 630341fdccdf915d45870d614ff5962c9c328fc0 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 21 May 2025 15:05:34 +0200 Subject: [PATCH 4/4] chore: Add missing changelog entry --- crates/stackable-operator/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index 155b94b1..2de9d7aa 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file. - Import are now more granular in general. - BREAKING: Update to `kube` to `1.0.0` and `k8s-openapi` to `0.25.0`. Use k8s `1.33` for compilation ([#1037]). +- Separate some developer docs from CRD descriptions ([#1040]). ### Fixed @@ -39,6 +40,7 @@ All notable changes to this project will be documented in this file. [#1025]: https://github.com/stackabletech/operator-rs/pull/1025 [#1029]: https://github.com/stackabletech/operator-rs/pull/1029 [#1037]: https://github.com/stackabletech/operator-rs/pull/1037 +[#1040]: https://github.com/stackabletech/operator-rs/pull/1040 ## [0.92.0] - 2025-04-14