cpuset: Delete 'builder' methods
All usage of builder pattern is convertible to cpuset.New() with the same or fewer lines of code. Migrate Builder.Add to a private method of CPUSet, with a comment that it is only intended for internal use to preserve immutable propoerty of the exported interface. This also removes 'require' library dependency, which avoids non-standard library usage.
This commit is contained in:
@@ -522,11 +522,11 @@ func podresourcesGetAllocatableResourcesTests(ctx context.Context, cli kubeletpo
|
||||
resp, err := cli.GetAllocatableResources(ctx, &kubeletpodresourcesv1.AllocatableResourcesRequest{})
|
||||
framework.ExpectNoErrorWithOffset(1, err)
|
||||
devs := resp.GetDevices()
|
||||
b := cpuset.NewBuilder()
|
||||
var cpus []int
|
||||
for _, cpuid := range resp.GetCpuIds() {
|
||||
b.Add(int(cpuid))
|
||||
cpus = append(cpus, int(cpuid))
|
||||
}
|
||||
allocatableCPUs := b.Result()
|
||||
allocatableCPUs := cpuset.New(cpus...)
|
||||
|
||||
if onlineCPUs.Size() == 0 {
|
||||
ginkgo.By("expecting no CPUs reported")
|
||||
|
Reference in New Issue
Block a user