Skip to content

Commit

Permalink
Moved logs to higher levels and a minor NIT
Browse files Browse the repository at this point in the history
  • Loading branch information
prashanth26 committed Jun 18, 2021
1 parent 423962a commit c1249cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/controller/deployment_rolling.go
Expand Up @@ -377,7 +377,7 @@ func (dc *controller) annotateNodesBackingMachineSets(MachineSets []*v1alpha1.Ma

for _, machineSet := range MachineSets {

klog.V(3).Infof("Trying to annotate nodes under the MachineSet object %q with %s", machineSet.Name, annotations)
klog.V(4).Infof("Trying to annotate nodes under the MachineSet object %q with %s", machineSet.Name, annotations)
selector, err := metav1.LabelSelectorAsSelector(machineSet.Spec.Selector)
if err != nil {
return err
Expand Down Expand Up @@ -409,7 +409,7 @@ func (dc *controller) annotateNodesBackingMachineSets(MachineSets []*v1alpha1.Ma
}
}
}
klog.V(2).Infof("Annotated the nodes backed by MachineSet %q with %s", machineSet.Name, annotations)
klog.V(4).Infof("Annotated the nodes backed by MachineSet %q with %s", machineSet.Name, annotations)
}

return nil
Expand Down Expand Up @@ -472,7 +472,7 @@ func (dc *controller) removeAutoscalerAnnotationsIfRequired(MachineSets []*v1alp
klog.Warningf("Removing annotation failed for node: %s, %s", machine.Status.Node, err)
return err
}
klog.V(3).Infof("De-annotated the node %q backed by MachineSet %q with %s", machine.Status.Node, machineSet.Name, annotations)
klog.V(4).Infof("De-annotated the node %q backed by MachineSet %q with %s", machine.Status.Node, machineSet.Name, annotations)
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/util/nodeops/taints.go
Expand Up @@ -30,6 +30,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
clientset "k8s.io/client-go/kubernetes"
clientretry "k8s.io/client-go/util/retry"
"k8s.io/klog"
)

// Backoff is the backoff period used while updating nodes
Expand Down Expand Up @@ -76,6 +77,8 @@ func AddOrUpdateTaintOnNode(c clientset.Interface, nodeName string, taints ...*v
if !updated {
return nil
}

klog.V(4).Infof("Trying to taint node %q to avoid scheduling of pods", nodeName)
return UpdateNodeTaints(c, nodeName, oldNode, newNode)
})
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/provider/machinecontroller/machine.go
Expand Up @@ -208,8 +208,8 @@ func (c *controller) addNodeToMachine(obj interface{}) {
}

machine, err := c.getMachineFromNode(key)
if err != nil && err != errNoMachineMatch {
if err != errNoMachineMatch {
if err != nil {
if err == errNoMachineMatch {
// errNoMachineMatch could mean that VM is still in creation hence ignoring it
return
}
Expand Down

0 comments on commit c1249cf

Please sign in to comment.