From b119f4a1ccff077a770d2e31a274d445b98d47fd 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 0a03c8ec..3aa0a3cf 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -1193,9 +1193,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 35698d29..89a63e83 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 404cf0e2..479c17a8 100644 --- a/specification/build/haproxy_spec.yaml +++ b/specification/build/haproxy_spec.yaml @@ -6091,6 +6091,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 cd0d9988..fcbd44fa 100644 --- a/specification/models/configuration/misc.yaml +++ b/specification/models/configuration/misc.yaml @@ -212,6 +212,7 @@ stats_options: type: string pattern: '^[^\s]+$' x-nullable: true + x-omitempty: false stats_uri_prefix: type: string pattern: '^[^\s]+$'