Skip to content

Conversation

@RiRa12621
Copy link
Owner

truncate too long hostnames

Long hostnames can have unexpected consequences and this makes the truncation behavior explicit

This also cleans up existing truncating in AWS

How to use

A new node that uses cloud init and has an overly long host name.

Technically the second case should never happen, because most cloud providers are attempting to block direct instance names longer than 63 chars, but rather safe than sorry.

Testing done

Test added for

  • truncate on first .
  • truncate at 63 chars if segment before first . is still too long
  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

This is an alternative to flatcar#30

In this suggestion, all truncation happens centrally instead of for each metadata service. This reduces code duplication.

Too long hostname are not allowed and potentially breaking things. Instead of individually checking the hostname in each metadata provider, we adjust the hostname length when it's used to be set
@RiRa12621 RiRa12621 force-pushed the rira12621-hostname-truncate branch from 84e115b to 33c483b Compare April 3, 2025 11:01
@RiRa12621 RiRa12621 merged commit edad484 into flatcar-master Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants