From eed826a25ec83fac1531a788b6383f53da04d1ee Mon Sep 17 00:00:00 2001 From: stewart-yu Date: Mon, 27 Nov 2017 21:15:10 +0800 Subject: [PATCH] fix bug when cloud is nil --- cmd/cloud-controller-manager/app/controllermanager.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/cloud-controller-manager/app/controllermanager.go b/cmd/cloud-controller-manager/app/controllermanager.go index c93da56dad5..531fd81ac8d 100644 --- a/cmd/cloud-controller-manager/app/controllermanager.go +++ b/cmd/cloud-controller-manager/app/controllermanager.go @@ -93,6 +93,10 @@ func Run(s *options.CloudControllerManagerServer) error { glog.Fatalf("Cloud provider could not be initialized: %v", err) } + if cloud == nil { + glog.Fatalf("cloud provider is nil") + } + if cloud.HasClusterID() == false { if s.AllowUntaggedCloud == true { glog.Warning("detected a cluster without a ClusterID. A ClusterID will be required in the future. Please tag your cluster to avoid any future issues")