Skip to content

Commit 08c6bc1

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/support-sans
2 parents 70dc741 + bc58ff9 commit 08c6bc1

File tree

57 files changed

+1512
-398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1512
-398
lines changed

Cargo.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/k8s-version/src/api_version/serde.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ impl<'de> Deserialize<'de> for ApiVersion {
1111
{
1212
struct ApiVersionVisitor;
1313

14-
impl<'de> Visitor<'de> for ApiVersionVisitor {
14+
impl Visitor<'_> for ApiVersionVisitor {
1515
type Value = ApiVersion;
1616

1717
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {

crates/k8s-version/src/level/serde.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ impl<'de> Deserialize<'de> for Level {
1111
{
1212
struct LevelVisitor;
1313

14-
impl<'de> Visitor<'de> for LevelVisitor {
14+
impl Visitor<'_> for LevelVisitor {
1515
type Value = Level;
1616

1717
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {

crates/k8s-version/src/version/serde.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ impl<'de> Deserialize<'de> for Version {
1111
{
1212
struct VersionVisitor;
1313

14-
impl<'de> Visitor<'de> for VersionVisitor {
14+
impl Visitor<'_> for VersionVisitor {
1515
type Value = Version;
1616

1717
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {

crates/stackable-operator/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Removed
8+
9+
- Remove instrumenation from uninteresting funtions ([#1023]).
10+
11+
[#1023]: https://github.com/stackabletech/operator-rs/pull/1023
12+
713
## [0.93.1] - 2025-05-20
814

915
### Added
@@ -23,6 +29,7 @@ All notable changes to this project will be documented in this file.
2329
- Import are now more granular in general.
2430
- BREAKING: Update to `kube` to `1.0.0` and `k8s-openapi` to `0.25.0`.
2531
Use k8s `1.33` for compilation ([#1037]).
32+
- Separate some developer docs from CRD descriptions ([#1040]).
2633

2734
### Fixed
2835

@@ -33,6 +40,7 @@ All notable changes to this project will be documented in this file.
3340
[#1025]: https://github.com/stackabletech/operator-rs/pull/1025
3441
[#1029]: https://github.com/stackabletech/operator-rs/pull/1029
3542
[#1037]: https://github.com/stackabletech/operator-rs/pull/1037
43+
[#1040]: https://github.com/stackabletech/operator-rs/pull/1040
3644

3745
## [0.92.0] - 2025-04-14
3846

crates/stackable-operator/src/builder/pod/container.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use k8s_openapi::api::core::v1::{
77
SecurityContext, VolumeMount,
88
};
99
use snafu::{ResultExt as _, Snafu};
10-
use tracing::instrument;
1110
#[cfg(doc)]
1211
use {k8s_openapi::api::core::v1::PodSpec, std::collections::BTreeMap};
1312

@@ -211,7 +210,6 @@ impl ContainerBuilder {
211210
///
212211
/// Previously, this function unconditionally added [`VolumeMount`]s, which resulted in invalid
213212
/// [`PodSpec`]s.
214-
#[instrument(skip(self))]
215213
fn add_volume_mount_impl(&mut self, volume_mount: VolumeMount) -> Result<&mut Self> {
216214
if let Some(existing_volume_mount) = self.volume_mounts.get(&volume_mount.mount_path) {
217215
if existing_volume_mount != &volume_mount {

crates/stackable-operator/src/builder/pod/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use k8s_openapi::{
1010
apimachinery::pkg::{api::resource::Quantity, apis::meta::v1::ObjectMeta},
1111
};
1212
use snafu::{OptionExt, ResultExt, Snafu};
13-
use tracing::{instrument, warn};
1413

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

611609
pod_spec
612610
.check_resource_requirement(ResourceRequirementsType::Limits, "cpu")
613-
.unwrap_or_else(|err| warn!("{}", err));
611+
.unwrap_or_else(|err| tracing::warn!("{err}"));
614612

615613
pod_spec
616614
.check_resource_requirement(ResourceRequirementsType::Limits, "memory")
617-
.unwrap_or_else(|err| warn!("{}", err));
615+
.unwrap_or_else(|err| tracing::warn!("{err}"));
618616

619617
pod_spec
620618
.check_limit_to_request_ratio(&ComputeResource::Cpu, LIMIT_REQUEST_RATIO_CPU)
621-
.unwrap_or_else(|err| warn!("{}", err));
619+
.unwrap_or_else(|err| tracing::warn!("{err}"));
622620

623621
pod_spec
624622
.check_limit_to_request_ratio(&ComputeResource::Memory, LIMIT_REQUEST_RATIO_MEMORY)
625-
.unwrap_or_else(|err| warn!("{}", err));
623+
.unwrap_or_else(|err| tracing::warn!("{err}"));
626624

627625
pod_spec
628626
}

crates/stackable-versioned-macros/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ quote.workspace = true
4343
[dev-dependencies]
4444
# Only needed for doc tests / examples
4545
stackable-versioned = { path = "../stackable-versioned", features = ["k8s"] }
46-
k8s-openapi.workspace = true
4746

4847
insta.workspace = true
4948
prettyplease.workspace = true

crates/stackable-versioned-macros/src/attrs/item/mod.rs

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,26 @@ impl CommonItemAttributes {
238238
}
239239
}
240240

241-
// The convert_with argument only makes sense to use when the
242-
// type changed
243-
if let Some(convert_func) = change.convert_with.as_ref() {
244-
if change.from_type.is_none() {
241+
if change.from_type.is_none() {
242+
// The upgrade_with argument only makes sense to use when the
243+
// type changed
244+
if let Some(upgrade_func) = change.upgrade_with.as_ref() {
245245
errors.push(
246246
Error::custom(
247-
"the `convert_with` argument must be used in combination with `from_type`",
247+
"the `upgrade_with` argument must be used in combination with `from_type`",
248248
)
249-
.with_span(&convert_func.span()),
249+
.with_span(&upgrade_func.span()),
250+
);
251+
}
252+
253+
// The downgrade_with argument only makes sense to use when the
254+
// type changed
255+
if let Some(downgrade_func) = change.downgrade_with.as_ref() {
256+
errors.push(
257+
Error::custom(
258+
"the `downgrade_with` argument must be used in combination with `from_type`",
259+
)
260+
.with_span(&downgrade_func.span()),
250261
);
251262
}
252263
}
@@ -315,7 +326,8 @@ impl CommonItemAttributes {
315326
.unwrap_or(ty.clone());
316327

317328
actions.insert(*change.since, ItemStatus::Change {
318-
convert_with: change.convert_with.as_deref().cloned(),
329+
downgrade_with: change.downgrade_with.as_deref().cloned(),
330+
upgrade_with: change.upgrade_with.as_deref().cloned(),
319331
from_ident: from_ident.clone(),
320332
from_type: from_ty.clone(),
321333
to_ident: ident,
@@ -359,7 +371,8 @@ impl CommonItemAttributes {
359371
.unwrap_or(ty.clone());
360372

361373
actions.insert(*change.since, ItemStatus::Change {
362-
convert_with: change.convert_with.as_deref().cloned(),
374+
downgrade_with: change.downgrade_with.as_deref().cloned(),
375+
upgrade_with: change.upgrade_with.as_deref().cloned(),
363376
from_ident: from_ident.clone(),
364377
from_type: from_ty.clone(),
365378
to_ident: ident,
@@ -429,13 +442,15 @@ fn default_default_fn() -> SpannedValue<Path> {
429442
/// Example usage:
430443
/// - `changed(since = "...", from_name = "...")`
431444
/// - `changed(since = "...", from_name = "...", from_type="...")`
432-
/// - `changed(since = "...", from_name = "...", from_type="...", convert_with = "...")`
445+
/// - `changed(since = "...", from_name = "...", from_type="...", upgrade_with = "...")`
446+
/// - `changed(since = "...", from_name = "...", from_type="...", downgrade_with = "...")`
433447
#[derive(Clone, Debug, FromMeta)]
434448
pub struct ChangedAttributes {
435449
pub since: SpannedValue<Version>,
436450
pub from_name: Option<SpannedValue<String>>,
437451
pub from_type: Option<SpannedValue<Type>>,
438-
pub convert_with: Option<SpannedValue<Path>>,
452+
pub upgrade_with: Option<SpannedValue<Path>>,
453+
pub downgrade_with: Option<SpannedValue<Path>>,
439454
}
440455

441456
/// For the deprecated() action

crates/stackable-versioned-macros/src/attrs/k8s.rs

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,30 @@ use syn::Path;
2222
/// times.
2323
/// - `skip`: Controls skipping parts of the generation.
2424
#[derive(Clone, Debug, FromMeta)]
25-
pub(crate) struct KubernetesArguments {
26-
pub(crate) group: String,
27-
pub(crate) kind: Option<String>,
28-
pub(crate) singular: Option<String>,
29-
pub(crate) plural: Option<String>,
30-
pub(crate) namespaced: Flag,
25+
pub struct KubernetesArguments {
26+
pub group: String,
27+
pub kind: Option<String>,
28+
pub singular: Option<String>,
29+
pub plural: Option<String>,
30+
pub namespaced: Flag,
3131
// root
32-
pub(crate) crates: Option<KubernetesCrateArguments>,
33-
pub(crate) status: Option<Path>,
32+
pub crates: Option<KubernetesCrateArguments>,
33+
pub status: Option<Path>,
3434
// derive
3535
// schema
3636
// scale
3737
// printcolumn
3838
#[darling(multiple, rename = "shortname")]
39-
pub(crate) shortnames: Vec<String>,
39+
pub shortnames: Vec<String>,
4040
// category
4141
// selectable
4242
// doc
4343
// annotation
4444
// label
45-
pub(crate) skip: Option<KubernetesSkipArguments>,
45+
pub skip: Option<KubernetesSkipArguments>,
46+
47+
#[darling(default)]
48+
pub options: RawKubernetesOptions,
4649
}
4750

4851
/// This struct contains supported kubernetes skip arguments.
@@ -52,19 +55,25 @@ pub(crate) struct KubernetesArguments {
5255
/// - `merged_crd` flag, which skips generating the `crd()` and `merged_crd()` functions are
5356
/// generated.
5457
#[derive(Clone, Debug, FromMeta)]
55-
pub(crate) struct KubernetesSkipArguments {
58+
pub struct KubernetesSkipArguments {
5659
/// Whether the `crd()` and `merged_crd()` generation should be skipped for
5760
/// this container.
58-
pub(crate) merged_crd: Flag,
61+
pub merged_crd: Flag,
5962
}
6063

6164
/// This struct contains crate overrides to be passed to `#[kube]`.
6265
#[derive(Clone, Debug, FromMeta)]
63-
pub(crate) struct KubernetesCrateArguments {
64-
pub(crate) kube_core: Option<Path>,
65-
pub(crate) kube_client: Option<Path>,
66-
pub(crate) k8s_openapi: Option<Path>,
67-
pub(crate) schemars: Option<Path>,
68-
pub(crate) serde: Option<Path>,
69-
pub(crate) serde_json: Option<Path>,
66+
pub struct KubernetesCrateArguments {
67+
pub kube_core: Option<Path>,
68+
pub kube_client: Option<Path>,
69+
pub k8s_openapi: Option<Path>,
70+
pub schemars: Option<Path>,
71+
pub serde: Option<Path>,
72+
pub serde_json: Option<Path>,
73+
pub versioned: Option<Path>,
74+
}
75+
76+
#[derive(Clone, Default, Debug, FromMeta)]
77+
pub struct RawKubernetesOptions {
78+
pub experimental_conversion_tracking: Flag,
7079
}

0 commit comments

Comments
 (0)