• Kubernetes Submit Queue's avatar
    Merge pull request #45859 from DirectXMan12/refactor/protobuf-for-metrics · c2667203
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue
    
    Protobuf generation for k8s.io/metrics
    
    This PR introduces protobuf generation for k8s.io/metrics.  Doing so required:
    
    - fixing a bug in `go-to-protobuf` causing the `cast{key,value,type}` values to not be quoted when coming from struct tags (and not auto-injection by `go-to-protobuf` itself).
    - Making sure the proto IDL in k8s.io/client-go had a package name of `k8s.io.client_go.xyz` and not `k8s.io.kubernetes.xyz`.
    
    Additionally, I updated `go-to-protobuf` to skip functions and non-public types when composing the import list, which cuts down on the more bizarre imports in the IDL (like importing the sample API package in every IDL file because it contained `addToScheme`, like every other API package).
    
    We use `castvalue` to force gogo-proto to realize that it should consider the value of the map which underlies `ResourceList` when calculating which imports need to be named.  Otherwise, it ignores the value's type, leading to compilation errors when it later can't find an import it assumed existed.  We accidentally didn't hit this in `k8s.io/kubernetes/pkg/api/v1` since another field coincidentally happens to directly use `resource.Quantity` (the value type of `ResourceList`).
    
    **Release note**:
    ```release-note
    NONE
    ```
    c2667203
Name
Last commit
Last update
..
apis Loading commit data...
client Loading commit data...
cluster Loading commit data...
cmd Loading commit data...
deploy Loading commit data...
develop Loading commit data...
docs/api-reference Loading commit data...
manifests Loading commit data...
pkg Loading commit data...
registry/cluster Loading commit data...
BUILD Loading commit data...
Makefile Loading commit data...
OWNERS Loading commit data...
README.md Loading commit data...