Restore old behavior of not setting empty hostnames #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Restore old behavior of not setting empty hostnames
The refactoring in #21
caused hostnames to be set unconditionally compared to the old behavior
of only setting the hostname if it not empty.
When running coreos-cloudinit with datasources that do not provide
metadata such as the
file
datasource, the refactored code caused thehostname to always be reset to
localhost
. This leads to variousproblems like preventing k8s nodes from joining their cluster.
This change restores the old behavior by not applying empty hostnames.
Fixes flatcar/Flatcar#1262
How to use
create a file
config
with content:Then run
./coreos-cloudinit --from-file=config
Testing done
Run the above command. Output without PR:
with PR
changelog/
directory (user-facing change, bug fix, security fix, update)/boot
and/usr
size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.