We try to keep struct names, field names, and import paths the same as in k8s-openapi so that, it's (in theory) easy to switch.
If you see field names with strange split casings / mismatched casings:
or if you see struct names in rust style PascalCase when the upstream has stronger capitalisation:
then please raise an issue or submit a PR against our universal re-alignment target just names:
|
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 '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' |
|
rg 'IpAddress' k8s-pb -l | xargs sd 'IpAddress' 'IPAddress' |
|
rg 'ServiceCidr' k8s-pb -l | xargs sd 'ServiceCidr' 'ServiceCIDR' |
|
rg 'ClusterCidr' k8s-pb -l | xargs sd 'ClusterCidr' 'ClusterCIDR' |
|
rg 'cluster_i_ps' k8s-pb -l | xargs sd 'cluster_i_ps' 'cluster_ips' |
|
rg 'external_i_ps' k8s-pb -l | xargs sd 'external_i_ps' 'external_ips' |
|
rg 'pod_i_ps' k8s-pb -l | xargs sd 'pod_i_ps' 'pod_ips' |
|
rg 'host_i_ps' k8s-pb -l | xargs sd 'host_i_ps' 'host_ips' |
We do actually want to maintain the aggressive capitalization because 1; it's what the structs are actually called, and 2; it matches k8s-openapi.
Additionally, if you see import paths not matching the commensurate path as in docs.rs/k8s-openapi please also raise an issue! As examples, these import paths are matching because they have the same path components:
if you cannot simply swap out k8s-openapi for k8s-pb in a use k8s-openapi::SOMEPATH::SomeStruct line, then this could be a bug.
We try to keep struct names, field names, and import paths the same as in
k8s-openapiso that, it's (in theory) easy to switch.If you see field names with strange split casings / mismatched casings:
cluster_i_psrather thancluster_ips- Handle irregular camelCase to snake_case conversion #2pod_i_psrather thanpod_ipsor if you see struct names in rust style
PascalCasewhen the upstream has stronger capitalisation:ApiResourcerather thanAPIResourceCsiNoderather thanCSINodeClusterCidrrather thanClusterCIDR- Align type names with k8s-openapi #49then please raise an issue or submit a PR against our universal re-alignment target
just names:k8s-pb/justfile
Lines 80 to 93 in 7e731d6
We do actually want to maintain the aggressive capitalization because 1; it's what the structs are actually called, and 2; it matches
k8s-openapi.Additionally, if you see import paths not matching the commensurate path as in docs.rs/k8s-openapi please also raise an issue! As examples, these import paths are matching because they have the same path components:
if you cannot simply swap out
k8s-openapifork8s-pbin ause k8s-openapi::SOMEPATH::SomeStructline, then this could be a bug.