-
Notifications
You must be signed in to change notification settings - Fork 21
[WIP] Try changing hostname on fly #84
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
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dtantsur The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
578f272 to
092f63d
Compare
pkg/ignition/service_config.go
Outdated
|
|
||
| func (b *ignitionBuilder) hostNameFixService() ignition_config_types_32.Unit { | ||
| script := fmt.Sprintf(` | ||
| if [ "$(hostnamectl hostname)" =~ ^localhost(\.localdomain)?$ ]]; then |
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.
Since you aren't removing the dispatcher script (which I think is a good thing), I don't think this will ever be true.
I think what this service wants to do is detect if we only have a --transient hostname set and convert it to a --static one.
If /etc/hostname gets copied by coreos-installer then that will work, at the cost of it being baked in such that even the later appearance of a DHCP hostname will not cause it to change (maybe that's a good thing?).
If we want this to happen as late in the process as possible, maybe IPA itself should do it just before calling coreos-installer?
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.
If /etc/hostname gets copied by coreos-installer
coreos/fedora-coreos-tracker#697 suggests that it doesn't, as recently as March.
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.
Okay, then we're back to the ignition approach, I'm afraid.
| if [ "$(hostnamectl hostname)" =~ ^localhost(\.localdomain)?$ ]]; then | ||
| echo Localhost detected, setting hostname to %[1]s; | ||
| hostnamectl set-hostname --static --transient "%[1]s"; | ||
| echo "%[1]s" > /etc/hostname; |
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 think hostnamectl set-hostname --static already has this effect.
| echo "$NEW" > /etc/hostname; | ||
| fi`, b.hostname) | ||
|
|
||
| script = strings.Replace(script, "\n", " ", -1) |
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.
oof
|
@dtantsur: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
Okay, confirmed: this does not work after the instance is deployed. But at least I now have a reproducer. |
No description provided.