Skip to content
Closed
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
12 changes: 6 additions & 6 deletions pkg/controller/render/render_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ func (ctrl *Controller) deleteMachineConfigPool(obj interface{}) {

func (ctrl *Controller) addMachineConfig(obj interface{}) {
mc := obj.(*mcfgv1.MachineConfig)
glog.Infof("MachineConfig %s added", mc.Name)

if mc.DeletionTimestamp != nil {
ctrl.deleteMachineConfig(mc)
return
Expand All @@ -173,7 +175,6 @@ func (ctrl *Controller) addMachineConfig(obj interface{}) {
controllerRef := metav1.GetControllerOf(mc)
if controllerRef != nil {
if pool := ctrl.resolveControllerRef(controllerRef); pool != nil {
glog.V(4).Infof("MachineConfig %s added", mc.Name)
ctrl.enqueueMachineConfigPool(pool)
return
}
Expand All @@ -185,7 +186,6 @@ func (ctrl *Controller) addMachineConfig(obj interface{}) {
return
}

glog.V(4).Infof("MachineConfig %s added", mc.Name)
for _, p := range pools {
ctrl.enqueueMachineConfigPool(p)
}
Expand All @@ -195,6 +195,8 @@ func (ctrl *Controller) updateMachineConfig(old, cur interface{}) {
oldMC := old.(*mcfgv1.MachineConfig)
curMC := cur.(*mcfgv1.MachineConfig)

glog.Infof("MachineConfig %s updated", curMC.Name)

curControllerRef := metav1.GetControllerOf(curMC)
oldControllerRef := metav1.GetControllerOf(oldMC)
controllerRefChanged := !reflect.DeepEqual(curControllerRef, oldControllerRef)
Expand All @@ -205,7 +207,6 @@ func (ctrl *Controller) updateMachineConfig(old, cur interface{}) {

if curControllerRef != nil {
if pool := ctrl.resolveControllerRef(curControllerRef); pool != nil {
glog.V(4).Infof("MachineConfig %s updated", curMC.Name)
ctrl.enqueueMachineConfigPool(pool)
return
}
Expand All @@ -217,7 +218,6 @@ func (ctrl *Controller) updateMachineConfig(old, cur interface{}) {
return
}

glog.V(4).Infof("MachineConfig %s updated", curMC.Name)
for _, p := range pools {
ctrl.enqueueMachineConfigPool(p)
}
Expand All @@ -239,10 +239,11 @@ func (ctrl *Controller) deleteMachineConfig(obj interface{}) {
}
}

glog.Infof("MachineConfig %s deleted", mc.Name)

controllerRef := metav1.GetControllerOf(mc)
if controllerRef != nil {
if pool := ctrl.resolveControllerRef(controllerRef); pool != nil {
glog.V(4).Infof("MachineConfig %s deleted", mc.Name)
ctrl.enqueueMachineConfigPool(pool)
return
}
Expand All @@ -254,7 +255,6 @@ func (ctrl *Controller) deleteMachineConfig(obj interface{}) {
return
}

glog.V(4).Infof("MachineConfig %s deleted", mc.Name)
for _, p := range pools {
ctrl.enqueueMachineConfigPool(p)
}
Expand Down