Convert k8s.io/kubelet/pkg/apis/podresources from gogo to protoc

Use standard protoc for the pod resources instead of gogo.

Part of kubernetes#96564

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This commit is contained in:
Sascha Grunert
2025-07-17 13:33:46 +02:00
parent b2d7149090
commit 532d48fe6a
14 changed files with 1436 additions and 5244 deletions

View File

@@ -408,7 +408,7 @@ var _ = SIGDescribe("Memory Manager", "[LinuxOnly]", framework.WithDisruptive(),
continue
}
gomega.Expect(containerMemory.Size_).To(gomega.BeEquivalentTo(numaStateMemory.Size))
gomega.Expect(containerMemory.Size).To(gomega.BeEquivalentTo(numaStateMemory.Size))
}
}
@@ -541,7 +541,7 @@ var _ = SIGDescribe("Memory Manager", "[LinuxOnly]", framework.WithDisruptive(),
q := c.Resources.Limits[v1.ResourceName(containerMemory.MemoryType)]
value, ok := q.AsInt64()
gomega.Expect(ok).To(gomega.BeTrueBecause("cannot convert value to integer"))
gomega.Expect(value).To(gomega.BeEquivalentTo(containerMemory.Size_))
gomega.Expect(value).To(gomega.BeEquivalentTo(containerMemory.Size))
}
}
}

View File

@@ -283,17 +283,17 @@ func logPodResources(podIdx int, pr *kubeletpodresourcesv1.PodResources) {
}
}
type podResMap map[string]map[string]kubeletpodresourcesv1.ContainerResources
type podResMap map[string]map[string]*kubeletpodresourcesv1.ContainerResources
func convertToMap(podsResources []*kubeletpodresourcesv1.PodResources) podResMap {
res := make(map[string]map[string]kubeletpodresourcesv1.ContainerResources)
res := make(map[string]map[string]*kubeletpodresourcesv1.ContainerResources)
for idx, podResource := range podsResources {
// to make troubleshooting easier
logPodResources(idx, podResource)
cnts := make(map[string]kubeletpodresourcesv1.ContainerResources)
cnts := make(map[string]*kubeletpodresourcesv1.ContainerResources)
for _, cnt := range podResource.GetContainers() {
cnts[cnt.GetName()] = *cnt
cnts[cnt.GetName()] = cnt
}
res[podResource.GetName()] = cnts
}