-
Notifications
You must be signed in to change notification settings - Fork 77
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
use adminport instead of host
network
#1176
base: main
Are you sure you want to change the base?
Changes from 3 commits
e1830b4
cb1142d
f7fd152
136afe8
4849bc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import ( | |
"os/exec" | ||
"os/user" | ||
"regexp" | ||
"runtime" | ||
"strconv" | ||
"strings" | ||
"text/template" | ||
|
@@ -596,7 +597,7 @@ func (cli *VanClient) setupGatewayConfig(ctx context.Context, gatewayName string | |
} | ||
gatewayConfig.Listeners["amqp"] = qdr.Listener{ | ||
Name: "amqp", | ||
Host: "localhost", | ||
Host: "0.0.0.0", | ||
Port: int32(amqpPort), | ||
} | ||
|
||
|
@@ -735,6 +736,16 @@ func (cli *VanClient) gatewayStartContainer(ctx context.Context, gatewayName str | |
} | ||
|
||
siteId, _ := getGatewaySiteId(gatewayDir) | ||
adminUrl, _ := getRouterUrl(gatewayDir) | ||
adminPort := strings.Split(adminUrl, ":") | ||
|
||
networkingFlag := "--network" | ||
networkingValue := "host" | ||
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" { | ||
networkingFlag = "-p" | ||
networkingValue = adminPort[len(adminPort)-1] + ":" + adminPort[len(adminPort)-1] | ||
} | ||
|
||
containerCmd := gatewayType | ||
containerCmdArgs := []string{ | ||
"run", | ||
|
@@ -743,8 +754,8 @@ func (cli *VanClient) gatewayStartContainer(ctx context.Context, gatewayName str | |
"-d", | ||
"--name", | ||
gatewayName, | ||
"--network", | ||
"host", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this would break There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is already broken in non-Linux systems. IIRC, the recommended way to proceed for Linux systems is using podman sites instead. If it is not the case, then we can add a flag to detect the OS running and keep There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding an OS specific customization in this case, makes more sense to me as well. Eventually, if the @ajssmith thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fgiorgetti Added a check to get the host OS and only do port mapping for |
||
networkingFlag, | ||
networkingValue, | ||
"-e", | ||
"SKUPPER_SITE_ID=gateway" + "_" + gatewayName + "_" + siteId, | ||
"-e", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajssmith this is exposing the AMQP port to 0.0.0.0 instead.
Do you see any issue with it?