Skip to content

Commit d1ccbf6

Browse files
authored
Fix names for APIGroup, APIVersion, CSI*, *CIDR (#54)
quick rg for Csi, Api and Cidr revealed these for #52
2 parents 902189a + 757a4e6 commit d1ccbf6

File tree

5 files changed

+39
-32
lines changed

5 files changed

+39
-32
lines changed

justfile

+7
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,19 @@ names:
8282
# Retain original names (prost doesn't let you bypass its renaming)
8383
rg 'ApiService' k8s-pb -l | xargs sd 'ApiService' 'APIService'
8484
rg 'ApiResource' k8s-pb -l | xargs sd 'ApiResource' 'APIResource'
85+
rg 'ApiGroup' k8s-pb -l | xargs sd 'ApiGroup' 'APIGroup'
86+
rg 'ApiVersion' k8s-pb -l | xargs sd 'ApiVersion' 'APIVersion'
87+
rg 'ApiSubresource' k8s-pb -l | xargs sd 'ApiSubresource' 'APISubresource'
88+
rg 'DownwardApi' k8s-pb -l | xargs sd 'DownwardApi' 'DownwardAPI'
8589
rg 'CsiDriver' k8s-pb -l | xargs sd 'CsiDriver' 'CSIDriver'
90+
rg 'CsiPersistent' k8s-pb -l | xargs sd 'CsiPersistent' 'CSIPersistent'
91+
rg 'CsiVolume' k8s-pb -l | xargs sd 'CsiVolume' 'CSIVolume'
8692
rg 'CsiStorage' k8s-pb -l | xargs sd 'CsiStorage' 'CSIStorage'
8793
rg 'CsiNode' k8s-pb -l | xargs sd 'CsiNode' 'CSINode'
8894
rg 'IpAddress' k8s-pb -l | xargs sd 'IpAddress' 'IPAddress'
8995
rg 'ServiceCidr' k8s-pb -l | xargs sd 'ServiceCidr' 'ServiceCIDR'
9096
rg 'ClusterCidr' k8s-pb -l | xargs sd 'ClusterCidr' 'ClusterCIDR'
97+
rg 'ClientCidr' k8s-pb -l | xargs sd 'ClientCidr' 'ClientCIDR'
9198
rg 'cluster_i_ps' k8s-pb -l | xargs sd 'cluster_i_ps' 'cluster_ips'
9299
rg 'external_i_ps' k8s-pb -l | xargs sd 'external_i_ps' 'external_ips'
93100
rg 'pod_i_ps' k8s-pb -l | xargs sd 'pod_i_ps' 'pod_ips'

k8s-pb/src/api/apidiscovery/v2/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// It contains a list of APIVersionDiscovery that holds a list of APIResourceDiscovery types served for a version.
44
/// Versions are in descending order of preference, with the first version being the preferred entry.
55
#[derive(Clone, PartialEq, ::prost::Message)]
6-
pub struct ApiGroupDiscovery {
6+
pub struct APIGroupDiscovery {
77
/// Standard object's metadata.
88
/// The only field completed will be name. For instance, resourceVersion will be empty.
99
/// name is the name of the API group whose discovery information is presented here.
@@ -17,22 +17,22 @@ pub struct ApiGroupDiscovery {
1717
/// +listType=map
1818
/// +listMapKey=version
1919
#[prost(message, repeated, tag = "2")]
20-
pub versions: ::prost::alloc::vec::Vec<ApiVersionDiscovery>,
20+
pub versions: ::prost::alloc::vec::Vec<APIVersionDiscovery>,
2121
}
2222
/// APIGroupDiscoveryList is a resource containing a list of APIGroupDiscovery.
2323
/// This is one of the types able to be returned from the /api and /apis endpoint and contains an aggregated
2424
/// list of API resources (built-ins, Custom Resource Definitions, resources from aggregated servers)
2525
/// that a cluster supports.
2626
#[derive(Clone, PartialEq, ::prost::Message)]
27-
pub struct ApiGroupDiscoveryList {
27+
pub struct APIGroupDiscoveryList {
2828
/// ResourceVersion will not be set, because this does not have a replayable ordering among multiple apiservers.
2929
/// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
3030
/// +optional
3131
#[prost(message, optional, tag = "1")]
3232
pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
3333
/// items is the list of groups for discovery. The groups are listed in priority order.
3434
#[prost(message, repeated, tag = "2")]
35-
pub items: ::prost::alloc::vec::Vec<ApiGroupDiscovery>,
35+
pub items: ::prost::alloc::vec::Vec<APIGroupDiscovery>,
3636
}
3737
/// APIResourceDiscovery provides information about an API resource for discovery.
3838
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -77,11 +77,11 @@ pub struct APIResourceDiscovery {
7777
/// +listType=map
7878
/// +listMapKey=subresource
7979
#[prost(message, repeated, tag = "8")]
80-
pub subresources: ::prost::alloc::vec::Vec<ApiSubresourceDiscovery>,
80+
pub subresources: ::prost::alloc::vec::Vec<APISubresourceDiscovery>,
8181
}
8282
/// APISubresourceDiscovery provides information about an API subresource for discovery.
8383
#[derive(Clone, PartialEq, ::prost::Message)]
84-
pub struct ApiSubresourceDiscovery {
84+
pub struct APISubresourceDiscovery {
8585
/// subresource is the name of the subresource. This is used in the URL path and is the unique identifier
8686
/// for this resource across all versions.
8787
#[prost(string, optional, tag = "1")]
@@ -114,7 +114,7 @@ pub struct ApiSubresourceDiscovery {
114114
}
115115
/// APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group.
116116
#[derive(Clone, PartialEq, ::prost::Message)]
117-
pub struct ApiVersionDiscovery {
117+
pub struct APIVersionDiscovery {
118118
/// version is the name of the version within a group version.
119119
#[prost(string, optional, tag = "1")]
120120
pub version: ::core::option::Option<::prost::alloc::string::String>,

k8s-pb/src/api/apidiscovery/v2beta1/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// It contains a list of APIVersionDiscovery that holds a list of APIResourceDiscovery types served for a version.
44
/// Versions are in descending order of preference, with the first version being the preferred entry.
55
#[derive(Clone, PartialEq, ::prost::Message)]
6-
pub struct ApiGroupDiscovery {
6+
pub struct APIGroupDiscovery {
77
/// Standard object's metadata.
88
/// The only field completed will be name. For instance, resourceVersion will be empty.
99
/// name is the name of the API group whose discovery information is presented here.
@@ -17,22 +17,22 @@ pub struct ApiGroupDiscovery {
1717
/// +listType=map
1818
/// +listMapKey=version
1919
#[prost(message, repeated, tag = "2")]
20-
pub versions: ::prost::alloc::vec::Vec<ApiVersionDiscovery>,
20+
pub versions: ::prost::alloc::vec::Vec<APIVersionDiscovery>,
2121
}
2222
/// APIGroupDiscoveryList is a resource containing a list of APIGroupDiscovery.
2323
/// This is one of the types able to be returned from the /api and /apis endpoint and contains an aggregated
2424
/// list of API resources (built-ins, Custom Resource Definitions, resources from aggregated servers)
2525
/// that a cluster supports.
2626
#[derive(Clone, PartialEq, ::prost::Message)]
27-
pub struct ApiGroupDiscoveryList {
27+
pub struct APIGroupDiscoveryList {
2828
/// ResourceVersion will not be set, because this does not have a replayable ordering among multiple apiservers.
2929
/// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
3030
/// +optional
3131
#[prost(message, optional, tag = "1")]
3232
pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
3333
/// items is the list of groups for discovery. The groups are listed in priority order.
3434
#[prost(message, repeated, tag = "2")]
35-
pub items: ::prost::alloc::vec::Vec<ApiGroupDiscovery>,
35+
pub items: ::prost::alloc::vec::Vec<APIGroupDiscovery>,
3636
}
3737
/// APIResourceDiscovery provides information about an API resource for discovery.
3838
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -77,11 +77,11 @@ pub struct APIResourceDiscovery {
7777
/// +listType=map
7878
/// +listMapKey=subresource
7979
#[prost(message, repeated, tag = "8")]
80-
pub subresources: ::prost::alloc::vec::Vec<ApiSubresourceDiscovery>,
80+
pub subresources: ::prost::alloc::vec::Vec<APISubresourceDiscovery>,
8181
}
8282
/// APISubresourceDiscovery provides information about an API subresource for discovery.
8383
#[derive(Clone, PartialEq, ::prost::Message)]
84-
pub struct ApiSubresourceDiscovery {
84+
pub struct APISubresourceDiscovery {
8585
/// subresource is the name of the subresource. This is used in the URL path and is the unique identifier
8686
/// for this resource across all versions.
8787
#[prost(string, optional, tag = "1")]
@@ -114,7 +114,7 @@ pub struct ApiSubresourceDiscovery {
114114
}
115115
/// APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group.
116116
#[derive(Clone, PartialEq, ::prost::Message)]
117-
pub struct ApiVersionDiscovery {
117+
pub struct APIVersionDiscovery {
118118
/// version is the name of the version within a group version.
119119
#[prost(string, optional, tag = "1")]
120120
pub version: ::core::option::Option<::prost::alloc::string::String>,

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

+11-11
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ pub struct Binding {
172172
}
173173
/// Represents storage that is managed by an external CSI volume driver (Beta feature)
174174
#[derive(Clone, PartialEq, ::prost::Message)]
175-
pub struct CsiPersistentVolumeSource {
175+
pub struct CSIPersistentVolumeSource {
176176
/// driver is the name of the driver to use for this volume.
177177
/// Required.
178178
#[prost(string, optional, tag = "1")]
@@ -240,7 +240,7 @@ pub struct CsiPersistentVolumeSource {
240240
}
241241
/// Represents a source location of a volume to mount, managed by an external CSI driver
242242
#[derive(Clone, PartialEq, ::prost::Message)]
243-
pub struct CsiVolumeSource {
243+
pub struct CSIVolumeSource {
244244
/// driver is the name of the CSI driver that handles this volume.
245245
/// Consult with your admin for the correct name as registered in the cluster.
246246
#[prost(string, optional, tag = "1")]
@@ -1140,16 +1140,16 @@ pub struct DaemonEndpoint {
11401140
/// Note that this is identical to a downwardAPI volume source without the default
11411141
/// mode.
11421142
#[derive(Clone, PartialEq, ::prost::Message)]
1143-
pub struct DownwardApiProjection {
1143+
pub struct DownwardAPIProjection {
11441144
/// Items is a list of DownwardAPIVolume file
11451145
/// +optional
11461146
/// +listType=atomic
11471147
#[prost(message, repeated, tag = "1")]
1148-
pub items: ::prost::alloc::vec::Vec<DownwardApiVolumeFile>,
1148+
pub items: ::prost::alloc::vec::Vec<DownwardAPIVolumeFile>,
11491149
}
11501150
/// DownwardAPIVolumeFile represents information to create the file containing the pod field
11511151
#[derive(Clone, PartialEq, ::prost::Message)]
1152-
pub struct DownwardApiVolumeFile {
1152+
pub struct DownwardAPIVolumeFile {
11531153
/// Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
11541154
#[prost(string, optional, tag = "1")]
11551155
pub path: ::core::option::Option<::prost::alloc::string::String>,
@@ -1175,12 +1175,12 @@ pub struct DownwardApiVolumeFile {
11751175
/// DownwardAPIVolumeSource represents a volume containing downward API info.
11761176
/// Downward API volumes support ownership management and SELinux relabeling.
11771177
#[derive(Clone, PartialEq, ::prost::Message)]
1178-
pub struct DownwardApiVolumeSource {
1178+
pub struct DownwardAPIVolumeSource {
11791179
/// Items is a list of downward API volume file
11801180
/// +optional
11811181
/// +listType=atomic
11821182
#[prost(message, repeated, tag = "1")]
1183-
pub items: ::prost::alloc::vec::Vec<DownwardApiVolumeFile>,
1183+
pub items: ::prost::alloc::vec::Vec<DownwardAPIVolumeFile>,
11841184
/// Optional: mode bits to use on created files by default. Must be a
11851185
/// Optional: mode bits used to set permissions on created files by default.
11861186
/// Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
@@ -3520,7 +3520,7 @@ pub struct PersistentVolumeSource {
35203520
/// csi represents storage that is handled by an external CSI driver (Beta feature).
35213521
/// +optional
35223522
#[prost(message, optional, tag = "22")]
3523-
pub csi: ::core::option::Option<CsiPersistentVolumeSource>,
3523+
pub csi: ::core::option::Option<CSIPersistentVolumeSource>,
35243524
}
35253525
/// PersistentVolumeSpec is the specification of a persistent volume.
35263526
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -6750,7 +6750,7 @@ pub struct VolumeProjection {
67506750
/// downwardAPI information about the downwardAPI data to project
67516751
/// +optional
67526752
#[prost(message, optional, tag = "2")]
6753-
pub downward_api: ::core::option::Option<DownwardApiProjection>,
6753+
pub downward_api: ::core::option::Option<DownwardAPIProjection>,
67546754
/// configMap information about the configMap data to project
67556755
/// +optional
67566756
#[prost(message, optional, tag = "3")]
@@ -6892,7 +6892,7 @@ pub struct VolumeSource {
68926892
/// downwardAPI represents downward API about the pod that should populate this volume
68936893
/// +optional
68946894
#[prost(message, optional, tag = "16")]
6895-
pub downward_api: ::core::option::Option<DownwardApiVolumeSource>,
6895+
pub downward_api: ::core::option::Option<DownwardAPIVolumeSource>,
68966896
/// fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
68976897
/// +optional
68986898
#[prost(message, optional, tag = "17")]
@@ -6938,7 +6938,7 @@ pub struct VolumeSource {
69386938
/// csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).
69396939
/// +optional
69406940
#[prost(message, optional, tag = "28")]
6941-
pub csi: ::core::option::Option<CsiVolumeSource>,
6941+
pub csi: ::core::option::Option<CSIVolumeSource>,
69426942
/// ephemeral represents a volume that is handled by a cluster storage driver.
69436943
/// The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
69446944
/// and deleted when the pod is removed.

k8s-pb/src/apimachinery/pkg/apis/meta/v1/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/// APIGroup contains the name, the supported versions, and the preferred version
33
/// of a group.
44
#[derive(Clone, PartialEq, ::prost::Message)]
5-
pub struct ApiGroup {
5+
pub struct APIGroup {
66
/// name is the name of the group.
77
#[prost(string, optional, tag = "1")]
88
pub name: ::core::option::Option<::prost::alloc::string::String>,
@@ -25,16 +25,16 @@ pub struct ApiGroup {
2525
/// +optional
2626
/// +listType=atomic
2727
#[prost(message, repeated, tag = "4")]
28-
pub server_address_by_client_cid_rs: ::prost::alloc::vec::Vec<ServerAddressByClientCidr>,
28+
pub server_address_by_client_cid_rs: ::prost::alloc::vec::Vec<ServerAddressByClientCIDR>,
2929
}
3030
/// APIGroupList is a list of APIGroup, to allow clients to discover the API at
3131
/// /apis.
3232
#[derive(Clone, PartialEq, ::prost::Message)]
33-
pub struct ApiGroupList {
33+
pub struct APIGroupList {
3434
/// groups is a list of APIGroup.
3535
/// +listType=atomic
3636
#[prost(message, repeated, tag = "1")]
37-
pub groups: ::prost::alloc::vec::Vec<ApiGroup>,
37+
pub groups: ::prost::alloc::vec::Vec<APIGroup>,
3838
}
3939
/// APIResource specifies the name of a resource and whether it is namespaced.
4040
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -103,7 +103,7 @@ pub struct APIResourceList {
103103
/// +protobuf.options.(gogoproto.goproto_stringer)=false
104104
/// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
105105
#[derive(Clone, PartialEq, ::prost::Message)]
106-
pub struct ApiVersions {
106+
pub struct APIVersions {
107107
/// versions are the api versions that are available.
108108
/// +listType=atomic
109109
#[prost(string, repeated, tag = "1")]
@@ -117,7 +117,7 @@ pub struct ApiVersions {
117117
/// Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.
118118
/// +listType=atomic
119119
#[prost(message, repeated, tag = "2")]
120-
pub server_address_by_client_cid_rs: ::prost::alloc::vec::Vec<ServerAddressByClientCidr>,
120+
pub server_address_by_client_cid_rs: ::prost::alloc::vec::Vec<ServerAddressByClientCIDR>,
121121
}
122122
/// ApplyOptions may be provided when applying an API object.
123123
/// FieldManager is required for apply requests.
@@ -993,7 +993,7 @@ pub struct RootPaths {
993993
}
994994
/// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.
995995
#[derive(Clone, PartialEq, ::prost::Message)]
996-
pub struct ServerAddressByClientCidr {
996+
pub struct ServerAddressByClientCIDR {
997997
/// The CIDR with which clients can match their IP to figure out the server address that they should use.
998998
#[prost(string, optional, tag = "1")]
999999
pub client_cidr: ::core::option::Option<::prost::alloc::string::String>,

0 commit comments

Comments
 (0)