Skip to content

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

@clux

Description

@clux

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions