-
Notifications
You must be signed in to change notification settings - Fork 402
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
kubevirt: Set transient hostname from metadata #4005
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: afterburn-transient-hostname.service | ||
enabled: true | ||
contents: | | ||
[Unit] | ||
Description=Set Transient Hostname from KubeVirt meta_data | ||
|
||
# Run afterburn service for collect info from metadata server | ||
# see: https://coreos.github.io/afterburn/usage/attributes/ | ||
Wants=afterburn.service | ||
After=afterburn.service | ||
|
||
# Before hostname is received from DHCP | ||
Before=network-pre.target | ||
Wants=network-pre.target | ||
|
||
# Run before kubelet | ||
Before=kubelet.service | ||
|
||
[Service] | ||
# Mark afterburn environment file optional, due to it is possible that afterburn service was not executed | ||
EnvironmentFile=/run/metadata/afterburn | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment says to mark as optional, but this is missing the optional marker. Also if it's truly missing, then we'd be setting the transient hostname to the empty string, which is not what we want. Likely instead we should add |
||
ExecStart=hostnamectl hostname --transient "${AFTERBURN_KUBEVIRT_HOSTNAME}" | ||
Type=oneshot | ||
|
||
[Install] | ||
WantedBy=network-online.target |
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.
Shouldn't this have
?
We don't want to set a hostname if one has already been set (e.g. via Ignition).
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.
Well not sure, it depends on what the we want do at the end, maybe we want to convert the static into transient hostname.