Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/controller/kubelet-config/kubelet_config_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ 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 {
newcfg, err := ctrl.mckLister.Get(cfg.Name)
if err != nil {
return err
newcfg, getErr := ctrl.mckLister.Get(cfg.Name)
if getErr != nil {
return getErr
}
newcfg.Status.Conditions = append(newcfg.Status.Conditions, wrapErrorWithCondition(err, args...))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and maybe this needs to be wrapped in a if err != nil to avoid reporting nothing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrapErrorWithCondition returns Success if error = nil (https://github.com/openshift/machine-config-operator/blob/master/pkg/controller/kubelet-config/helpers.go#L119).
So to me it looks like it'll always append a new condition here and we don't need to avoid this step,

Copy link
Contributor

@LorbusChris LorbusChris Apr 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah but looks like the return below ends up making the syncHandler return nil on no-error runs. Maybe we want to report a success/no errors msg here?

_, lerr := ctrl.client.MachineconfigurationV1().KubeletConfigs().UpdateStatus(newcfg)
Expand Down