Skip to content

Commit

Permalink
Merge pull request #759 from kochetov-dmitrij/logs-for-single-zone
Browse files Browse the repository at this point in the history
Print logs when adding a node in unmanaged zone
  • Loading branch information
k8s-ci-robot authored Sep 5, 2024
2 parents 1de8477 + cec3bb1 commit 8929def
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions providers/gce/gce.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"fmt"
"io"
"runtime"
"slices"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -827,6 +828,9 @@ func (g *Cloud) updateNodeZones(prevNode, newNode *v1.Node) {
g.nodeZones[newZone] = sets.NewString()
}
g.nodeZones[newZone].Insert(newNode.ObjectMeta.Name)
if !slices.Contains(g.managedZones, newZone) {
klog.Warningf("Initializing node %s in an unmanaged zone %s. Managed zones: %v", newNode.ObjectMeta.Name, newZone, g.managedZones)
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions providers/gce/gce_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,8 @@ func (g *Cloud) getFoundInstanceByNames(names []string) ([]*gceInstance, error)

// Gets the named instance, returning cloudprovider.InstanceNotFound if the instance is not found
func (g *Cloud) getInstanceByName(name string) (*gceInstance, error) {
klog.Infof("Searching node %s in managed zones %v", name, g.managedZones)

// Avoid changing behaviour when not managing multiple zones
for _, zone := range g.managedZones {
instance, err := g.getInstanceFromProjectInZoneByName(g.projectID, zone, name)
Expand Down

0 comments on commit 8929def

Please sign in to comment.