Skip to content

Commit

Permalink
Update cli flag name and description:
Browse files Browse the repository at this point in the history
We were asking for an IP but showing a URL.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Oct 5, 2023
1 parent 3ade767 commit ade62d2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ FLAGS
-backend-kube-namespace [backend] an optional Kubernetes namespace override to query hardware data from, kube backend only
-dhcp-addr [dhcp] local IP and port to listen on for DHCP requests (default "0.0.0.0:67")
-dhcp-enabled [dhcp] enable DHCP server (default "true")
-dhcp-http-ipxe-binary-ip [dhcp] http ipxe binary server IP address to use in DHCP packets (default "http://172.17.0.2:8080/ipxe/")
-dhcp-http-ipxe-script-url [dhcp] http ipxe script server URL to use in DHCP packets (default "http://172.17.0.2/auto.ipxe")
-dhcp-http-ipxe-binary-url [dhcp] HTTP ipxe binaries URL to use in DHCP packets (default "http://172.17.0.2:8080/ipxe/")
-dhcp-http-ipxe-script-url [dhcp] HTTP ipxe script URL to use in DHCP packets (default "http://172.17.0.2/auto.ipxe")
-dhcp-ip-for-packet [dhcp] ip address to use in DHCP packets (opt 54, etc) (default "172.17.0.2")
-dhcp-syslog-ip [dhcp] syslog server IP address to use in DHCP packets (opt 7) (default "172.17.0.2")
-dhcp-tftp-ip [dhcp] tftp server IP address to use in DHCP packets (opt 66, etc) (default "172.17.0.2:69")
Expand Down
4 changes: 2 additions & 2 deletions cmd/smee/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ func dhcpFlags(c *config, fs *flag.FlagSet) {
fs.StringVar(&c.dhcp.ipForPacket, "dhcp-ip-for-packet", detectPublicIPv4(""), "[dhcp] IP address to use in DHCP packets (opt 54, etc)")
fs.StringVar(&c.dhcp.syslogIP, "dhcp-syslog-ip", detectPublicIPv4(""), "[dhcp] syslog server IP address to use in DHCP packets (opt 7)")
fs.StringVar(&c.dhcp.tftpIP, "dhcp-tftp-ip", detectPublicIPv4(":69"), "[dhcp] tftp server IP address to use in DHCP packets (opt 66, etc)")
fs.StringVar(&c.dhcp.httpIpxeBinaryIP, "dhcp-http-ipxe-binary-ip", "http://"+detectPublicIPv4(":8080/ipxe/"), "[dhcp] HTTP ipxe binary server IP address to use in DHCP packets")
fs.StringVar(&c.dhcp.httpIpxeScriptURL, "dhcp-http-ipxe-script-url", "http://"+detectPublicIPv4("/auto.ipxe"), "[dhcp] HTTP ipxe script server URL to use in DHCP packets")
fs.StringVar(&c.dhcp.httpIpxeBinaryURL, "dhcp-http-ipxe-binary-url", "http://"+detectPublicIPv4(":8080/ipxe/"), "[dhcp] HTTP ipxe binaries URL to use in DHCP packets")
fs.StringVar(&c.dhcp.httpIpxeScriptURL, "dhcp-http-ipxe-script-url", "http://"+detectPublicIPv4("/auto.ipxe"), "[dhcp] HTTP ipxe script URL to use in DHCP packets")
}

func backendFlags(c *config, fs *flag.FlagSet) {
Expand Down
8 changes: 4 additions & 4 deletions cmd/smee/flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestParser(t *testing.T) {
ipForPacket: "192.168.2.4",
syslogIP: "192.168.2.4",
tftpIP: "192.168.2.4:69",
httpIpxeBinaryIP: "http://192.168.2.4:8080/ipxe/",
httpIpxeBinaryURL: "http://192.168.2.4:8080/ipxe/",
httpIpxeScriptURL: "http://192.168.2.4/auto.ipxe",
},
logLevel: "info",
Expand All @@ -52,7 +52,7 @@ func TestParser(t *testing.T) {
"-dhcp-ip-for-packet", "192.168.2.4",
"-dhcp-syslog-ip", "192.168.2.4",
"-dhcp-tftp-ip", "192.168.2.4:69",
"-dhcp-http-ipxe-binary-ip", "http://192.168.2.4:8080/ipxe/",
"-dhcp-http-ipxe-binary-url", "http://192.168.2.4:8080/ipxe/",
"-dhcp-http-ipxe-script-url", "http://192.168.2.4/auto.ipxe",
}
cli := newCLI(&got, fs)
Expand Down Expand Up @@ -86,8 +86,8 @@ FLAGS
-backend-kube-namespace [backend] an optional Kubernetes namespace override to query hardware data from, kube backend only
-dhcp-addr [dhcp] local IP:Port to listen on for DHCP requests (default "0.0.0.0:67")
-dhcp-enabled [dhcp] enable DHCP server (default "true")
-dhcp-http-ipxe-binary-ip [dhcp] HTTP ipxe binary server IP address to use in DHCP packets (default "http://%[1]v:8080/ipxe/")
-dhcp-http-ipxe-script-url [dhcp] HTTP ipxe script server URL to use in DHCP packets (default "http://%[1]v/auto.ipxe")
-dhcp-http-ipxe-binary-url [dhcp] HTTP ipxe binaries URL to use in DHCP packets (default "http://%[1]v:8080/ipxe/")
-dhcp-http-ipxe-script-url [dhcp] HTTP ipxe script URL to use in DHCP packets (default "http://%[1]v/auto.ipxe")
-dhcp-ip-for-packet [dhcp] IP address to use in DHCP packets (opt 54, etc) (default "%[1]v")
-dhcp-syslog-ip [dhcp] syslog server IP address to use in DHCP packets (opt 7) (default "%[1]v")
-dhcp-tftp-ip [dhcp] tftp server IP address to use in DHCP packets (opt 66, etc) (default "%[1]v:69")
Expand Down
4 changes: 2 additions & 2 deletions cmd/smee/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type dhcpConfig struct {
ipForPacket string
syslogIP string
tftpIP string
httpIpxeBinaryIP string
httpIpxeBinaryURL string
httpIpxeScriptURL string
}

Expand Down Expand Up @@ -249,7 +249,7 @@ func (c *config) dhcpHandler(ctx context.Context, log logr.Logger) (*reservation
if err != nil {
return nil, fmt.Errorf("invalid tftp address for DHCP server: %w", err)
}
httpBinaryURL, err := url.Parse(c.dhcp.httpIpxeBinaryIP)
httpBinaryURL, err := url.Parse(c.dhcp.httpIpxeBinaryURL)
if err != nil || httpBinaryURL == nil {
return nil, fmt.Errorf("invalid http ipxe binary url: %w", err)
}
Expand Down

0 comments on commit ade62d2

Please sign in to comment.