From 833748b9e807fd651a2c6773675b069656c23661 Mon Sep 17 00:00:00 2001 From: medcl Date: Wed, 25 Oct 2023 09:02:46 +0800 Subject: [PATCH] ignore invalid clusters --- modules/agent/api/remote_config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/agent/api/remote_config.go b/modules/agent/api/remote_config.go index 5e3467a0..6ebc8049 100644 --- a/modules/agent/api/remote_config.go +++ b/modules/agent/api/remote_config.go @@ -159,6 +159,10 @@ func getAgentIngestConfigs(instance string, items map[string]BindingItem) (strin } metadata := elastic.GetMetadata(v.ClusterID) + if metadata == nil || metadata.Config == nil{ + log.Errorf("metadata is nil: %v",v.ClusterID) + continue + } var clusterLevelEnabled = false var nodeLevelEnabled = true var clusterEndPoint = metadata.Config.GetAnyEndpoint()