mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 21:36:24 +00:00
kubelet: DRA: remove check to set pluginName to DriverName if not in ResourceHandle
It has always been validated that a ResourceHandle MUST have DriverName set, so this check is unnecessary. Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
parent
f80be2728e
commit
805e7c3434
@ -223,12 +223,6 @@ func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error {
|
|||||||
|
|
||||||
// Loop through all plugins and prepare for calling NodePrepareResources.
|
// Loop through all plugins and prepare for calling NodePrepareResources.
|
||||||
for _, resourceHandle := range claimInfo.ResourceHandles {
|
for _, resourceHandle := range claimInfo.ResourceHandles {
|
||||||
// If no DriverName is provided in the resourceHandle, we
|
|
||||||
// use the DriverName from the status
|
|
||||||
pluginName := claimInfo.DriverName
|
|
||||||
if pluginName == "" {
|
|
||||||
pluginName = claimInfo.DriverName
|
|
||||||
}
|
|
||||||
claim := &drapb.Claim{
|
claim := &drapb.Claim{
|
||||||
Namespace: claimInfo.Namespace,
|
Namespace: claimInfo.Namespace,
|
||||||
Uid: string(claimInfo.ClaimUID),
|
Uid: string(claimInfo.ClaimUID),
|
||||||
@ -238,6 +232,7 @@ func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error {
|
|||||||
if resourceHandle.StructuredData != nil {
|
if resourceHandle.StructuredData != nil {
|
||||||
claim.StructuredResourceHandle = []*resourceapi.StructuredResourceHandle{resourceHandle.StructuredData}
|
claim.StructuredResourceHandle = []*resourceapi.StructuredResourceHandle{resourceHandle.StructuredData}
|
||||||
}
|
}
|
||||||
|
pluginName := resourceHandle.DriverName
|
||||||
batches[pluginName] = append(batches[pluginName], claim)
|
batches[pluginName] = append(batches[pluginName], claim)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,13 +454,6 @@ func (m *ManagerImpl) unprepareResources(podUID types.UID, namespace string, cla
|
|||||||
|
|
||||||
// Loop through all plugins and prepare for calling NodeUnprepareResources.
|
// Loop through all plugins and prepare for calling NodeUnprepareResources.
|
||||||
for _, resourceHandle := range claimInfo.ResourceHandles {
|
for _, resourceHandle := range claimInfo.ResourceHandles {
|
||||||
// If no DriverName is provided in the resourceHandle, we
|
|
||||||
// use the DriverName from the status
|
|
||||||
pluginName := resourceHandle.DriverName
|
|
||||||
if pluginName == "" {
|
|
||||||
pluginName = claimInfo.DriverName
|
|
||||||
}
|
|
||||||
|
|
||||||
claim := &drapb.Claim{
|
claim := &drapb.Claim{
|
||||||
Namespace: claimInfo.Namespace,
|
Namespace: claimInfo.Namespace,
|
||||||
Uid: string(claimInfo.ClaimUID),
|
Uid: string(claimInfo.ClaimUID),
|
||||||
@ -475,6 +463,7 @@ func (m *ManagerImpl) unprepareResources(podUID types.UID, namespace string, cla
|
|||||||
if resourceHandle.StructuredData != nil {
|
if resourceHandle.StructuredData != nil {
|
||||||
claim.StructuredResourceHandle = []*resourceapi.StructuredResourceHandle{resourceHandle.StructuredData}
|
claim.StructuredResourceHandle = []*resourceapi.StructuredResourceHandle{resourceHandle.StructuredData}
|
||||||
}
|
}
|
||||||
|
pluginName := resourceHandle.DriverName
|
||||||
batches[pluginName] = append(batches[pluginName], claim)
|
batches[pluginName] = append(batches[pluginName], claim)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user