@@ -72,7 +72,7 @@ func (c *Controller) TryRemoveTaintedNodes(opts scaleOpts) (int, error) {
72
72
if now .Sub (* taintedTime ) > opts .nodeGroup .Opts .SoftDeleteGracePeriodDuration () {
73
73
if k8s .NodeEmpty (candidate , opts .nodeGroup .NodeInfoMap ) || now .Sub (* taintedTime ) > opts .nodeGroup .Opts .HardDeleteGracePeriodDuration () {
74
74
drymode := c .dryMode (opts .nodeGroup )
75
- log .WithField ("drymode" , drymode ).Infof ("Node %v, %v ready to be deleted" , candidate .Name , candidate .Spec .ProviderID )
75
+ log .WithField ("drymode" , drymode ).WithField ( "nodegroup" , opts . nodeGroup . Opts . Name ). Infof ("Node %v, %v ready to be deleted" , candidate .Name , candidate .Spec .ProviderID )
76
76
if ! drymode {
77
77
toBeDeleted = append (toBeDeleted , candidate )
78
78
}
@@ -128,7 +128,7 @@ func (c *Controller) TryRemoveTaintedNodes(opts scaleOpts) (int, error) {
128
128
log .WithError (err ).Errorf ("failed to delete nodes from kubernetes" )
129
129
return 0 , err
130
130
}
131
- log .Infof ("Sent delete request to %v nodes" , len (toBeDeleted ))
131
+ log .WithField ( "nodegroup" , opts . nodeGroup . Opts . Name ). Infof ("Sent delete request to %v nodes" , len (toBeDeleted ))
132
132
metrics .NodeGroupPodsEvicted .WithLabelValues (opts .nodeGroup .Opts .Name ).Add (float64 (podsRemaining ))
133
133
}
134
134
@@ -162,7 +162,7 @@ func (c *Controller) scaleDownTaint(opts scaleOpts) (int, error) {
162
162
// Perform the tainting loop with the fail safe around it
163
163
tainted := c .taintOldestN (opts .untaintedNodes , opts .nodeGroup , nodesToRemove )
164
164
165
- log .Infof ("Tainted a total of %v nodes" , len (tainted ))
165
+ log .WithField ( "nodegroup" , nodegroupName ). Infof ("Tainted a total of %v nodes" , len (tainted ))
166
166
return len (tainted ), nil
167
167
}
168
168
@@ -184,7 +184,7 @@ func (c *Controller) taintOldestN(nodes []*v1.Node, nodeGroup *NodeGroupState, n
184
184
185
185
// only actually taint in dry mode
186
186
if ! c .dryMode (nodeGroup ) {
187
- log .WithField ("drymode" , "off" ).Infof ("Tainting node %v" , bundle .node .Name )
187
+ log .WithField ("drymode" , "off" ).WithField ( "nodegroup" , nodeGroup . Opts . Name ). Infof ("Tainting node %v" , bundle .node .Name )
188
188
189
189
// Taint the node
190
190
updatedNode , err := k8s .AddToBeRemovedTaint (bundle .node , c .Client , nodeGroup .Opts .TaintEffect )
@@ -197,7 +197,7 @@ func (c *Controller) taintOldestN(nodes []*v1.Node, nodeGroup *NodeGroupState, n
197
197
} else {
198
198
nodeGroup .taintTracker = append (nodeGroup .taintTracker , bundle .node .Name )
199
199
taintedIndices = append (taintedIndices , bundle .index )
200
- log .WithField ("drymode" , "on" ).Infof ("Tainting node %v" , bundle .node .Name )
200
+ log .WithField ("drymode" , "on" ).WithField ( "nodegroup" , nodeGroup . Opts . Name ). Infof ("Tainting node %v" , bundle .node .Name )
201
201
}
202
202
}
203
203
0 commit comments