mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #3356 from dchen1107/image
Fix a crash for kubelet when without EtcdClient.
This commit is contained in:
commit
0105a48b87
@ -20,6 +20,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
@ -225,8 +226,7 @@ func makePodSourceConfig(kc *KubeletConfig) *config.PodConfig {
|
|||||||
glog.Infof("Adding manifest url: %v", kc.ManifestURL)
|
glog.Infof("Adding manifest url: %v", kc.ManifestURL)
|
||||||
config.NewSourceURL(kc.ManifestURL, kc.HttpCheckFrequency, cfg.Channel(kubelet.HTTPSource))
|
config.NewSourceURL(kc.ManifestURL, kc.HttpCheckFrequency, cfg.Channel(kubelet.HTTPSource))
|
||||||
}
|
}
|
||||||
|
if !reflect.ValueOf(kc.EtcdClient).IsNil() {
|
||||||
if kc.EtcdClient != nil {
|
|
||||||
glog.Infof("Watching for etcd configs at %v", kc.EtcdClient.GetCluster())
|
glog.Infof("Watching for etcd configs at %v", kc.EtcdClient.GetCluster())
|
||||||
config.NewSourceEtcd(config.EtcdKeyForHost(kc.Hostname), kc.EtcdClient, cfg.Channel(kubelet.EtcdSource))
|
config.NewSourceEtcd(config.EtcdKeyForHost(kc.Hostname), kc.EtcdClient, cfg.Channel(kubelet.EtcdSource))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user