Skip to content

Commit d825f20

Browse files
authored
Move prost generation from HashMap to BTreeMap (#48)
to match k8s-openapi
2 parents f9b2b4d + cdaea7a commit d825f20

File tree

32 files changed

+178
-166
lines changed

32 files changed

+178
-166
lines changed

k8s-pb-codegen/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ fn main() -> Result<()> {
3333
let tmp_dir = root.join("./tmp");
3434
let descriptor_file = tmp_dir.join("protos.fds");
3535
prost_build::Config::new()
36-
// should probably switch to this
37-
//.btree_map(&["."])
36+
.btree_map(&["."])
3837
.out_dir(&tmp_dir)
3938
.file_descriptor_set_path(&descriptor_file)
4039
.compile_protos(protos.as_slice(), &["protos/"])?;

k8s-pb/src/api/admission/v1/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ pub struct AdmissionResponse {
120120
/// admission webhook name (e.g. imagepolicy.example.com/error=image-blacklisted). AuditAnnotations will be provided by
121121
/// the admission webhook to add additional context to the audit log for this request.
122122
/// +optional
123-
#[prost(map = "string, string", tag = "6")]
123+
#[prost(btree_map = "string, string", tag = "6")]
124124
pub audit_annotations:
125-
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
125+
::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
126126
/// warnings is a list of warning messages to return to the requesting API client.
127127
/// Warning messages describe a problem the client making the API request should correct or be aware of.
128128
/// Limit warnings to 120 characters if possible.

k8s-pb/src/api/admission/v1beta1/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ pub struct AdmissionResponse {
120120
/// admission webhook name (e.g. imagepolicy.example.com/error=image-blacklisted). AuditAnnotations will be provided by
121121
/// the admission webhook to add additional context to the audit log for this request.
122122
/// +optional
123-
#[prost(map = "string, string", tag = "6")]
123+
#[prost(btree_map = "string, string", tag = "6")]
124124
pub audit_annotations:
125-
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
125+
::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
126126
/// warnings is a list of warning messages to return to the requesting API client.
127127
/// Warning messages describe a problem the client making the API request should correct or be aware of.
128128
/// Limit warnings to 120 characters if possible.

k8s-pb/src/api/apps/v1beta1/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ pub struct DeploymentRollback {
9797
pub name: ::core::option::Option<::prost::alloc::string::String>,
9898
/// The annotations to be updated to a deployment
9999
/// +optional
100-
#[prost(map = "string, string", tag = "2")]
100+
#[prost(btree_map = "string, string", tag = "2")]
101101
pub updated_annotations:
102-
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
102+
::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
103103
/// The config of this deployment rollback.
104104
#[prost(message, optional, tag = "3")]
105105
pub rollback_to: ::core::option::Option<RollbackConfig>,
@@ -309,8 +309,9 @@ pub struct ScaleStatus {
309309
pub replicas: ::core::option::Option<i32>,
310310
/// selector is a label query over pods that should match the replicas count. More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/>
311311
/// +optional
312-
#[prost(map = "string, string", tag = "2")]
313-
pub selector: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
312+
#[prost(btree_map = "string, string", tag = "2")]
313+
pub selector:
314+
::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
314315
/// targetSelector is the label selector for pods that should match the replicas count. This is a serializated
315316
/// version of both map-based and more expressive set-based selectors. This is done to
316317
/// avoid introspection in the clients. The string will be in the same format as the

k8s-pb/src/api/apps/v1beta2/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,9 @@ pub struct ScaleStatus {
615615
/// selector is a label query over pods that should match the replicas count. More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/>
616616
/// +optional
617617
/// +mapType=atomic
618-
#[prost(map = "string, string", tag = "2")]
619-
pub selector: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
618+
#[prost(btree_map = "string, string", tag = "2")]
619+
pub selector:
620+
::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
620621
/// label selector for pods that should match the replicas count. This is a serializated
621622
/// version of both map-based and more expressive set-based selectors. This is done to
622623
/// avoid introspection in the clients. The string will be in the same format as the

k8s-pb/src/api/authentication/v1/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ pub struct UserInfo {
190190
pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
191191
/// Any additional information provided by the authenticator.
192192
/// +optional
193-
#[prost(map = "string, message", tag = "4")]
194-
pub extra: ::std::collections::HashMap<::prost::alloc::string::String, ExtraValue>,
193+
#[prost(btree_map = "string, message", tag = "4")]
194+
pub extra: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ExtraValue>,
195195
}
196196

197197
impl crate::Resource for SelfSubjectReview {

k8s-pb/src/api/authentication/v1beta1/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ pub struct UserInfo {
116116
pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
117117
/// Any additional information provided by the authenticator.
118118
/// +optional
119-
#[prost(map = "string, message", tag = "4")]
120-
pub extra: ::std::collections::HashMap<::prost::alloc::string::String, ExtraValue>,
119+
#[prost(btree_map = "string, message", tag = "4")]
120+
pub extra: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ExtraValue>,
121121
}
122122

123123
impl crate::Resource for SelfSubjectReview {

k8s-pb/src/api/authorization/v1/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ pub struct SubjectAccessReviewSpec {
289289
/// Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer
290290
/// it needs a reflection here.
291291
/// +optional
292-
#[prost(map = "string, message", tag = "5")]
293-
pub extra: ::std::collections::HashMap<::prost::alloc::string::String, ExtraValue>,
292+
#[prost(btree_map = "string, message", tag = "5")]
293+
pub extra: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ExtraValue>,
294294
/// UID information about the requesting user.
295295
/// +optional
296296
#[prost(string, optional, tag = "6")]

k8s-pb/src/api/authorization/v1beta1/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ pub struct SubjectAccessReviewSpec {
223223
/// Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer
224224
/// it needs a reflection here.
225225
/// +optional
226-
#[prost(map = "string, message", tag = "5")]
227-
pub extra: ::std::collections::HashMap<::prost::alloc::string::String, ExtraValue>,
226+
#[prost(btree_map = "string, message", tag = "5")]
227+
pub extra: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ExtraValue>,
228228
/// UID information about the requesting user.
229229
/// +optional
230230
#[prost(string, optional, tag = "6")]

k8s-pb/src/api/certificates/v1/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ pub struct CertificateSigningRequestSpec {
169169
/// extra contains extra attributes of the user that created the CertificateSigningRequest.
170170
/// Populated by the API server on creation and immutable.
171171
/// +optional
172-
#[prost(map = "string, message", tag = "6")]
173-
pub extra: ::std::collections::HashMap<::prost::alloc::string::String, ExtraValue>,
172+
#[prost(btree_map = "string, message", tag = "6")]
173+
pub extra: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ExtraValue>,
174174
}
175175
/// CertificateSigningRequestStatus contains conditions used to indicate
176176
/// approved/denied/failed status of the request, and the issued certificate.

0 commit comments

Comments
 (0)