Skip to content

Commit

Permalink
minor serialization changes + fn removal in serde_yaml
Browse files Browse the repository at this point in the history
Signed-off-by: clux <[email protected]>
  • Loading branch information
clux committed Apr 8, 2023
1 parent aa6c030 commit 591f75a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/crd_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ async fn verify_url_gen() {
fn verify_default() {
let fdef = FooCrd::default();
let ser = serde_yaml::to_string(&fdef).unwrap();
let exp = r#"---
let exp = r#"
apiVersion: clux.dev/v1
kind: Foo
metadata: {}
spec:
name: ""
name: ''
"#;
assert_eq!(exp, ser);
assert_eq!(exp.trim(), ser.trim());
}
3 changes: 1 addition & 2 deletions kube-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ mod custom_resource;
/// # let client: Client = todo!();
/// let foos: Api<Foo> = Api::default_namespaced(client.clone());
/// let crds: Api<CustomResourceDefinition> = Api::all(client.clone());
/// let crd_yaml = serde_yaml::to_vec(&Foo::crd())?;
/// crds.patch("foos.clux.dev", &PatchParams::apply("myapp"), &Patch::Apply(crd_yaml)).await;
/// crds.patch("foos.clux.dev", &PatchParams::apply("myapp"), &Patch::Apply(Foo::crd())).await;
/// # Ok(())
/// # }
/// ```
Expand Down

0 comments on commit 591f75a

Please sign in to comment.