Skip to content

Commit

Permalink
Merge pull request #118578 from bart0sh/PR117-DRA-log-manager-errors
Browse files Browse the repository at this point in the history
DRA: report NodePrepareResource errors
  • Loading branch information
k8s-ci-robot committed Jul 17, 2023
2 parents 8633adb + 229eb93 commit 42141aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/kubelet/events/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const (
FailedCreatePodSandBox = "FailedCreatePodSandBox"
FailedStatusPodSandBox = "FailedPodSandBoxStatus"
FailedMountOnFilesystemMismatch = "FailedMountOnFilesystemMismatch"
FailedPrepareDynamicResources = "FailedPrepareDynamicResources"
)

// Image manager event reason list
Expand Down
9 changes: 8 additions & 1 deletion pkg/kubelet/kuberuntime/kuberuntime_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,14 @@ func (m *kubeGenericRuntimeManager) SyncPod(ctx context.Context, pod *v1.Pod, po

// Prepare resources allocated by the Dynammic Resource Allocation feature for the pod
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) {
if m.runtimeHelper.PrepareDynamicResources(pod) != nil {
if err := m.runtimeHelper.PrepareDynamicResources(pod); err != nil {
ref, referr := ref.GetReference(legacyscheme.Scheme, pod)
if referr != nil {
klog.ErrorS(referr, "Couldn't make a ref to pod", "pod", klog.KObj(pod))
return
}
m.recorder.Eventf(ref, v1.EventTypeWarning, events.FailedPrepareDynamicResources, "Failed to prepare dynamic resources: %v", err)
klog.ErrorS(err, "Failed to prepare dynamic resources", "pod", klog.KObj(pod))
return
}
}
Expand Down

0 comments on commit 42141aa

Please sign in to comment.