Переглянути джерело

Check source before Run()

Matt Bolt 4 роки тому
батько
коміт
f643f3dbac
1 змінених файлів з 5 додано та 0 видалено
  1. 5 0
      pkg/clustercache/clusterimporter.go

+ 5 - 0
pkg/clustercache/clusterimporter.go

@@ -60,6 +60,11 @@ func (ci *ClusterImporter) update(data []byte) {
 
 // Run starts the watcher processes
 func (ci *ClusterImporter) Run() {
+	if ci.source == nil {
+		log.Errorf("ClusterImporter source does not exist, not running")
+		return
+	}
+
 	exists, err := ci.source.Exists()
 	if err != nil {
 		log.Errorf("Failed to import source for cluster: %s", err)