1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
use serde::Deserialize; use serde::Serialize; use k8_obj_metadata::Crd; use k8_obj_metadata::CrdNames; use k8_obj_metadata::Spec; use k8_obj_metadata::Status; use k8_obj_metadata::DefaultHeader; use k8_obj_metadata::default_store_spec; const API: Crd = Crd { group: "core", version: "v1", names: CrdNames { kind: "Namespace", plural: "namespaces", singular: "namespace", }, }; #[derive(Deserialize, Serialize, Debug, Default, Clone)] #[serde(rename_all = "camelCase")] pub struct NamespaceSpec { } impl Spec for NamespaceSpec { type Status = NamespaceStatus; type Header = DefaultHeader; const NAME_SPACED: bool = false; fn metadata() -> &'static Crd { &API } } default_store_spec!(NamespaceSpec,NamespaceStatus,"Namespace"); #[derive(Deserialize, Serialize, PartialEq,Debug, Default, Clone)] #[serde(rename_all = "camelCase",default)] pub struct NamespaceStatus { pub phase: String } impl Status for NamespaceStatus{}