Merge pull request #34997 from vmware/fix-kube-vsphere.kerneltime

Automatic merge from submit-queue

Fix kube vsphere.kerneltime

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
This fixes kube-up to correctly install and configure on vSphere and avoid panics when only a single ESX(hypervisor) is used instead of a cluster.

**Which issue this PR fixes** 
fixes #34992
fixes #34847

**Special notes for your reviewer**:

We plan to cherry pick this into 1.4 release branch as well Ref: https://github.com/kubernetes/kubernetes/pull/34993
This commit is contained in:
Kubernetes Submit Queue 2016-10-18 09:26:18 -07:00 committed by GitHub
commit 01c31b380d
3 changed files with 3 additions and 3 deletions

View File

@ -70,5 +70,5 @@ EOF
#
# -M installs the master
set +x
curl -L --connect-timeout 20 --retry 6 --retry-delay 10 https://bootstrap.saltstack.com | sh -s -- -M -X
curl -L --connect-timeout 20 --retry 6 --retry-delay 10 https://bootstrap.saltstack.com | sh -s -- -M -X stable 2016.3.2
set -x

View File

@ -65,4 +65,4 @@ EOF
#
# We specify -X to avoid a race condition that can cause minion failure to
# install. See https://github.com/saltstack/salt-bootstrap/issues/270
curl -L --connect-timeout 20 --retry 6 --retry-delay 10 https://bootstrap.saltstack.com | sh -s -- -X
curl -L --connect-timeout 20 --retry 6 --retry-delay 10 https://bootstrap.saltstack.com | sh -s -- -X stable 2016.3.2

View File

@ -252,7 +252,7 @@ func readInstance(cfg *VSphereConfig) (string, string, error) {
var rp mo.ResourcePool
err = s.Properties(ctx, *vm.ResourcePool, []string{"parent"}, &rp)
if err == nil {
var ccr mo.ClusterComputeResource
var ccr mo.ComputeResource
err = s.Properties(ctx, *rp.Parent, []string{"name"}, &ccr)
if err == nil {
cluster = ccr.Name