nowFuncfunc()time.Time,// typically Kubelet.clock.Now
nowFuncfunc()time.Time,// typically Kubelet.clock.Now
runtimeErrorsFuncfunc()error,// typically Kubelet.runtimeState.runtimeErrors
runtimeErrorsFuncfunc()error,// typically Kubelet.runtimeState.runtimeErrors
networkErrorsFuncfunc()error,// typically Kubelet.runtimeState.networkErrors
networkErrorsFuncfunc()error,// typically Kubelet.runtimeState.networkErrors
storageErrorsFuncfunc()error,// typically Kubelet.runtimeState.storageErrors
appArmorValidateHostFuncfunc()error,// typically Kubelet.appArmorValidator.ValidateHost, might be nil depending on whether there was an appArmorValidator
appArmorValidateHostFuncfunc()error,// typically Kubelet.appArmorValidator.ValidateHost, might be nil depending on whether there was an appArmorValidator
cmStatusFuncfunc()cm.Status,// typically Kubelet.containerManager.Status
cmStatusFuncfunc()cm.Status,// typically Kubelet.containerManager.Status
recordEventFuncfunc(eventType,eventstring),// typically Kubelet.recordNodeStatusEvent
recordEventFuncfunc(eventType,eventstring),// typically Kubelet.recordNodeStatusEvent
klog.V(4).Infof("Initializing migrated drivers on CSINodeInfo")
// TODO(dyzz): Just augment CreateCSINodeInfo to create the annotation on itself. Also update all updating functions to double check that the annotation is correct (yes)
_,err:=nim.CreateCSINode()
iferr!=nil{
kvh.SetKubeletError(fmt.Errorf("Failed to initialize CSINodeInfo: %v",err))
klog.Errorf("Failed to initialize CSINodeInfo: %v",err)
returnfalse,nil
}
// Successfully initialized drivers, allow Kubelet to post Ready
kvh.SetKubeletError(nil)
returntrue,nil
})
iferr!=nil{
// Kill the Kubelet process and allow it to restart to retry initialization
klog.Fatalf("Failed to initialize CSINodeInfo after retrying")