-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hostname to system-data #593
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #593 +/- ##
==========================================
- Coverage 53.86% 53.75% -0.11%
==========================================
Files 39 40 +1
Lines 6037 6066 +29
==========================================
+ Hits 3252 3261 +9
- Misses 2500 2519 +19
- Partials 285 286 +1 ☔ View full report in Codecov by Sentry. |
cb87709
to
e36c5bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This should also be backported to |
e36c5bf
to
7eca722
Compare
Add new ${System Data/Runtime/Hostname} key to the registration data sent from the elemental-register command. Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
7eca722
to
8f220ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
If the (static) hostname is not set, we used to set a rancher-${RANDOM} one. This anyway prevents DHCP to serve a transient hostname. In Elemental, at registration time, the hostname is recorded as the MachineInventory name and from that point onwards it could not be changed. It will be enforced as the static hostname during the k3s/RKE2 provisioning. Since we do registration just after the ISO boot, in order to use the DHCP provided hostname, we should allow the transient name to be set by the dhcp client (which happens only if the static hostname is not set) and then take advantage of the new templating value: ${System Data/Runtime/Hostname} (see rancher/elemental-operator#593) Drawbacks: if no hostname is provided by the DHCP server or via IP reverse lookup, and if the MachineName has not been set in the MachineInventory, the Elemental host will have "localhost" hostname till k3s/RKE2 provisioning. Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
If the (static) hostname is not set, we used to set a rancher-${RANDOM} one. This anyway prevents DHCP to serve a transient hostname. In Elemental, at registration time, the hostname is recorded as the MachineInventory name and from that point onwards it could not be changed. It will be enforced as the static hostname during the k3s/RKE2 provisioning. Since we do registration just after the ISO boot, in order to use the DHCP provided hostname, we should allow the transient name to be set by the dhcp client (which happens only if the static hostname is not set) and then take advantage of the new templating value: ${System Data/Runtime/Hostname} (see rancher/elemental-operator#593) Drawbacks: if no hostname is provided by the DHCP server or via IP reverse lookup, and if the MachineName has not been set in the MachineInventory, the Elemental host will have "localhost" hostname till k3s/RKE2 provisioning. Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
If the (static) hostname is not set, we used to set a rancher-${RANDOM} one. This anyway prevents DHCP to serve a transient hostname. In Elemental, at registration time, the hostname is recorded as the MachineInventory name and from that point onwards it could not be changed. It will be enforced as the static hostname during the k3s/RKE2 provisioning. Since we do registration just after the ISO boot, in order to use the DHCP provided hostname, we should allow the transient name to be set by the dhcp client (which happens only if the static hostname is not set) and then take advantage of the new templating value: ${System Data/Runtime/Hostname} (see rancher/elemental-operator#593) Let's anyway set the racher-${RANDOM} hostname but as a transient one and before the network stage (so it may be replaced by the DHCP provided one). This is a change in behavior: on Elemental booting (before provisioning) if a hostname has not been set and DHCP provides one, the DHCP hostname takes precedence over the rancher-${RANDOM} one. Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
If the (static) hostname is not set, we used to set a rancher-${RANDOM} one. This anyway prevents DHCP to serve a transient hostname. In Elemental, at registration time, the hostname is recorded as the MachineInventory name and from that point onwards it could not be changed. It will be enforced as the static hostname during the k3s/RKE2 provisioning. Since we do registration just after the ISO boot, in order to use the DHCP provided hostname, we should allow the transient name to be set by the dhcp client (which happens only if the static hostname is not set) and then take advantage of the new templating value: ${System Data/Runtime/Hostname} (see rancher/elemental-operator#593) Let's anyway set the racher-${RANDOM} hostname but as a transient one and before the network stage (so it may be replaced by the DHCP provided one). This is a change in behavior: on Elemental booting (before provisioning) if a hostname has not been set and DHCP provides one, the DHCP hostname takes precedence over the rancher-${RANDOM} one. Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
If the (static) hostname is not set, we used to set a rancher-${RANDOM} one. This anyway prevents DHCP to serve a transient hostname. In Elemental, at registration time, the hostname is recorded as the MachineInventory name and from that point onwards it could not be changed. It will be enforced as the static hostname during the k3s/RKE2 provisioning. Since we do registration just after the ISO boot, in order to use the DHCP provided hostname, we should allow the transient name to be set by the dhcp client (which happens only if the static hostname is not set) and then take advantage of the new templating value: ${System Data/Runtime/Hostname} (see rancher/elemental-operator#593) Let's anyway set the racher-${RANDOM} hostname but as a transient one and before the network stage (so it may be replaced by the DHCP provided one). This is a change in behavior: on Elemental booting (before provisioning) if a hostname has not been set and DHCP provides one, the DHCP hostname takes precedence over the rancher-${RANDOM} one. Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
Add new
${System Data/Runtime/Hostname}
key to the registration data sent from the elemental-register command.Fixes #591