Fix overwriting initial hostname #23

Merged
antman merged 12 commits from fix-overriding-initial-hostname into main 2026-09-04 05:23:57 +00:00
Owner

Motivation

Steps to Reproduce:

  • Configure a hostname other than localhost e.g. 45homelab
  • Install ServerManager
  • Patch the ServerManager config without changing hostname

Expected Result: The hostname should be unchanged (e.g. 45homelab)

Actual Result: The hostname reverts to localhost

When 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 of localhost, 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 🤔

### Motivation **Steps to Reproduce:** - Configure a hostname other than `localhost` e.g. `45homelab` - Install ServerManager - Patch the ServerManager config without changing `hostname` **Expected Result:** The hostname should be unchanged (e.g. `45homelab`) **Actual Result:** The hostname reverts to `localhost` When 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 of `localhost`, 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 🤔
fix overwriting initial hostname
All checks were successful
/ test-and-lint (push) Successful in 3m6s
eb7d8ed7fb
Add test case for hostname bug
Some checks failed
/ test-and-lint (push) Has been cancelled
b71ecffe2d
Add sudo
Some checks failed
/ test-and-lint (push) Has been cancelled
42f9f89448
hmm
Some checks failed
/ test-and-lint (push) Failing after 3m8s
02fb07bfc2
Add more logging
Some checks failed
/ test-and-lint (push) Failing after 3m12s
853ca88774
add logging
Some checks failed
/ test-and-lint (push) Has been cancelled
0a5ae5bf08
huh
Some checks failed
/ test-and-lint (push) Has been cancelled
29ba60685f
ffs
Some checks failed
/ test-and-lint (push) Failing after 3m3s
a290279875
fix bug
All checks were successful
/ test-and-lint (push) Successful in 3m0s
8a3e4ebd86
remove extra logging
All checks were successful
/ test-and-lint (push) Successful in 3m2s
e6aaad04b8
remove log
Some checks failed
/ test-and-lint (push) Has been cancelled
4ed176a76c
derp
All checks were successful
/ test-and-lint (push) Successful in 3m19s
35fe906697
antman scheduled this pull request to auto merge when all checks succeed 2026-09-04 05:21:08 +00:00
antman merged commit 10f7814de0 into main 2026-09-04 05:23:57 +00:00
antman deleted branch fix-overriding-initial-hostname 2026-09-04 05:23:57 +00:00
antman referenced this pull request from a commit 2026-09-04 05:23:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kill-the-cloud/server-manager!23
No description provided.