Summary
The wizard's validateUser() method validates usernames and SSH keys but does not validate the hostname, even though the hostname is entered on the same User step. The validate.Hostname() function exists but is never called anywhere in the wizard validation flow.
Steps to Reproduce
- Advance through the wizard to the User step
- Leave the Hostname field empty (or enter an invalid value like "---" or a 100-char string)
- Fill in a valid username and SSH key
- Press Enter — validation passes
- Continue to Review and Install
- The generated Butane YAML contains
inline: "" or an invalid hostname
Expected
wizard.validateUser() (or a dedicated validateHostname() call) should call validate.Hostname(cfg.Hostname) and reject empty/invalid hostnames before advancing past the User step.
Actual
validateUser() only checks Users and SSHKeys:
func (w *Wizard) validateUser() error {
if len(w.State.Config.Users) == 0 && len(w.State.Config.SSHKeys) == 0 {
return fmt.Errorf("at least one user or SSH key is required")
}
// ... validates usernames and SSH keys, but NOT hostname
}
The hostname flows directly into the Butane template unvalidated:
contents:
inline: "{{.Hostname}}"
An empty hostname produces inline: "" which results in a machine with no hostname set, making fleet management and DNS difficult.
Severity
High — Silent misconfiguration. An empty hostname is a common oversight and should be caught before writing to disk.
Summary
The wizard's
validateUser()method validates usernames and SSH keys but does not validate the hostname, even though the hostname is entered on the same User step. Thevalidate.Hostname()function exists but is never called anywhere in the wizard validation flow.Steps to Reproduce
inline: ""or an invalid hostnameExpected
wizard.validateUser()(or a dedicatedvalidateHostname()call) should callvalidate.Hostname(cfg.Hostname)and reject empty/invalid hostnames before advancing past the User step.Actual
validateUser()only checksUsersandSSHKeys:The hostname flows directly into the Butane template unvalidated:
An empty hostname produces
inline: ""which results in a machine with no hostname set, making fleet management and DNS difficult.Severity
High — Silent misconfiguration. An empty hostname is a common oversight and should be caught before writing to disk.