Skip to content

Commit

Permalink
controller/render: add event when rendered cfg generated
Browse files Browse the repository at this point in the history
  • Loading branch information
kikisdeliveryservice committed May 24, 2021
1 parent e1203d4 commit 54e68f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/render/render_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func (ctrl *Controller) syncMachineConfigPool(key string) error {
pool := machineconfigpool.DeepCopy()
everything := metav1.LabelSelector{}
if reflect.DeepEqual(pool.Spec.MachineConfigSelector, &everything) {
ctrl.eventRecorder.Eventf(pool, corev1.EventTypeWarning, "SelectingAll", "This machineconfigpool is selecting all machineconfigs. A non-empty selector is require.")
ctrl.eventRecorder.Eventf(pool, corev1.EventTypeWarning, "SelectingAll", "This machineconfigpool is selecting all machineconfigs. A non-empty selector is required.")
return nil
}

Expand Down Expand Up @@ -496,6 +496,7 @@ func (ctrl *Controller) syncGeneratedMachineConfig(pool *mcfgv1.MachineConfigPoo
if apierrors.IsNotFound(err) {
_, err = ctrl.client.MachineconfigurationV1().MachineConfigs().Create(context.TODO(), generated, metav1.CreateOptions{})
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)
}
if err != nil {
return err
Expand Down

0 comments on commit 54e68f7

Please sign in to comment.