Skip to content

Commit

Permalink
Fix names for APIResource types
Browse files Browse the repository at this point in the history
for #52

Signed-off-by: clux <[email protected]>
  • Loading branch information
clux committed Oct 14, 2024
1 parent bbbacb7 commit cd18f53
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ names:
#!/usr/bin/env bash
# Retain original names (prost doesn't let you bypass its renaming)
rg 'ApiService' k8s-pb -l | xargs sd 'ApiService' 'APIService'
rg 'ApiResource' k8s-pb -l | xargs sd 'ApiResource' 'APIResource'
rg 'CsiDriver' k8s-pb -l | xargs sd 'CsiDriver' 'CSIDriver'
rg 'CsiStorage' k8s-pb -l | xargs sd 'CsiStorage' 'CSIStorage'
rg 'CsiNode' k8s-pb -l | xargs sd 'CsiNode' 'CSINode'
Expand Down
4 changes: 2 additions & 2 deletions k8s-pb/src/api/apidiscovery/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct ApiGroupDiscoveryList {
}
/// APIResourceDiscovery provides information about an API resource for discovery.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApiResourceDiscovery {
pub struct APIResourceDiscovery {
/// resource is the plural name of the resource. This is used in the URL path and is the unique identifier
/// for this resource across all versions in the API group.
/// Resources with non-empty groups are located at /apis/<APIGroupDiscovery.objectMeta.name>/<APIVersionDiscovery.version>/<APIResourceDiscovery.Resource>
Expand Down Expand Up @@ -122,7 +122,7 @@ pub struct ApiVersionDiscovery {
/// +listType=map
/// +listMapKey=resource
#[prost(message, repeated, tag = "2")]
pub resources: ::prost::alloc::vec::Vec<ApiResourceDiscovery>,
pub resources: ::prost::alloc::vec::Vec<APIResourceDiscovery>,
/// freshness marks whether a group version's discovery document is up to date.
/// "Current" indicates the discovery document was recently
/// refreshed. "Stale" indicates the discovery document could not
Expand Down
4 changes: 2 additions & 2 deletions k8s-pb/src/api/apidiscovery/v2beta1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct ApiGroupDiscoveryList {
}
/// APIResourceDiscovery provides information about an API resource for discovery.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApiResourceDiscovery {
pub struct APIResourceDiscovery {
/// resource is the plural name of the resource. This is used in the URL path and is the unique identifier
/// for this resource across all versions in the API group.
/// Resources with non-empty groups are located at /apis/<APIGroupDiscovery.objectMeta.name>/<APIVersionDiscovery.version>/<APIResourceDiscovery.Resource>
Expand Down Expand Up @@ -122,7 +122,7 @@ pub struct ApiVersionDiscovery {
/// +listType=map
/// +listMapKey=resource
#[prost(message, repeated, tag = "2")]
pub resources: ::prost::alloc::vec::Vec<ApiResourceDiscovery>,
pub resources: ::prost::alloc::vec::Vec<APIResourceDiscovery>,
/// freshness marks whether a group version's discovery document is up to date.
/// "Current" indicates the discovery document was recently
/// refreshed. "Stale" indicates the discovery document could not
Expand Down
6 changes: 3 additions & 3 deletions k8s-pb/src/apimachinery/pkg/apis/meta/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub struct ApiGroupList {
}
/// APIResource specifies the name of a resource and whether it is namespaced.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApiResource {
pub struct APIResource {
/// name is the plural name of the resource.
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
Expand Down Expand Up @@ -88,14 +88,14 @@ pub struct ApiResource {
/// resources supported in a specific group and version, and if the resource
/// is namespaced.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApiResourceList {
pub struct APIResourceList {
/// groupVersion is the group and version this APIResourceList is for.
#[prost(string, optional, tag = "1")]
pub group_version: ::core::option::Option<::prost::alloc::string::String>,
/// resources contains the name of the resources and if they are namespaced.
/// +listType=atomic
#[prost(message, repeated, tag = "2")]
pub resources: ::prost::alloc::vec::Vec<ApiResource>,
pub resources: ::prost::alloc::vec::Vec<APIResource>,
}
/// APIVersions lists the versions that are available, to allow clients to
/// discover the API at /api, which is the root path of the legacy v1 API.
Expand Down

0 comments on commit cd18f53

Please sign in to comment.