From bee8caf96cec8431a372773d15ad657086fb8363 Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Mon, 6 Nov 2023 13:08:45 +0100 Subject: [PATCH] BUG/MINOR: configuration: fix stats-show node to work without name --- configuration/configuration.go | 4 +--- models/stats_options.go | 2 +- specification/build/haproxy_spec.yaml | 1 + specification/models/configuration/misc.yaml | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configuration/configuration.go b/configuration/configuration.go index c48d9ca0..749ba96e 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -1071,9 +1071,7 @@ func (s *SectionParser) statsOptions() interface{} { //nolint:gocognit opt.StatsRefreshDelay = misc.ParseTimeout(v.Delay) } case *stats.ShowNode: - if v.Name != "" { - opt.StatsShowNodeName = misc.StringP(v.Name) - } + opt.StatsShowNodeName = misc.StringP(v.Name) case *stats.URI: if v.Prefix != "" { opt.StatsURIPrefix = v.Prefix diff --git a/models/stats_options.go b/models/stats_options.go index 6ce4e6f8..c7a1ca42 100644 --- a/models/stats_options.go +++ b/models/stats_options.go @@ -82,7 +82,7 @@ type StatsOptions struct { // stats show node name // Pattern: ^[^\s]+$ - StatsShowNodeName *string `json:"stats_show_node_name,omitempty"` + StatsShowNodeName *string `json:"stats_show_node_name"` // stats uri prefix // Pattern: ^[^\s]+$ diff --git a/specification/build/haproxy_spec.yaml b/specification/build/haproxy_spec.yaml index b08434da..824dc00d 100644 --- a/specification/build/haproxy_spec.yaml +++ b/specification/build/haproxy_spec.yaml @@ -7596,6 +7596,7 @@ definitions: pattern: ^[^\s]+$ type: string x-nullable: true + x-omitempty: false stats_uri_prefix: pattern: ^[^\s]+$ type: string diff --git a/specification/models/configuration/misc.yaml b/specification/models/configuration/misc.yaml index 5752f7b5..13e125e5 100644 --- a/specification/models/configuration/misc.yaml +++ b/specification/models/configuration/misc.yaml @@ -245,6 +245,7 @@ stats_options: type: string pattern: '^[^\s]+$' x-nullable: true + x-omitempty: false stats_uri_prefix: type: string pattern: '^[^\s]+$'