-
Notifications
You must be signed in to change notification settings - Fork 34
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
Hostname in installer #1000
Hostname in installer #1000
Conversation
# It parses both ipv4 and ipv6 lease files at once. | ||
# | ||
# @param iface [String] queried interface | ||
# @param query [String] xpath query |
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.
maybe mention that it is just subset of xpath ( as specified in man wicked section xpath )
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.
ok, I'll point to the wicked doc.
if (Yast::Mode.installation || Yast::Mode.autoinst) && | ||
Yast::FileUtils.Exists("/etc/install.inf") | ||
fqdn = hostname_from_install_inf | ||
if Yast::Mode.installation || Yast::Mode.autoinst |
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.
will it work during update?
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.
no, but network is not modified during update at all. I mean ... hostname will not be updated in the updated system, but it will be displayed correctly e.g. in bash prompt (bcs it is preset by linuxrc)
# | ||
# @return [String] Hostname | ||
def hostname_for_installer | ||
@install_inf_hostname = hostname_from_install_inf |
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.
why only this part is cached and others not?
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.
see bellow comment about separating hostname class, this is another reason. In fact Hostname and DNS has nothing in common. It stayed together just because it was together in the old code.
@@ -31,9 +33,11 @@ class DNSReader | |||
# | |||
# @return [Y2Network::DnsConfig] DNS configuration | |||
def config | |||
installer = Yast::Mode.installation || Yast::Mode.autoinst |
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.
what about autoinst mode in second stage?
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.
network configuration runs completely in first stage. So in my POV when something invokes it in second stage then it should behave as on installed system.
# | ||
# @return [Boolean] | ||
def hostname_from_install_inf? | ||
!@hostname_reader.install_inf_hostname.nil? |
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.
this is really nasty side effect that really depends on fact that hostname entry is constructed before save_hostname entry. What I really prefer is method hostname_reader
that returns cached object and those two methods just call it.
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.
I've follow up of this PR. I separate Hostname and DNS classes there exactly for this (and one above) reason. So, would you prefer to merge those two patches together?
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.
I am fine with merging it together, so I can see final result.
I would like to see more documentation and description in general. Behavior, testing corner cases and so on. The PR description only mentions a fate entry, which was for SLE-12-SP2, a link to the trello card would be nice to have or at least to the bug that reported it for SLE-15-SP2. The fate is from 2016, there were some changes related to DHCLIENT_SET_HOSTNAME after it: See https://github.com/yast/yast-network/pull/564/files So, documenting different scenarios and the workflow with the different options knowing exactly how the static or transient hostname it is set in each case would be very nice to have. Even linuxrc has it: https://github.com/openSUSE/linuxrc/blob/master/linuxrc_hostname.md |
@mchf I was asked about reviewing the PR but it still contains conflicts and the description basically says nothing. What the problem is, what it fixes, what is still missing..., of course there is an old fate number referenced but linking to it would be better for others to check it quickly and also as reference for the future as well as the trello card URL and any other useful link. As we were discussing, we do not enforce a particular PR template but the one provided by @lslezak is a good one for using at least as an example. I would like to also see some documentation about use cases, and different scenarios as it is not the first time we face a problem and different expectations affecting the hostname setup, but of course taking in account that is not part of the acceptance criteria probably we could omit it. I already mentioned that in previous comment, but have not seen an answer or movement from there in advance, so not sure what more I could door what is expected from my side at all :( |
@teclator @mchf I fully understand that this PR's description says almost nothing (and this concern has not been addressed since more than two weeks now). Please, adjust the PR and get it merged ASAP. Currently, yast2-network fails to build in Staging (one test case failing) and effectively blocks merging any further changes of YaST. Thanks! |
It somehow worked before, but due to changes caused by re-implementation in network-ng it got somehow broken.
b5f9a6b
to
ed6b6fa
Compare
At the end of the installation, if not hostname was set and no DHCP hostname what will be set? linux-(random), install or nothing?
Well, it was already the case since: #564 but probably lost in network-ng.
In the past there was even a separate dialog for setting the hostname but then it was removed and mixed with dns. Agree about moving the responsibility elsewhere. |
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.
So, LGTM as it is as we also have plans to do some more improvements in short, so lets move forward and fix some of the current issues.
package/yast2-network.changes
Outdated
------------------------------------------------------------------- | ||
Thu Nov 21 07:13:28 UTC 2019 - Michal Filka <mfilka@suse.com> | ||
|
||
- fate#319639 |
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.
I would prefer to use the bug number instead of the fate, so, if you wanted to mention it then add both.
not specified in the feature - so a default. As the feature says that hostname should be updated only if set via the hostname option.
Yes, partly ... however stopped to work after transition to the network-ng
sure, by the old code I mean state before switching to network-ng. |
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 for the time being
✔️ Public Jenkins job #99 successfully finished |
✔️ Internal Jenkins job #29 successfully finished |
Fate319639
Hotfix for network-ng to set hostname according to the fate above in the installer. It was only partly implemented in the code before network-ng. It basically means that:
The hostname is set in order described above. Also, the hostname is written to the target only in third case (when set using hostname option).
Yast2-network cooperates with linuxrc here bcs linuxrc is e.g. the one who sets the default hostname and so on.
What should be done next: