Skip to content

Commit 5ed2686

Browse files
committed
MINOR: add deprecation warning log to Httpclose HTTPKeepAlive and HTTPServerClose
1 parent b66268a commit 5ed2686

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

embedded_spec.go

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
github.com/go-openapi/validate v0.22.1
2323
github.com/google/renameio v1.0.1
2424
github.com/google/uuid v1.3.0
25-
github.com/haproxytech/client-native/v5 v5.0.1-0.20230710054839-8879b6b71da0
25+
github.com/haproxytech/client-native/v5 v5.0.1-0.20230801141958-2081a288d108
2626
github.com/haproxytech/config-parser/v5 v5.0.1-0.20230621085204-83b68fc565ef
2727
github.com/jessevdk/go-flags v1.5.0
2828
github.com/json-iterator/go v1.1.12
@@ -75,6 +75,6 @@ require (
7575
github.com/tklauser/numcpus v0.6.1 // indirect
7676
github.com/yusufpapurcu/wmi v1.2.3 // indirect
7777
go.mongodb.org/mongo-driver v1.12.0 // indirect
78-
golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect
78+
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 // indirect
7979
gopkg.in/yaml.v3 v3.0.1 // indirect
8080
)

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
129129
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
130130
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
131131
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
132-
github.com/haproxytech/client-native/v5 v5.0.1-0.20230710054839-8879b6b71da0 h1:V6y1VsT+IRoKi5FDmkb3qVqXzOnBr99gwEXVvySgQPw=
133-
github.com/haproxytech/client-native/v5 v5.0.1-0.20230710054839-8879b6b71da0/go.mod h1:du1wLSojM66Iv+GhkN6a84wcIfe31nwykRtiZjXJ0zo=
132+
github.com/haproxytech/client-native/v5 v5.0.1-0.20230801141958-2081a288d108 h1:sy3iSLEcXmfFdH4fs82uFmtXDbK0zQCrMTS68pXr900=
133+
github.com/haproxytech/client-native/v5 v5.0.1-0.20230801141958-2081a288d108/go.mod h1:IWu0kV+P/MU0eIfUPLdCaHWGOBhPCeKrdrEyPOAKBXo=
134134
github.com/haproxytech/config-parser/v5 v5.0.1-0.20230621085204-83b68fc565ef h1:IXxc+Mxwj1FMrnvqN/FmP+x5Uc7AaWX6Nwirft/qfcI=
135135
github.com/haproxytech/config-parser/v5 v5.0.1-0.20230621085204-83b68fc565ef/go.mod h1:7JxHGhCD6WRRc+++7QRBMjoUZMYEP+JRQmp/nBGI9zo=
136136
github.com/haproxytech/go-logger v1.1.0 h1:HgGtYaI1ApkvbQdsm7f9AzQQoxTB7w37criTflh7IQE=
@@ -266,8 +266,8 @@ golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaE
266266
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
267267
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
268268
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
269-
golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM=
270-
golang.org/x/exp v0.0.0-20230711023510-fffb14384f22/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
269+
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY=
270+
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
271271
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
272272
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
273273
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=

handlers/backend.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
package handlers
1717

1818
import (
19+
"github.com/haproxytech/dataplaneapi/log"
20+
1921
"github.com/go-openapi/runtime/middleware"
2022
client_native "github.com/haproxytech/client-native/v5"
2123
"github.com/haproxytech/client-native/v5/models"
@@ -53,6 +55,18 @@ type ReplaceBackendHandlerImpl struct {
5355
ReloadAgent haproxy.IReloadAgent
5456
}
5557

58+
func logDeprecatedFieldsWarning(b *models.Backend) {
59+
if b.Httpclose != "" {
60+
log.Warningf("Field Httpclose is deprecated. Use HTTPConnectionMode.")
61+
}
62+
if b.HTTPKeepAlive != "" {
63+
log.Warningf("Field HTTPKeepAlive is deprecated. Use HTTPConnectionMode.")
64+
}
65+
if b.HTTPServerClose != "" {
66+
log.Warningf("Field HTTPServerClose is deprecated. Use HTTPConnectionMode.")
67+
}
68+
}
69+
5670
// Handle executing the request and returning a response
5771
func (h *CreateBackendHandlerImpl) Handle(params backend.CreateBackendParams, principal interface{}) middleware.Responder {
5872
t := ""
@@ -74,6 +88,8 @@ func (h *CreateBackendHandlerImpl) Handle(params backend.CreateBackendParams, pr
7488
return backend.NewCreateBackendDefault(int(*e.Code)).WithPayload(e)
7589
}
7690

91+
logDeprecatedFieldsWarning(params.Data)
92+
7793
configuration, err := h.Client.Configuration()
7894
if err != nil {
7995
e := misc.HandleError(err)
@@ -201,6 +217,8 @@ func (h *ReplaceBackendHandlerImpl) Handle(params backend.ReplaceBackendParams,
201217
v = *params.Version
202218
}
203219

220+
logDeprecatedFieldsWarning(params.Data)
221+
204222
if t != "" && *params.ForceReload {
205223
msg := "Both force_reload and transaction specified, specify only one"
206224
c := misc.ErrHTTPBadRequest

0 commit comments

Comments
 (0)