diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e00980f..3a6ca869 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add multiple output formats (yaml & json) support. #447 - More aliases for many wwctl commands - Add support to render template using `host` or `$(uname -n)` as the value of `overlay show --render`. #623 +- Added option for wwclient port number ### Changed diff --git a/internal/app/wwclient/root.go b/internal/app/wwclient/root.go index 3f9c08b3..110d23be 100644 --- a/internal/app/wwclient/root.go +++ b/internal/app/wwclient/root.go @@ -98,7 +98,10 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) { } localTCPAddr := net.TCPAddr{} - if conf.Warewulf.Secure { + if conf.WWClient != nil && conf.WWClient.Port > 0 { + localTCPAddr.Port = int(conf.WWClient.Port) + wwlog.Info("Running from configured port %d", conf.WWClient.Port) + } else if conf.Warewulf.Secure { // Setup local port to something privileged (<1024) localTCPAddr.Port = 987 wwlog.Info("Running from trusted port") diff --git a/internal/pkg/config/root.go b/internal/pkg/config/root.go index 89c6b944..50b2a134 100644 --- a/internal/pkg/config/root.go +++ b/internal/pkg/config/root.go @@ -41,6 +41,7 @@ type RootConf struct { SSH *SSHConf `yaml:"ssh,omitempty"` MountsContainer []*MountEntry `yaml:"container mounts" default:"[{\"source\": \"/etc/resolv.conf\", \"dest\": \"/etc/resolv.conf\"}]"` Paths *BuildConfig `yaml:"paths"` + WWClient *WWClientConf `yaml:"wwclient"` warewulfconf string } diff --git a/internal/pkg/config/wwclient.go b/internal/pkg/config/wwclient.go new file mode 100644 index 00000000..13993be6 --- /dev/null +++ b/internal/pkg/config/wwclient.go @@ -0,0 +1,5 @@ +package config + +type WWClientConf struct { + Port uint16 `yaml:"port" default:"0"` +}