controller: err check before log/event success for renderedcfg creation
@@ -495,6 +495,9 @@ func (ctrl *Controller) syncGeneratedMachineConfig(pool *mcfgv1.MachineConfigPoo
_, err = ctrl.mcLister.Get(generated.Name)
if apierrors.IsNotFound(err) {
_, err = ctrl.client.MachineconfigurationV1().MachineConfigs().Create(context.TODO(), generated, metav1.CreateOptions{})
+ if err != nil {
+ return err
+ }
glog.V(2).Infof("Generated machineconfig %s from %d configs: %s", generated.Name, len(source), source)
ctrl.eventRecorder.Eventf(pool, corev1.EventTypeNormal, "RenderedConfigGenerated", "%s successfully generated", generated.Name)
}
