mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
Merge pull request #43852 from ailusazh/AddSuccessfulMountVolumeMsgToEvent
Automatic merge from submit-queue Add SuccessfulMountVolume message to the events of pod **What this PR does / why we need it:** When creating a pod with volume, the volume mount may failed at first, but eventually succeed after retry several times. kubectl describe pod can only see the failed messages, so i think it will be better to add the SuccessfulMountVolume message to the pod events too. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # Fixes #42867
This commit is contained in:
commit
974606544d
@ -465,11 +465,14 @@ func (og *operationGenerator) GenerateMountVolumeFunc(
|
|||||||
return detailedErr
|
return detailedErr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
simpleMsg, detailedMsg := volumeToMount.GenerateMsg("MountVolume.SetUp succeeded", "")
|
||||||
verbosity := glog.Level(1)
|
verbosity := glog.Level(1)
|
||||||
if isRemount {
|
if isRemount {
|
||||||
verbosity = glog.Level(7)
|
verbosity = glog.Level(7)
|
||||||
|
} else {
|
||||||
|
og.recorder.Eventf(volumeToMount.Pod, v1.EventTypeNormal, kevents.SuccessfulMountVolume, simpleMsg)
|
||||||
}
|
}
|
||||||
glog.V(verbosity).Infof(volumeToMount.GenerateMsgDetailed("MountVolume.SetUp succeeded", ""))
|
glog.V(verbosity).Infof(detailedMsg)
|
||||||
|
|
||||||
// Update actual state of world
|
// Update actual state of world
|
||||||
markVolMountedErr := actualStateOfWorld.MarkVolumeAsMounted(
|
markVolMountedErr := actualStateOfWorld.MarkVolumeAsMounted(
|
||||||
|
Loading…
Reference in New Issue
Block a user