kubeletconfig: Fix error propogation of status message
Log a warning on failure of status update, and return the actual error
to the caller.
@@ -333,7 +333,7 @@ func (ctrl *Controller) generateOriginalKubeletConfig(role string) (*ignv2_2type
}
func (ctrl *Controller) syncStatusOnly(cfg *mcfgv1.KubeletConfig, err error, args ...interface{}) error {
- return retry.RetryOnConflict(updateBackoff, func() error {
+ statusUpdateError := retry.RetryOnConflict(updateBackoff, func() error {
newcfg, getErr := ctrl.mckLister.Get(cfg.Name)
if getErr != nil {
return getErr
@@ -342,6 +342,10 @@ func (ctrl *Controller) syncStatusOnly(cfg *mcfgv1.KubeletConfig, err error, arg
_, lerr := ctrl.client.MachineconfigurationV1().KubeletConfigs().UpdateStatus(newcfg)
return lerr
})
+ if statusUpdateError != nil {
+ glog.Warningf("error updating kubeletconfig status: %v", statusUpdateError)
+ }
+ return err
}
// syncKubeletConfig will sync the kubeletconfig with the given key.
