File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1- // Code generated by go generate; DO NOT EDIT.
21// Copyright 2021 HAProxy Technologies
32//
43// Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,9 +25,17 @@ import (
2625 "github.com/haproxytech/dataplaneapi/misc"
2726)
2827
29- func SyncWithFileSettings (server * Server , cfg * configuration.Configuration ) {
28+ func SyncWithFileSettings (server * Server , cfg * configuration.Configuration ) { //nolint: cyclop
3029 configStorage := cfg .GetStorageData ()
31- if configStorage .Dataplaneapi != nil && configStorage .Dataplaneapi .EnabledListeners != nil && ! misc .HasOSArg ("" , "scheme" , "" ) {
30+ // This is added to allow backward compatibility if no scheme is defined it defaults to specification schemes
31+ // and recently we added https to specification for clarity, and then old configs without scheme in them would
32+ // start to fail.
33+ if len (server .EnabledListeners ) == 0 && configStorage .Dataplaneapi != nil {
34+ if configStorage .Dataplaneapi .EnabledListeners == nil {
35+ configStorage .Dataplaneapi .EnabledListeners = & []string {"http" }
36+ }
37+ }
38+ if configStorage .Dataplaneapi .EnabledListeners != nil && ! misc .HasOSArg ("" , "scheme" , "" ) {
3239 server .EnabledListeners = * configStorage .Dataplaneapi .EnabledListeners
3340 }
3441 if configStorage .Dataplaneapi != nil && configStorage .Dataplaneapi .CleanupTimeout != nil && ! misc .HasOSArg ("" , "cleanup-timeout" , "" ) {
You can’t perform that action at this time.
0 commit comments