Skip to content

Commit

Permalink
Add flag for csm port
Browse files Browse the repository at this point in the history
Extending commit 05be059 by @clebio
  • Loading branch information
golightsctm committed Feb 7, 2024
1 parent ad7b6cb commit 373af95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion iamlivecore/csm.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func listenForEvents() {
var iamMap iamMapBase

addr := net.UDPAddr{
Port: 31000,
Port: *csmPortFlag,
IP: net.ParseIP(*hostFlag),
}
conn, err := net.ListenUDP("udp", &addr)
Expand Down
5 changes: 4 additions & 1 deletion iamlivecore/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var backgroundFlag *bool
var debugFlag *bool
var forceWildcardResourceFlag *bool
var cpuProfileFlag = flag.String("cpu-profile", "", "write a CPU profile to this file (for performance testing purposes)")
var csmPortFlag *int

func parseConfig() {
provider := "aws"
Expand All @@ -48,6 +49,7 @@ func parseConfig() {
background := false
debug := false
forceWildcardResource := false
csmPort := 31000

cfgfile, err := homedir.Expand("~/.iamlive/config")
if err == nil {
Expand Down Expand Up @@ -120,6 +122,7 @@ func parseConfig() {
backgroundFlag = flag.Bool("background", background, "when set, the process will return the current PID and run in the background without output")
debugFlag = flag.Bool("debug", debug, "dumps associated HTTP requests when set in proxy mode")
forceWildcardResourceFlag = flag.Bool("force-wildcard-resource", forceWildcardResource, "when set, the Resource will always be a wildcard")
csmPortFlag = flag.Int("csm-port", csmPort, "port to listen on for CSM")
}

func Run() {
Expand Down Expand Up @@ -161,7 +164,7 @@ func Run() {
if *providerFlag == "aws" {
setINIConfigAndFileFlush()
}

loadMaps()

if *modeFlag == "csm" && *providerFlag == "aws" {
Expand Down

0 comments on commit 373af95

Please sign in to comment.