Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Names not matching k8s-openapi? Likely a bug! #52

Open
clux opened this issue Oct 13, 2024 · 0 comments
Open

Names not matching k8s-openapi? Likely a bug! #52

clux opened this issue Oct 13, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@clux
Copy link
Member

clux commented Oct 13, 2024

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:

k8s-pb/justfile

Lines 80 to 93 in 7e731d6

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.

@clux clux added the help wanted Extra attention is needed label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant