Fix overwriting initial hostname #23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-overriding-initial-hostname"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
Steps to Reproduce:
localhoste.g.45homelabhostnameExpected Result: The hostname should be unchanged (e.g.
45homelab)Actual Result: The hostname reverts to
localhostWhen using ServerManager to install ApiServer, I discovered that patching the config causes ServerManager to set the hostname to
''which results in it reverting to the Linux default oflocalhost, which then broke all of the VM tests! 😅Instead, when the application first starts up, it should set its config state to match the system's hostname.
Solution
I updated the hostname resource to only change the hostname value if it's being set to a truthy value. This should prevent it from setting the hostname to
''I then also got the hostname resource to update the config service at startup. So it won't try to set the host name to
''in the first place.I also had to get the hostname resource to update the config service every time it changed the hostname. Something feels wrong about the architecture here 🤔