mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Detect if UpdateTCPLoadBalancer left its GCE target pool in an incorrect state.
This commit is contained in:
parent
1be091da07
commit
b0351ff266
@ -479,6 +479,19 @@ func (gce *GCECloud) UpdateTCPLoadBalancer(name, region string, hosts []string)
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Try to verify that the correct number of nodes are now in the target pool.
|
||||||
|
// We've been bitten by a bug here before (#11327) where all nodes were
|
||||||
|
// accidentally removed and want to make similar problems easier to notice.
|
||||||
|
updatedPool, err := gce.service.TargetPools.Get(gce.projectID, region, name).Do()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if len(updatedPool.Instances) != len(hosts) {
|
||||||
|
glog.Errorf("Unexpected number of instances (%d) in target pool %s after updating (expected %d). Instances in updated pool: %s",
|
||||||
|
len(updatedPool.Instances), name, len(hosts), strings.Join(updatedPool.Instances, ","))
|
||||||
|
return fmt.Errorf("Unexpected number of instances (%d) in target pool %s after update (expected %d)", len(updatedPool.Instances), name, len(hosts))
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user