Skip to content

Commit 9f24ebf

Browse files
authored
Implemented crdgen json output (#59)
* chore: implemented crdgen json output * chore: implemented crdgen json output
1 parent 38faae6 commit 9f24ebf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

operator/src/crdgen.rs

+11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1+
use std::env::args;
2+
13
use kube::CustomResourceExt;
24
use operator::controller;
35

46
fn main() {
7+
let args: Vec<String> = args().collect();
8+
if args.len() > 1 && args[1] == "json" {
9+
print!(
10+
"{}",
11+
serde_json::to_string_pretty(&controller::CardanoNodePort::crd()).unwrap()
12+
);
13+
return;
14+
}
15+
516
print!(
617
"{}",
718
serde_yaml::to_string(&controller::CardanoNodePort::crd()).unwrap()

0 commit comments

Comments
 (0)