mirror of
https://github.com/taylanbakircioglu/haproxy-openmanager.git
synced 2026-09-24 19:32:01 +00:00
fix: consistent section header detection in listen extraction
Additional fix for listen block extraction: - Section boundary check now uses ([[:space:]]|$) pattern - Previously only checked [[:space:]], missing 'defaults' at end of line - Ensures listen extraction stops correctly at any section header Pattern consistency verified across all 4 locations: - Linux install mode: global, defaults, listen extraction ✓ - Linux daemon mode: global, defaults, listen extraction ✓ - macOS install mode: global, defaults, listen extraction ✓ - macOS daemon mode: global, defaults, listen extraction ✓ Edge cases tested: - Named defaults (defaults http): works correctly - Multiple listen blocks: all preserved - Tab characters: handled by [[:space:]] - User's actual config structure: produces clean merge No impact on other agent functions (self-upgrade, metrics, etc.)
This commit is contained in:
@@ -1743,7 +1743,9 @@ check_config_updates() {
|
||||
}
|
||||
in_listen {
|
||||
# Check if we hit another section (frontend, backend, listen, global, defaults)
|
||||
if (/^(frontend|backend|listen|global|defaults)[[:space:]]/) {
|
||||
# CRITICAL FIX: Match keywords followed by whitespace OR end of line
|
||||
# This handles "defaults" without trailing whitespace
|
||||
if (/^(frontend|backend|listen|global|defaults)([[:space:]]|$)/) {
|
||||
# Print current listen block
|
||||
gsub(/\n[[:space:]]*$/, "", listen_content)
|
||||
print listen_content
|
||||
@@ -2925,7 +2927,9 @@ CONFIG_RESPONSE_EOF
|
||||
}
|
||||
in_listen {
|
||||
# Check if we hit another section (frontend, backend, listen, global, defaults)
|
||||
if (/^(frontend|backend|listen|global|defaults)[[:space:]]/) {
|
||||
# CRITICAL FIX: Match keywords followed by whitespace OR end of line
|
||||
# This handles "defaults" without trailing whitespace
|
||||
if (/^(frontend|backend|listen|global|defaults)([[:space:]]|$)/) {
|
||||
# Print current listen block
|
||||
gsub(/\n[[:space:]]*$/, "", listen_content)
|
||||
print listen_content
|
||||
|
||||
@@ -1689,7 +1689,9 @@ check_config_updates() {
|
||||
}
|
||||
in_listen {
|
||||
# Check if we hit another section (frontend, backend, listen, global, defaults)
|
||||
if (/^(frontend|backend|listen|global|defaults)[[:space:]]/) {
|
||||
# CRITICAL FIX: Match keywords followed by whitespace OR end of line
|
||||
# This handles "defaults" without trailing whitespace
|
||||
if (/^(frontend|backend|listen|global|defaults)([[:space:]]|$)/) {
|
||||
# Print current listen block
|
||||
gsub(/\n[[:space:]]*$/, "", listen_content)
|
||||
print listen_content
|
||||
@@ -2873,7 +2875,9 @@ CONFIG_RESPONSE_EOF
|
||||
}
|
||||
in_listen {
|
||||
# Check if we hit another section (frontend, backend, listen, global, defaults)
|
||||
if (/^(frontend|backend|listen|global|defaults)[[:space:]]/) {
|
||||
# CRITICAL FIX: Match keywords followed by whitespace OR end of line
|
||||
# This handles "defaults" without trailing whitespace
|
||||
if (/^(frontend|backend|listen|global|defaults)([[:space:]]|$)/) {
|
||||
# Print current listen block
|
||||
gsub(/\n[[:space:]]*$/, "", listen_content)
|
||||
print listen_content
|
||||
|
||||
Reference in New Issue
Block a user