Skip to content

Commit 3e5b3ba

Browse files
authored
fix(stackable-versioned): Generate Kubernetes code independent of container order (#913)
* fix(stackable-versioned): Generate Kubernetes code independent of container order * chore: Update changelog * chore: Remove superfluous iter() calls
1 parent 5b152c7 commit 3e5b3ba

File tree

7 files changed

+157
-225
lines changed

7 files changed

+157
-225
lines changed

crates/stackable-versioned-macros/fixtures/inputs/k8s/module.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
)]
66
// ---
77
pub(crate) mod versioned {
8+
// This struct is placed before the FooSpec one to ensure that the Kubernetes code generation
9+
// works no matter the order.
10+
pub struct Baz {
11+
boom: Option<u16>,
12+
}
13+
814
#[versioned(k8s(group = "foo.example.org", plural = "foos", namespaced))]
915
pub struct FooSpec {
1016
bar: usize,
@@ -21,7 +27,8 @@ pub(crate) mod versioned {
2127
baz: String,
2228
}
2329

24-
pub struct Baz {
25-
boom: Option<u16>,
30+
pub enum Boom {
31+
Big,
32+
Shaq,
2633
}
2734
}

crates/stackable-versioned-macros/fixtures/inputs/k8s/module_preserve.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
)]
77
// ---
88
pub(crate) mod versioned {
9+
// This struct is placed before the FooSpec one to ensure that the Kubernetes code generation
10+
// works no matter the order.
11+
pub struct Baz {
12+
boom: Option<u16>,
13+
}
14+
915
#[versioned(k8s(group = "foo.example.org", plural = "foos", namespaced))]
1016
pub struct FooSpec {
1117
bar: usize,
@@ -22,7 +28,8 @@ pub(crate) mod versioned {
2228
baz: String,
2329
}
2430

25-
pub struct Baz {
26-
boom: Option<u16>,
31+
pub enum Boom {
32+
Big,
33+
Shaq,
2734
}
2835
}

crates/stackable-versioned-macros/fixtures/snapshots/stackable_versioned_macros__test__k8s_snapshots@module.rs.snap

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

0 commit comments

Comments
 (0)