Skip to content

Commit c04f0ba

Browse files
hdurand0710Gopher Bot
authored andcommitted
MINOR: add from to all Frontends and Backends
1 parent aa559c5 commit c04f0ba

7 files changed

Lines changed: 16 additions & 4 deletions

File tree

deploy/tests/ut/acls/suite_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
v3 "github.com/haproxytech/kubernetes-ingress/crs/api/ingress/v3"
2424
"github.com/haproxytech/kubernetes-ingress/pkg/annotations"
2525
c "github.com/haproxytech/kubernetes-ingress/pkg/controller"
26+
"github.com/haproxytech/kubernetes-ingress/pkg/controller/constants"
2627
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy"
2728
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy/env"
2829
"github.com/haproxytech/kubernetes-ingress/pkg/ingress"
@@ -117,6 +118,7 @@ func (suite *ACLSuite) UseACLFixture() (eventChan chan k8ssync.SyncDataEvent) {
117118
Spec: v3.BackendSpec{
118119
Backend: models.Backend{
119120
BackendBase: models.BackendBase{
121+
From: constants.DefaultsSectionName,
120122
Name: "backend1",
121123
},
122124
ACLList: []*models.ACL{

deploy/tests/ut/httprequests/suite_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
v3 "github.com/haproxytech/kubernetes-ingress/crs/api/ingress/v3"
2424
"github.com/haproxytech/kubernetes-ingress/pkg/annotations"
2525
c "github.com/haproxytech/kubernetes-ingress/pkg/controller"
26+
"github.com/haproxytech/kubernetes-ingress/pkg/controller/constants"
2627
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy"
2728
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy/env"
2829
"github.com/haproxytech/kubernetes-ingress/pkg/ingress"
@@ -117,6 +118,7 @@ func (suite *HTTPRequestsSuite) UseHTTPRequestsFixture() (eventChan chan k8ssync
117118
Spec: v3.BackendSpec{
118119
Backend: models.Backend{
119120
BackendBase: models.BackendBase{
121+
From: constants.DefaultsSectionName,
120122
Name: "backend1",
121123
},
122124
HTTPRequestRuleList: models.HTTPRequestRules{

fs/usr/local/etc/haproxy/haproxy.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ defaults haproxytech
2626
peers localinstance
2727
peer local 127.0.0.1:10000
2828

29-
frontend https
29+
frontend https from haproxytech
3030
mode http
3131
http-request set-var(txn.base) base
3232
use_backend %[var(txn.path_match),field(1,.)]
3333

34-
frontend http
34+
frontend http from haproxytech
3535
mode http
3636
http-request set-var(txn.base) base
3737
use_backend %[var(txn.path_match),field(1,.)]
3838

39-
frontend healthz
39+
frontend healthz from haproxytech
4040
mode http
4141
no log
4242
monitor-uri /healthz
4343

44-
frontend stats
44+
frontend stats from haproxytech
4545
mode http
4646
no log
4747
http-request set-var(txn.base) base

pkg/gateways/gateways.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"sort"
2020

2121
"github.com/haproxytech/client-native/v6/models"
22+
"github.com/haproxytech/kubernetes-ingress/pkg/controller/constants"
2223
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy/api"
2324
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy/instance"
2425
"github.com/haproxytech/kubernetes-ingress/pkg/k8s"
@@ -206,6 +207,7 @@ func (gm GatewayManagerImpl) manageTCPRoutes() {
206207
gm.haproxyClient.BackendCreateIfNotExist(
207208
models.Backend{
208209
BackendBase: models.BackendBase{
210+
From: constants.DefaultsSectionName,
209211
Name: getBackendName(*tcproute),
210212
Mode: "tcp",
211213
DefaultServer: &models.DefaultServer{ServerParams: models.ServerParams{Check: "enabled"}},

pkg/handler/https.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/haproxytech/client-native/v6/models"
2323

2424
"github.com/haproxytech/kubernetes-ingress/pkg/annotations"
25+
"github.com/haproxytech/kubernetes-ingress/pkg/controller/constants"
2526
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy"
2627
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy/certs"
2728
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy/instance"
@@ -246,6 +247,7 @@ func (handler *HTTPS) enableSSLPassthrough(h haproxy.HAProxy) (err error) {
246247
// ssl-passthrough frontend to ssl-offload backend)
247248
h.BackendCreatePermanently(models.Backend{
248249
BackendBase: models.BackendBase{
250+
From: constants.DefaultsSectionName,
249251
Name: h.BackSSL,
250252
Mode: "tcp",
251253
},

pkg/haproxy/rules/reqTrack.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/haproxytech/client-native/v6/models"
88

9+
"github.com/haproxytech/kubernetes-ingress/pkg/controller/constants"
910
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy/api"
1011
"github.com/haproxytech/kubernetes-ingress/pkg/utils"
1112
)
@@ -30,6 +31,7 @@ func (r ReqTrack) Create(client api.HAProxyClient, frontend *models.Frontend, in
3031
if !client.BackendUsed(r.TableName) {
3132
backend := models.Backend{
3233
BackendBase: models.BackendBase{
34+
From: constants.DefaultsSectionName,
3335
Name: r.TableName,
3436
StickTable: &models.ConfigStickTable{
3537
Peers: "localinstance",

pkg/service/service.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323

2424
v3 "github.com/haproxytech/kubernetes-ingress/crs/api/ingress/v3"
2525
"github.com/haproxytech/kubernetes-ingress/pkg/annotations"
26+
"github.com/haproxytech/kubernetes-ingress/pkg/controller/constants"
2627
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy"
2728
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy/api"
2829
"github.com/haproxytech/kubernetes-ingress/pkg/haproxy/certs"
@@ -203,6 +204,7 @@ func (s *Service) getBackendModel(store store.K8s, a annotations.Annotations, cl
203204
backend = &v3.BackendSpec{
204205
Backend: models.Backend{
205206
BackendBase: models.BackendBase{
207+
From: constants.DefaultsSectionName,
206208
Mode: mode,
207209
},
208210
},

0 commit comments

Comments
 (0)