mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 13:55:41 +00:00
Merge pull request #118578 from bart0sh/PR117-DRA-log-manager-errors
DRA: report NodePrepareResource errors
This commit is contained in:
commit
42141aaf93
@ -74,6 +74,7 @@ const (
|
|||||||
FailedCreatePodSandBox = "FailedCreatePodSandBox"
|
FailedCreatePodSandBox = "FailedCreatePodSandBox"
|
||||||
FailedStatusPodSandBox = "FailedPodSandBoxStatus"
|
FailedStatusPodSandBox = "FailedPodSandBoxStatus"
|
||||||
FailedMountOnFilesystemMismatch = "FailedMountOnFilesystemMismatch"
|
FailedMountOnFilesystemMismatch = "FailedMountOnFilesystemMismatch"
|
||||||
|
FailedPrepareDynamicResources = "FailedPrepareDynamicResources"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Image manager event reason list
|
// Image manager event reason list
|
||||||
|
@ -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
|
// Prepare resources allocated by the Dynammic Resource Allocation feature for the pod
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) {
|
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
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user