Skip to content

Commit 33d5335

Browse files
authored
autoinherit and bump prost* to 14 (#65)
closes #64 closes #63 closes #62
2 parents cc84beb + 3afe55a commit 33d5335

File tree

60 files changed

+541
-530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+541
-530
lines changed

Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@ members = [
55
"k8s-pb"
66
]
77
resolver = "2"
8+
9+
[workspace.dependencies]
10+
anyhow = "1.0.98"
11+
env_logger = "0.11.8"
12+
log = "0.4.27"
13+
prost = "0.14.1"
14+
prost-build = "0.14.1"
15+
prost-types = "0.14.1"
16+
quote = "1.0"
17+
serde = "1.0.219"
18+
serde_json = "1.0.140"

k8s-pb-codegen/Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ license = "Apache-2.0"
66
publish = false
77

88
[dependencies]
9-
prost = "0.13.1"
10-
prost-build = "0.13.1"
11-
prost-types = "0.13.1"
12-
serde_json = "1.0.67"
13-
serde = { version = "1.0.130", features = ["derive"] }
14-
log = "0.4.14"
15-
anyhow = "1.0.44"
16-
env_logger = "0.11.0"
17-
quote = "1.0"
9+
prost = { workspace = true }
10+
prost-build = { workspace = true }
11+
prost-types = { workspace = true }
12+
serde_json = { workspace = true }
13+
serde = { workspace = true, features = ["derive"] }
14+
log = { workspace = true }
15+
anyhow = { workspace = true }
16+
env_logger = { workspace = true }
17+
quote = { workspace = true }

k8s-pb/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ rust-version = "1.65.0"
1515
edition = "2021"
1616

1717
[dependencies]
18-
prost = "0.13.1"
18+
prost = { workspace = true }

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is @generated by prost-build.
22
/// AuditAnnotation describes how to produce an audit annotation for an API request.
3-
#[derive(Clone, PartialEq, ::prost::Message)]
3+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
44
pub struct AuditAnnotation {
55
/// key specifies the audit annotation key. The audit annotation keys of
66
/// a ValidatingAdmissionPolicy must be unique. The key must be a qualified
@@ -38,7 +38,7 @@ pub struct AuditAnnotation {
3838
pub value_expression: ::core::option::Option<::prost::alloc::string::String>,
3939
}
4040
/// ExpressionWarning is a warning information that targets a specific expression.
41-
#[derive(Clone, PartialEq, ::prost::Message)]
41+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4242
pub struct ExpressionWarning {
4343
/// The path to the field that refers the expression.
4444
/// For example, the reference to the expression of the first item of
@@ -52,7 +52,7 @@ pub struct ExpressionWarning {
5252
pub warning: ::core::option::Option<::prost::alloc::string::String>,
5353
}
5454
/// MatchCondition represents a condition which must by fulfilled for a request to be sent to a webhook.
55-
#[derive(Clone, PartialEq, ::prost::Message)]
55+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5656
pub struct MatchCondition {
5757
/// Name is an identifier for this match condition, used for strategic merging of MatchConditions,
5858
/// as well as providing an identifier for logging purposes. A good name should be descriptive of
@@ -380,7 +380,7 @@ pub struct MutatingWebhookConfigurationList {
380380
}
381381
/// NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.
382382
/// +structType=atomic
383-
#[derive(Clone, PartialEq, ::prost::Message)]
383+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
384384
pub struct NamedRuleWithOperations {
385385
/// ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
386386
/// +listType=atomic
@@ -393,7 +393,7 @@ pub struct NamedRuleWithOperations {
393393
}
394394
/// ParamKind is a tuple of Group Kind and Version.
395395
/// +structType=atomic
396-
#[derive(Clone, PartialEq, ::prost::Message)]
396+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
397397
pub struct ParamKind {
398398
/// APIVersion is the API group version the resources belong to.
399399
/// In format of "group/version".
@@ -466,7 +466,7 @@ pub struct ParamRef {
466466
}
467467
/// Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended
468468
/// to make sure that all the tuple expansions are valid.
469-
#[derive(Clone, PartialEq, ::prost::Message)]
469+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
470470
pub struct Rule {
471471
/// APIGroups is the API groups the resources belong to. '*' is all groups.
472472
/// If '*' is present, the length of the slice must be one.
@@ -513,7 +513,7 @@ pub struct Rule {
513513
}
514514
/// RuleWithOperations is a tuple of Operations and Resources. It is recommended to make
515515
/// sure that all the tuple expansions are valid.
516-
#[derive(Clone, PartialEq, ::prost::Message)]
516+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
517517
pub struct RuleWithOperations {
518518
/// Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or *
519519
/// for all of those operations and any future admission operations that are added.
@@ -528,7 +528,7 @@ pub struct RuleWithOperations {
528528
pub rule: ::core::option::Option<Rule>,
529529
}
530530
/// ServiceReference holds a reference to Service.legacy.k8s.io
531-
#[derive(Clone, PartialEq, ::prost::Message)]
531+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
532532
pub struct ServiceReference {
533533
/// `namespace` is the namespace of the service.
534534
/// Required
@@ -976,7 +976,7 @@ pub struct ValidatingWebhookConfigurationList {
976976
pub items: ::prost::alloc::vec::Vec<ValidatingWebhookConfiguration>,
977977
}
978978
/// Validation specifies the CEL expression which is used to apply the validation.
979-
#[derive(Clone, PartialEq, ::prost::Message)]
979+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
980980
pub struct Validation {
981981
/// Expression represents the expression which will be evaluated by CEL.
982982
/// ref: <https://github.com/google/cel-spec>
@@ -1056,7 +1056,7 @@ pub struct Validation {
10561056
}
10571057
/// Variable is the definition of a variable that is used for composition. A variable is defined as a named expression.
10581058
/// +structType=atomic
1059-
#[derive(Clone, PartialEq, ::prost::Message)]
1059+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10601060
pub struct Variable {
10611061
/// Name is the name of the variable. The name must be a valid CEL identifier and unique among all variables.
10621062
/// The variable can be accessed in other expressions through `variables`
@@ -1070,7 +1070,7 @@ pub struct Variable {
10701070
}
10711071
/// WebhookClientConfig contains the information to make a TLS
10721072
/// connection with the webhook
1073-
#[derive(Clone, PartialEq, ::prost::Message)]
1073+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10741074
pub struct WebhookClientConfig {
10751075
/// `url` gives the location of the webhook, in standard URL form
10761076
/// (`scheme://host:port/path`). Exactly one of `url` or `service`

k8s-pb/src/api/admissionregistration/v1alpha1/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is @generated by prost-build.
22
/// ApplyConfiguration defines the desired configuration values of an object.
3-
#[derive(Clone, PartialEq, ::prost::Message)]
3+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
44
pub struct ApplyConfiguration {
55
/// expression will be evaluated by CEL to create an apply configuration.
66
/// ref: <https://github.com/google/cel-spec>
@@ -46,7 +46,7 @@ pub struct ApplyConfiguration {
4646
pub expression: ::core::option::Option<::prost::alloc::string::String>,
4747
}
4848
/// AuditAnnotation describes how to produce an audit annotation for an API request.
49-
#[derive(Clone, PartialEq, ::prost::Message)]
49+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5050
pub struct AuditAnnotation {
5151
/// key specifies the audit annotation key. The audit annotation keys of
5252
/// a ValidatingAdmissionPolicy must be unique. The key must be a qualified
@@ -84,7 +84,7 @@ pub struct AuditAnnotation {
8484
pub value_expression: ::core::option::Option<::prost::alloc::string::String>,
8585
}
8686
/// ExpressionWarning is a warning information that targets a specific expression.
87-
#[derive(Clone, PartialEq, ::prost::Message)]
87+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8888
pub struct ExpressionWarning {
8989
/// The path to the field that refers the expression.
9090
/// For example, the reference to the expression of the first item of
@@ -98,7 +98,7 @@ pub struct ExpressionWarning {
9898
pub warning: ::core::option::Option<::prost::alloc::string::String>,
9999
}
100100
/// JSONPatch defines a JSON Patch.
101-
#[derive(Clone, PartialEq, ::prost::Message)]
101+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
102102
pub struct JsonPatch {
103103
/// expression will be evaluated by CEL to create a [JSON patch](<https://jsonpatch.com/>).
104104
/// ref: <https://github.com/google/cel-spec>
@@ -167,7 +167,7 @@ pub struct JsonPatch {
167167
#[prost(string, optional, tag = "1")]
168168
pub expression: ::core::option::Option<::prost::alloc::string::String>,
169169
}
170-
#[derive(Clone, PartialEq, ::prost::Message)]
170+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
171171
pub struct MatchCondition {
172172
/// Name is an identifier for this match condition, used for strategic merging of MatchConditions,
173173
/// as well as providing an identifier for logging purposes. A good name should be descriptive of
@@ -469,7 +469,7 @@ pub struct MutatingAdmissionPolicySpec {
469469
pub reinvocation_policy: ::core::option::Option<::prost::alloc::string::String>,
470470
}
471471
/// Mutation specifies the CEL expression which is used to apply the Mutation.
472-
#[derive(Clone, PartialEq, ::prost::Message)]
472+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
473473
pub struct Mutation {
474474
/// patchType indicates the patch strategy used.
475475
/// Allowed values are "ApplyConfiguration" and "JSONPatch".
@@ -491,7 +491,7 @@ pub struct Mutation {
491491
}
492492
/// NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.
493493
/// +structType=atomic
494-
#[derive(Clone, PartialEq, ::prost::Message)]
494+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
495495
pub struct NamedRuleWithOperations {
496496
/// ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
497497
/// +listType=atomic
@@ -504,7 +504,7 @@ pub struct NamedRuleWithOperations {
504504
}
505505
/// ParamKind is a tuple of Group Kind and Version.
506506
/// +structType=atomic
507-
#[derive(Clone, PartialEq, ::prost::Message)]
507+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
508508
pub struct ParamKind {
509509
/// APIVersion is the API group version the resources belong to.
510510
/// In format of "group/version".
@@ -818,7 +818,7 @@ pub struct ValidatingAdmissionPolicyStatus {
818818
::prost::alloc::vec::Vec<super::super::super::apimachinery::pkg::apis::meta::v1::Condition>,
819819
}
820820
/// Validation specifies the CEL expression which is used to apply the validation.
821-
#[derive(Clone, PartialEq, ::prost::Message)]
821+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
822822
pub struct Validation {
823823
/// Expression represents the expression which will be evaluated by CEL.
824824
/// ref: <https://github.com/google/cel-spec>
@@ -897,7 +897,7 @@ pub struct Validation {
897897
pub message_expression: ::core::option::Option<::prost::alloc::string::String>,
898898
}
899899
/// Variable is the definition of a variable that is used for composition.
900-
#[derive(Clone, PartialEq, ::prost::Message)]
900+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
901901
pub struct Variable {
902902
/// Name is the name of the variable. The name must be a valid CEL identifier and unique among all variables.
903903
/// The variable can be accessed in other expressions through `variables`

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is @generated by prost-build.
22
/// AuditAnnotation describes how to produce an audit annotation for an API request.
3-
#[derive(Clone, PartialEq, ::prost::Message)]
3+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
44
pub struct AuditAnnotation {
55
/// key specifies the audit annotation key. The audit annotation keys of
66
/// a ValidatingAdmissionPolicy must be unique. The key must be a qualified
@@ -38,7 +38,7 @@ pub struct AuditAnnotation {
3838
pub value_expression: ::core::option::Option<::prost::alloc::string::String>,
3939
}
4040
/// ExpressionWarning is a warning information that targets a specific expression.
41-
#[derive(Clone, PartialEq, ::prost::Message)]
41+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4242
pub struct ExpressionWarning {
4343
/// The path to the field that refers the expression.
4444
/// For example, the reference to the expression of the first item of
@@ -52,7 +52,7 @@ pub struct ExpressionWarning {
5252
pub warning: ::core::option::Option<::prost::alloc::string::String>,
5353
}
5454
/// MatchCondition represents a condition which must be fulfilled for a request to be sent to a webhook.
55-
#[derive(Clone, PartialEq, ::prost::Message)]
55+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5656
pub struct MatchCondition {
5757
/// Name is an identifier for this match condition, used for strategic merging of MatchConditions,
5858
/// as well as providing an identifier for logging purposes. A good name should be descriptive of
@@ -384,7 +384,7 @@ pub struct MutatingWebhookConfigurationList {
384384
}
385385
/// NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.
386386
/// +structType=atomic
387-
#[derive(Clone, PartialEq, ::prost::Message)]
387+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
388388
pub struct NamedRuleWithOperations {
389389
/// ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
390390
/// +listType=atomic
@@ -397,7 +397,7 @@ pub struct NamedRuleWithOperations {
397397
}
398398
/// ParamKind is a tuple of Group Kind and Version.
399399
/// +structType=atomic
400-
#[derive(Clone, PartialEq, ::prost::Message)]
400+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
401401
pub struct ParamKind {
402402
/// APIVersion is the API group version the resources belong to.
403403
/// In format of "group/version".
@@ -469,7 +469,7 @@ pub struct ParamRef {
469469
pub parameter_not_found_action: ::core::option::Option<::prost::alloc::string::String>,
470470
}
471471
/// ServiceReference holds a reference to Service.legacy.k8s.io
472-
#[derive(Clone, PartialEq, ::prost::Message)]
472+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
473473
pub struct ServiceReference {
474474
/// `namespace` is the namespace of the service.
475475
/// Required
@@ -929,7 +929,7 @@ pub struct ValidatingWebhookConfigurationList {
929929
pub items: ::prost::alloc::vec::Vec<ValidatingWebhookConfiguration>,
930930
}
931931
/// Validation specifies the CEL expression which is used to apply the validation.
932-
#[derive(Clone, PartialEq, ::prost::Message)]
932+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
933933
pub struct Validation {
934934
/// Expression represents the expression which will be evaluated by CEL.
935935
/// ref: <https://github.com/google/cel-spec>
@@ -1009,7 +1009,7 @@ pub struct Validation {
10091009
}
10101010
/// Variable is the definition of a variable that is used for composition. A variable is defined as a named expression.
10111011
/// +structType=atomic
1012-
#[derive(Clone, PartialEq, ::prost::Message)]
1012+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10131013
pub struct Variable {
10141014
/// Name is the name of the variable. The name must be a valid CEL identifier and unique among all variables.
10151015
/// The variable can be accessed in other expressions through `variables`
@@ -1023,7 +1023,7 @@ pub struct Variable {
10231023
}
10241024
/// WebhookClientConfig contains the information to make a TLS
10251025
/// connection with the webhook
1026-
#[derive(Clone, PartialEq, ::prost::Message)]
1026+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10271027
pub struct WebhookClientConfig {
10281028
/// `url` gives the location of the webhook, in standard URL form
10291029
/// (`scheme://host:port/path`). Exactly one of `url` or `service`

k8s-pb/src/api/apiserverinternal/v1alpha1/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This file is @generated by prost-build.
22
/// An API server instance reports the version it can decode and the version it
33
/// encodes objects to when persisting objects in the backend.
4-
#[derive(Clone, PartialEq, ::prost::Message)]
4+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
55
pub struct ServerStorageVersion {
66
/// The ID of the reporting API server.
77
#[prost(string, optional, tag = "1")]
@@ -36,7 +36,7 @@ pub struct StorageVersion {
3636
pub status: ::core::option::Option<StorageVersionStatus>,
3737
}
3838
/// Describes the state of the storageVersion at a certain point.
39-
#[derive(Clone, PartialEq, ::prost::Message)]
39+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4040
pub struct StorageVersionCondition {
4141
/// Type of the condition.
4242
/// +required
@@ -76,7 +76,7 @@ pub struct StorageVersionList {
7676
pub items: ::prost::alloc::vec::Vec<StorageVersion>,
7777
}
7878
/// StorageVersionSpec is an empty spec.
79-
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
79+
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8080
pub struct StorageVersionSpec {}
8181
/// API server instances report the versions they can decode and the version they
8282
/// encode objects to when persisting objects in the backend.

0 commit comments

Comments
 (0)