Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG/MINOR: prevents port conflicts on startup when using hostNetwork #573

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/*cfg') }}
restore-keys: |
${{ runner.os }}-go-
- name: tidy
Expand All @@ -66,7 +66,7 @@ jobs:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/*cfg') }}
restore-keys: |
${{ runner.os }}-go-
- name: tidy
Expand All @@ -89,7 +89,7 @@ jobs:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/*cfg') }}
restore-keys: |
${{ runner.os }}-go-
- name: Lint
Expand All @@ -111,7 +111,7 @@ jobs:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/*cfg') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
Expand All @@ -138,7 +138,7 @@ jobs:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/*cfg') }}
restore-keys: |
${{ runner.os }}-go-
- uses: engineerd/[email protected]
Expand Down
5 changes: 0 additions & 5 deletions deploy/tests/tnr/routeacl/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func (suite *UseBackendSuite) BeforeTest(suiteName, testName string) {
suite.T().Logf("temporary configuration dir %s", suite.test.TempDir)
}

//nolint:dupword
var haproxyConfig = `global
daemon
master-worker
Expand All @@ -75,25 +74,21 @@ peers localinstance

frontend https
mode http
bind 127.0.0.1:8080 name v4
http-request set-var(txn.base) base
use_backend %[var(txn.path_match),field(1,.)]

frontend http
mode http
bind 127.0.0.1:4443 name v4
http-request set-var(txn.base) base
use_backend %[var(txn.path_match),field(1,.)]

frontend healthz
bind 127.0.0.1:1042 name v4
mode http
monitor-uri /healthz
option dontlog-normal

frontend stats
mode http
bind *:1024 name stats
stats enable
stats uri /
stats refresh 10s
Expand Down
4 changes: 0 additions & 4 deletions fs/usr/local/etc/haproxy/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,21 @@ peers localinstance

frontend https
mode http
bind 127.0.0.1:8080 name v4
http-request set-var(txn.base) base
use_backend %[var(txn.path_match),field(1,.)]

frontend http
mode http
bind 127.0.0.1:4443 name v4
http-request set-var(txn.base) base
use_backend %[var(txn.path_match),field(1,.)]

frontend healthz
bind 127.0.0.1:1042 name v4
mode http
monitor-uri /healthz
option dontlog-normal

frontend stats
mode http
bind *:1024 name stats
http-request set-var(txn.base) base
http-request use-service prometheus-exporter if { path /metrics }
stats enable
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (c *HAProxyController) updateHAProxy() {
func (c *HAProxyController) setToReady() {
healthzPort := c.osArgs.HealthzBindPort
logger.Panic(c.clientAPIClosure(func() error {
return c.haproxy.FrontendBindEdit("healthz",
return c.haproxy.FrontendBindCreate("healthz",
models.Bind{
BindParams: models.BindParams{
Name: "v4",
Expand Down Expand Up @@ -228,7 +228,7 @@ func (c *HAProxyController) setToReady() {
}))

logger.Panic(c.clientAPIClosure(func() error {
return c.haproxy.FrontendBindEdit("stats",
return c.haproxy.FrontendBindCreate("stats",
models.Bind{
BindParams: models.BindParams{
Name: "stats",
Expand Down