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.
2
1
// Copyright 2021 HAProxy Technologies
3
2
//
4
3
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,9 +25,17 @@ import (
26
25
"github.com/haproxytech/dataplaneapi/misc"
27
26
)
28
27
29
- func SyncWithFileSettings (server * Server , cfg * configuration.Configuration ) {
28
+ func SyncWithFileSettings (server * Server , cfg * configuration.Configuration ) { //nolint: cyclop
30
29
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" , "" ) {
32
39
server .EnabledListeners = * configStorage .Dataplaneapi .EnabledListeners
33
40
}
34
41
if configStorage .Dataplaneapi != nil && configStorage .Dataplaneapi .CleanupTimeout != nil && ! misc .HasOSArg ("" , "cleanup-timeout" , "" ) {
You can’t perform that action at this time.
0 commit comments