Merge pull request #67585 from mborsz/getmaster

Automatic merge from submit-queue (batch tested with PRs 66229, 67682, 67585, 67641, 67697). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Don't ignore error in GetMasterAndWorkerNodesOrDie.

**What this PR does / why we need it**:

In https://github.com/kubernetes/kubernetes/issues/67584 I'm seeing that method to be failing. Without any error message, it's not possible to debug what is happening there.
Although this method has 'OrDie' in name, it ignores an error and never dies.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-08-22 10:04:13 -07:00 committed by GitHub
commit 408ddbc23c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4831,7 +4831,8 @@ func WaitForStableCluster(c clientset.Interface, masterNodes sets.String) int {
func GetMasterAndWorkerNodesOrDie(c clientset.Interface) (sets.String, *v1.NodeList) {
nodes := &v1.NodeList{}
masters := sets.NewString()
all, _ := c.CoreV1().Nodes().List(metav1.ListOptions{})
all, err := c.CoreV1().Nodes().List(metav1.ListOptions{})
ExpectNoError(err)
for _, n := range all.Items {
if system.IsMasterNode(n.Name) {
masters.Insert(n.Name)