From f5d0424b423bb203a680e1c0b1dc4d4d4b375e9d Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Tue, 14 Mar 2023 08:57:29 -0500 Subject: [PATCH] cr: use reflect when comparing envoy config blocks --- nomad/structs/services.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nomad/structs/services.go b/nomad/structs/services.go index 229264b93c37..4496ba707b67 100644 --- a/nomad/structs/services.go +++ b/nomad/structs/services.go @@ -1201,7 +1201,7 @@ func (t *SidecarTask) Equal(o *SidecarTask) bool { return false } - // config compare + // task config, use opaque maps equal if !helper.OpaqueMapsEqual(t.Config, o.Config) { return false } @@ -1400,7 +1400,8 @@ func (p *ConsulProxy) Equal(o *ConsulProxy) bool { return false } - if !helper.OpaqueMapsEqual(p.Config, o.Config) { + // envoy config, use reflect + if !reflect.DeepEqual(p.Config, o.Config) { return false } @@ -1495,7 +1496,8 @@ func (u *ConsulUpstream) Equal(o *ConsulUpstream) bool { return false case !u.MeshGateway.Equal(o.MeshGateway): return false - case !helper.OpaqueMapsEqual(u.Config, o.Config): + case !reflect.DeepEqual(u.Config, o.Config): + // envoy config, use reflect return false } return true @@ -1781,7 +1783,8 @@ func (p *ConsulGatewayProxy) Equal(o *ConsulGatewayProxy) bool { return false } - if !helper.OpaqueMapsEqual(p.Config, o.Config) { + // envoy config, use reflect + if !reflect.DeepEqual(p.Config, o.Config) { return false }