mirror of https://github.com/status-im/consul.git
Avoid nil panic when cluster config doesn't exist
This commit is contained in:
parent
66de74767c
commit
75edc9bc7c
|
@ -59,6 +59,7 @@ func (s *Server) clustersFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapsh
|
||||||
// In transparent proxy mode there needs to be a passthrough cluster for traffic going to destinations
|
// In transparent proxy mode there needs to be a passthrough cluster for traffic going to destinations
|
||||||
// that aren't in Consul's catalog.
|
// that aren't in Consul's catalog.
|
||||||
if cfgSnap.Proxy.Mode == structs.ProxyModeTransparent &&
|
if cfgSnap.Proxy.Mode == structs.ProxyModeTransparent &&
|
||||||
|
cfgSnap.ConnectProxy.ClusterConfig != nil &&
|
||||||
!cfgSnap.ConnectProxy.ClusterConfig.TransparentProxy.CatalogDestinationsOnly {
|
!cfgSnap.ConnectProxy.ClusterConfig.TransparentProxy.CatalogDestinationsOnly {
|
||||||
|
|
||||||
clusters = append(clusters, &envoy_cluster_v3.Cluster{
|
clusters = append(clusters, &envoy_cluster_v3.Cluster{
|
||||||
|
|
Loading…
Reference in New Issue