Skip to content

Commit

Permalink
Add test for not supported union in CRD
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
  • Loading branch information
sbernauer committed Mar 24, 2022
1 parent ed8f12b commit c6d1b6a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kube-derive/tests/ui/union_fails.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use kube_derive::CustomResource;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(CustomResource, Serialize, Deserialize, JsonSchema)]
union FooSpec {
int: u32,
}

fn main() {}
13 changes: 13 additions & 0 deletions kube-derive/tests/ui/union_fails.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error: Unions can not #[derive(CustomResource)]
--> tests/ui/union_fails.rs:6:7
|
6 | union FooSpec {
| ^^^^^^^

error: Serde does not support derive for unions
--> tests/ui/union_fails.rs:6:1
|
6 | / union FooSpec {
7 | | int: u32,
8 | | }
| |_^

0 comments on commit c6d1b6a

Please sign in to comment.