Skip to content

Commit 407562d

Browse files
committed
status update fixes
Signed-off-by: Swati Gupta <[email protected]>
1 parent a4566a9 commit 407562d

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

cmd/gpu-kubelet-plugin/device_state.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2727
"k8s.io/apimachinery/pkg/runtime"
2828
metav1apply "k8s.io/client-go/applyconfigurations/meta/v1"
29-
resourceapply "k8s.io/client-go/applyconfigurations/resource/v1"
29+
resourceapply "k8s.io/client-go/applyconfigurations/resource/v1beta1"
3030
"k8s.io/dynamic-resource-allocation/kubeletplugin"
3131
"k8s.io/klog/v2"
3232
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager"
@@ -364,7 +364,7 @@ func (s *DeviceState) prepareDevices(ctx context.Context, claim *resourceapi.Res
364364

365365
// Update the resource claim status
366366
resourceClaimApply := resourceapply.ResourceClaim(claim.Name, claim.Namespace).WithStatus(resourceClaimStatus)
367-
_, err = s.config.clientsets.Resource.ResourceClaims(claim.Namespace).ApplyStatus(ctx,
367+
_, err = s.config.clientsets.Core.ResourceV1beta1().ResourceClaims(claim.Namespace).ApplyStatus(ctx,
368368
resourceClaimApply,
369369
metav1.ApplyOptions{FieldManager: DriverName, Force: true},
370370
)
@@ -609,19 +609,12 @@ func GetOpaqueDeviceConfigs(
609609
return resultConfigs, nil
610610
}
611611

612-
func (s *DeviceState) MarkDeviceUnhealthy(unhealthyDevice *AllocatableDevice) {
612+
func (s *DeviceState) MarkDeviceUnhealthy(device *AllocatableDevice) {
613613
s.Lock()
614614
defer s.Unlock()
615615

616-
uuid := unhealthyDevice.GetUUID()
617-
device, ok := s.allocatable[uuid]
618-
if !ok {
619-
klog.Warningf("Attempted to mark unknown device as unhealthy: %s", uuid)
620-
return
621-
}
622-
623616
device.Health = Unhealthy
624-
klog.Infof("Marked device:%s unhealthy", uuid)
617+
klog.Infof("Marked device:%s unhealthy", device.GetUUID())
625618
}
626619

627620
// TODO: Dynamic MIG is not yet supported with structured parameters.

0 commit comments

Comments
 (0)