From a78b59d400c3344aa46c5eb8ba902a2101971e65 Mon Sep 17 00:00:00 2001 From: DMoscicki Date: Thu, 21 Nov 2024 22:03:28 +0300 Subject: [PATCH] docs: :memo: little fixes --- k8s-rs-pb/Cargo.toml | 4 +-- k8s-rs-pb/README.md | 11 +++---- k8s-rs-pb/src/api/admission/mod.rs | 2 +- .../src/api/admissionregistration/mod.rs | 2 +- k8s-rs-pb/src/api/apidiscovery/mod.rs | 2 +- k8s-rs-pb/src/api/authentication/mod.rs | 2 +- k8s-rs-pb/src/api/autoscaling/mod.rs | 4 +-- k8s-rs-pb/src/api/certificates/mod.rs | 2 +- k8s-rs-pb/src/api/coordination/mod.rs | 2 +- k8s-rs-pb/src/api/flowcontrol/mod.rs | 2 +- k8s-rs-pb/src/api/mod.rs | 32 +++++++++---------- k8s-rs-pb/src/api/networking/mod.rs | 2 +- k8s-rs-pb/src/api/node/mod.rs | 2 +- k8s-rs-pb/src/api/policy/mod.rs | 2 +- k8s-rs-pb/src/api/rbac/mod.rs | 2 +- k8s-rs-pb/src/api/storage/mod.rs | 2 +- .../pkg/apis/apiextensions/mod.rs | 2 +- k8s-rs-pb/src/apimachinery/pkg/apis/mod.rs | 2 +- k8s-rs-pb/src/metrics/pkg/apis/mod.rs | 2 +- 19 files changed, 40 insertions(+), 41 deletions(-) diff --git a/k8s-rs-pb/Cargo.toml b/k8s-rs-pb/Cargo.toml index bccbbd7..09d7f36 100644 --- a/k8s-rs-pb/Cargo.toml +++ b/k8s-rs-pb/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "k8s-rs-pb" -version = "0.1.1" +version = "0.1.2" authors = ["Dmitriy Mastitskiy "] edition = "2021" license = "MIT" homepage = "https://github.com/DMoscicki/k8s-rs-pb/" repository = "https://github.com/DMoscicki/k8s-rs-pb/" documentation = "https://github.com/DMoscicki/k8s-rs-pb/blob/master/README.md" -description = "Converted from k8s-openapi to rust-protobuf" +description = "Converter from k8s-openapi to rust-protobuf" publish = true [dependencies] diff --git a/k8s-rs-pb/README.md b/k8s-rs-pb/README.md index d139c93..517aa76 100644 --- a/k8s-rs-pb/README.md +++ b/k8s-rs-pb/README.md @@ -4,12 +4,11 @@ In the future I will add Serialize to custom_date. At this time i only need the Deserialize (i don't like to work with JSON). ``` -use k8s-rs-pb::api::core::v1::{Node, Pod, PodList, Event}; -use k8s_openapi::api::core::v1::{Event as OtherEvent, Node as OtherNode, Pod as OtherPod}; + use k8s_rs_pb::api::core::v1::Pod; + use k8s_openapi::api::core::v1::Pod as OtherPod; -let pod_openapi = OtherPod::default(); + let pod_openapi = OtherPod::default(); + let pod_pb: Pod = k8s_rs_pb::converter::from_openapi(pod_openapi).unwrap(); -let pod_pb: Pod = converter::from_openapi(pod_openapi).unwrap(); - -assert_eq!(pod_pb.has_metadata(), true); + assert_eq!(pod_pb.has_metadata(), true); ``` \ No newline at end of file diff --git a/k8s-rs-pb/src/api/admission/mod.rs b/k8s-rs-pb/src/api/admission/mod.rs index 517ec85..7b54daa 100644 --- a/k8s-rs-pb/src/api/admission/mod.rs +++ b/k8s-rs-pb/src/api/admission/mod.rs @@ -1,2 +1,2 @@ -pub mod v1; pub mod v1beta1; +pub mod v1; diff --git a/k8s-rs-pb/src/api/admissionregistration/mod.rs b/k8s-rs-pb/src/api/admissionregistration/mod.rs index 14c87d0..31012da 100644 --- a/k8s-rs-pb/src/api/admissionregistration/mod.rs +++ b/k8s-rs-pb/src/api/admissionregistration/mod.rs @@ -1,3 +1,3 @@ pub mod v1beta1; -pub mod v1alpha1; pub mod v1; +pub mod v1alpha1; diff --git a/k8s-rs-pb/src/api/apidiscovery/mod.rs b/k8s-rs-pb/src/api/apidiscovery/mod.rs index b690644..591615b 100644 --- a/k8s-rs-pb/src/api/apidiscovery/mod.rs +++ b/k8s-rs-pb/src/api/apidiscovery/mod.rs @@ -1,2 +1,2 @@ -pub mod v2; pub mod v2beta1; +pub mod v2; diff --git a/k8s-rs-pb/src/api/authentication/mod.rs b/k8s-rs-pb/src/api/authentication/mod.rs index 14c87d0..0b1ff06 100644 --- a/k8s-rs-pb/src/api/authentication/mod.rs +++ b/k8s-rs-pb/src/api/authentication/mod.rs @@ -1,3 +1,3 @@ -pub mod v1beta1; pub mod v1alpha1; pub mod v1; +pub mod v1beta1; diff --git a/k8s-rs-pb/src/api/autoscaling/mod.rs b/k8s-rs-pb/src/api/autoscaling/mod.rs index 7fae8af..de55c39 100644 --- a/k8s-rs-pb/src/api/autoscaling/mod.rs +++ b/k8s-rs-pb/src/api/autoscaling/mod.rs @@ -1,4 +1,4 @@ -pub mod v1; pub mod v2beta2; -pub mod v2; pub mod v2beta1; +pub mod v2; +pub mod v1; diff --git a/k8s-rs-pb/src/api/certificates/mod.rs b/k8s-rs-pb/src/api/certificates/mod.rs index 14c87d0..fe4743b 100644 --- a/k8s-rs-pb/src/api/certificates/mod.rs +++ b/k8s-rs-pb/src/api/certificates/mod.rs @@ -1,3 +1,3 @@ -pub mod v1beta1; pub mod v1alpha1; +pub mod v1beta1; pub mod v1; diff --git a/k8s-rs-pb/src/api/coordination/mod.rs b/k8s-rs-pb/src/api/coordination/mod.rs index 7b54daa..517ec85 100644 --- a/k8s-rs-pb/src/api/coordination/mod.rs +++ b/k8s-rs-pb/src/api/coordination/mod.rs @@ -1,2 +1,2 @@ -pub mod v1beta1; pub mod v1; +pub mod v1beta1; diff --git a/k8s-rs-pb/src/api/flowcontrol/mod.rs b/k8s-rs-pb/src/api/flowcontrol/mod.rs index 3a97d8c..9044134 100644 --- a/k8s-rs-pb/src/api/flowcontrol/mod.rs +++ b/k8s-rs-pb/src/api/flowcontrol/mod.rs @@ -1,4 +1,4 @@ pub mod v1beta3; -pub mod v1beta2; pub mod v1beta1; +pub mod v1beta2; pub mod v1; diff --git a/k8s-rs-pb/src/api/mod.rs b/k8s-rs-pb/src/api/mod.rs index e7a048f..d41d798 100644 --- a/k8s-rs-pb/src/api/mod.rs +++ b/k8s-rs-pb/src/api/mod.rs @@ -1,25 +1,25 @@ +pub mod apiserverinternal; pub mod core; -pub mod certificates; pub mod coordination; -pub mod networking; -pub mod authorization; +pub mod discovery; +pub mod certificates; +pub mod apidiscovery; +pub mod policy; pub mod autoscaling; -pub mod node; +pub mod admission; pub mod batch; -pub mod flowcontrol; -pub mod imagepolicy; +pub mod node; +pub mod admissionregistration; +pub mod apps; pub mod authentication; pub mod extensions; -pub mod events; -pub mod apps; +pub mod networking; +pub mod authorization; pub mod scheduling; -pub mod discovery; -pub mod apiserverinternal; +pub mod events; +pub mod imagepolicy; +pub mod flowcontrol; pub mod rbac; -pub mod resource; -pub mod apidiscovery; -pub mod admission; -pub mod storage; -pub mod policy; pub mod storagemigration; -pub mod admissionregistration; +pub mod storage; +pub mod resource; diff --git a/k8s-rs-pb/src/api/networking/mod.rs b/k8s-rs-pb/src/api/networking/mod.rs index 0b1ff06..14c87d0 100644 --- a/k8s-rs-pb/src/api/networking/mod.rs +++ b/k8s-rs-pb/src/api/networking/mod.rs @@ -1,3 +1,3 @@ +pub mod v1beta1; pub mod v1alpha1; pub mod v1; -pub mod v1beta1; diff --git a/k8s-rs-pb/src/api/node/mod.rs b/k8s-rs-pb/src/api/node/mod.rs index 14c87d0..31012da 100644 --- a/k8s-rs-pb/src/api/node/mod.rs +++ b/k8s-rs-pb/src/api/node/mod.rs @@ -1,3 +1,3 @@ pub mod v1beta1; -pub mod v1alpha1; pub mod v1; +pub mod v1alpha1; diff --git a/k8s-rs-pb/src/api/policy/mod.rs b/k8s-rs-pb/src/api/policy/mod.rs index 7b54daa..517ec85 100644 --- a/k8s-rs-pb/src/api/policy/mod.rs +++ b/k8s-rs-pb/src/api/policy/mod.rs @@ -1,2 +1,2 @@ -pub mod v1beta1; pub mod v1; +pub mod v1beta1; diff --git a/k8s-rs-pb/src/api/rbac/mod.rs b/k8s-rs-pb/src/api/rbac/mod.rs index 31012da..14c87d0 100644 --- a/k8s-rs-pb/src/api/rbac/mod.rs +++ b/k8s-rs-pb/src/api/rbac/mod.rs @@ -1,3 +1,3 @@ pub mod v1beta1; -pub mod v1; pub mod v1alpha1; +pub mod v1; diff --git a/k8s-rs-pb/src/api/storage/mod.rs b/k8s-rs-pb/src/api/storage/mod.rs index 14c87d0..31012da 100644 --- a/k8s-rs-pb/src/api/storage/mod.rs +++ b/k8s-rs-pb/src/api/storage/mod.rs @@ -1,3 +1,3 @@ pub mod v1beta1; -pub mod v1alpha1; pub mod v1; +pub mod v1alpha1; diff --git a/k8s-rs-pb/src/apiextensions_apiserver/pkg/apis/apiextensions/mod.rs b/k8s-rs-pb/src/apiextensions_apiserver/pkg/apis/apiextensions/mod.rs index 7b54daa..517ec85 100644 --- a/k8s-rs-pb/src/apiextensions_apiserver/pkg/apis/apiextensions/mod.rs +++ b/k8s-rs-pb/src/apiextensions_apiserver/pkg/apis/apiextensions/mod.rs @@ -1,2 +1,2 @@ -pub mod v1beta1; pub mod v1; +pub mod v1beta1; diff --git a/k8s-rs-pb/src/apimachinery/pkg/apis/mod.rs b/k8s-rs-pb/src/apimachinery/pkg/apis/mod.rs index f30d9a3..2fbcba1 100644 --- a/k8s-rs-pb/src/apimachinery/pkg/apis/mod.rs +++ b/k8s-rs-pb/src/apimachinery/pkg/apis/mod.rs @@ -1,2 +1,2 @@ -pub mod meta; pub mod testapigroup; +pub mod meta; diff --git a/k8s-rs-pb/src/metrics/pkg/apis/mod.rs b/k8s-rs-pb/src/metrics/pkg/apis/mod.rs index 24e8e42..0a9e88d 100644 --- a/k8s-rs-pb/src/metrics/pkg/apis/mod.rs +++ b/k8s-rs-pb/src/metrics/pkg/apis/mod.rs @@ -1,3 +1,3 @@ -pub mod external_metrics; pub mod metrics; pub mod custom_metrics; +pub mod external_metrics;