Merge pull request #1349 from posch/wwclient-port

Add option for wwclient port number
This commit is contained in:
Christian Goll
2024-08-02 14:45:23 +02:00
committed by GitHub
4 changed files with 11 additions and 1 deletions

View File

@@ -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

View File

@@ -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")

View File

@@ -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
}

View File

@@ -0,0 +1,5 @@
package config
type WWClientConf struct {
Port uint16 `yaml:"port" default:"0"`
}