mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Update gofmt.
This commit is contained in:
parent
ea2f888109
commit
f04cfdf6e7
@ -107,7 +107,7 @@ type DynamicResources struct {
|
||||
enablePrioritizedList bool
|
||||
enableSchedulingQueueHint bool
|
||||
enablePartitionableDevices bool
|
||||
enableDeviceTaints bool
|
||||
enableDeviceTaints bool
|
||||
|
||||
fh framework.Handle
|
||||
clientset kubernetes.Interface
|
||||
@ -460,7 +460,7 @@ func (pl *DynamicResources) PreFilter(ctx context.Context, state *framework.Cycl
|
||||
AdminAccess: pl.enableAdminAccess,
|
||||
PrioritizedList: pl.enablePrioritizedList,
|
||||
PartitionableDevices: pl.enablePartitionableDevices,
|
||||
DeviceTaints: pl.enableDeviceTaints,
|
||||
DeviceTaints: pl.enableDeviceTaints,
|
||||
}
|
||||
allocator, err := structured.NewAllocator(ctx, features, allocateClaims, allAllocatedDevices, pl.draManager.DeviceClasses(), slices, pl.celCache)
|
||||
if err != nil {
|
||||
|
@ -62,7 +62,7 @@ type BasicDevice struct {
|
||||
NodeName *string
|
||||
NodeSelector *v1.NodeSelector
|
||||
AllNodes *bool
|
||||
Taints []resourceapi.DeviceTaint
|
||||
Taints []resourceapi.DeviceTaint
|
||||
}
|
||||
|
||||
type DeviceCounterConsumption struct {
|
||||
|
@ -731,6 +731,71 @@ func TestControllerSyncPool(t *testing.T) {
|
||||
Pool(resourceapi.ResourcePool{Name: poolName, Generation: 1, ResourceSliceCount: 1}).Obj(),
|
||||
},
|
||||
},
|
||||
"add-shared-counters": {
|
||||
nodeUID: nodeUID,
|
||||
initialObjects: []runtime.Object{
|
||||
MakeResourceSlice().Name(generatedName1).GenerateName(generateName).
|
||||
NodeOwnerReferences(ownerName, string(nodeUID)).NodeName(ownerName).
|
||||
Driver(driverName).Devices([]resourceapi.Device{{
|
||||
Name: deviceName,
|
||||
Basic: &resourceapi.BasicDevice{
|
||||
Taints: []resourceapi.DeviceTaint{{
|
||||
Effect: resourceapi.DeviceTaintEffectNoExecute,
|
||||
TimeAdded: &timeAdded,
|
||||
}},
|
||||
}}}).
|
||||
Pool(resourceapi.ResourcePool{Name: poolName, Generation: 1, ResourceSliceCount: 1}).
|
||||
Obj(),
|
||||
},
|
||||
inputDriverResources: &DriverResources{
|
||||
Pools: map[string]Pool{
|
||||
poolName: {
|
||||
Generation: 1,
|
||||
Slices: []Slice{{Devices: []resourceapi.Device{{
|
||||
Name: deviceName,
|
||||
Basic: &resourceapi.BasicDevice{
|
||||
Taints: []resourceapi.DeviceTaint{
|
||||
{
|
||||
Effect: resourceapi.DeviceTaintEffectNoExecute,
|
||||
// No time added here! Time from existing slice must get copied during update.
|
||||
},
|
||||
{
|
||||
Key: "example.com/tainted",
|
||||
Effect: resourceapi.DeviceTaintEffectNoSchedule,
|
||||
TimeAdded: &timeAddedLater,
|
||||
},
|
||||
},
|
||||
}}},
|
||||
}},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedStats: Stats{
|
||||
NumUpdates: 1,
|
||||
},
|
||||
expectedResourceSlices: []resourceapi.ResourceSlice{
|
||||
*MakeResourceSlice().Name(generatedName1).GenerateName(generateName).
|
||||
ResourceVersion("1").
|
||||
NodeOwnerReferences(ownerName, string(nodeUID)).NodeName(ownerName).
|
||||
Driver(driverName).Devices([]resourceapi.Device{{
|
||||
Name: deviceName,
|
||||
Basic: &resourceapi.BasicDevice{
|
||||
Taints: []resourceapi.DeviceTaint{
|
||||
{
|
||||
Effect: resourceapi.DeviceTaintEffectNoExecute,
|
||||
TimeAdded: &timeAdded,
|
||||
},
|
||||
{
|
||||
Key: "example.com/tainted",
|
||||
Effect: resourceapi.DeviceTaintEffectNoSchedule,
|
||||
TimeAdded: &timeAddedLater,
|
||||
},
|
||||
},
|
||||
}}}).
|
||||
Pool(resourceapi.ResourcePool{Name: poolName, Generation: 1, ResourceSliceCount: 1}).
|
||||
Obj(),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, test := range testCases {
|
||||
|
@ -341,7 +341,7 @@ claims:
|
||||
allocator, err := structured.NewAllocator(tCtx, structured.Features{
|
||||
PrioritizedList: utilfeature.DefaultFeatureGate.Enabled(features.DRAPrioritizedList),
|
||||
AdminAccess: utilfeature.DefaultFeatureGate.Enabled(features.DRAAdminAccess),
|
||||
DeviceTaints: utilfeature.DefaultFeatureGate.Enabled(features.DRADeviceTaints),
|
||||
DeviceTaints: utilfeature.DefaultFeatureGate.Enabled(features.DRADeviceTaints),
|
||||
}, []*resourceapi.ResourceClaim{claim}, allocatedDevices, draManager.DeviceClasses(), slices, celCache)
|
||||
tCtx.ExpectNoError(err, "create allocator")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user