Restore old behavior of not setting empty hostnames#25
Merged
jepio merged 1 commit intoflatcar:flatcar-masterfrom Jan 15, 2024
Merged
Conversation
The refactoring in flatcar#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 the hostname to always be reset to `localhost`. This leads to various problems like preventing k8s nodes from joining their cluster. This change restores the old behavior by not applying empty hostnames. Fixes flatcar/Flatcar#1262
jepio
approved these changes
Jan 15, 2024
b4bd3c5 to
47d54a3
Compare
Member
|
ohh wow. Sorry for the headache! |
gabriel-samfira
approved these changes
Jan 15, 2024
Contributor
Author
|
The (previous) CI error (https://github.com/flatcar/coreos-cloudinit/actions/runs/7530122553/job/20496040224?pr=25) is odd, for me locally gofmt (Go 1.21.6) complained about the formatting, but now the CI is unhappy. I've dropped that commit. |
Contributor
Author
|
Thanks! |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
filedatasource, 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
configwith content:Then run
./coreos-cloudinit --from-file=configTesting done
Run the above command. Output without PR:
with PR
changelog/directory (user-facing change, bug fix, security fix, update)/bootand/usrsize, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.