Skip to content
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

Support optional machine alias besides the machine ID #8

Merged
merged 1 commit into from Dec 3, 2020

Conversation

pothos
Copy link
Member

@pothos pothos commented Nov 30, 2020

The machine ID is the unique identifier of a client but it does not
carry much information about the machine and is hard to remember or
compare for humans. Nebraska supports an optional machinealias Omaha
field to display besides the machine ID.
Allow to set a MACHINE_ALIAS variable in the update.conf file to
specify the machine_alias field and fall back to the empty string
otherwise which will be ignored by Nebraska. As with the other
variables in /etc/flatcar/update.conf the MACHINE_ALIAS variable can be
changed while update-engine runs and it will pick up the change, which
is useful for scripts that set the machine alias like this:

  sudo sed -i "/MACHINE_ALIAS=.*/d" /etc/flatcar/update.conf
  echo "MACHINE_ALIAS=$(hostname)" | sudo tee -a /etc/flatcar/update.conf

How to use

Build an image and set the new variable and observe the effect in Nebraska.

Testing done

Built an image and first steered the machine to a local Nebraska (set SERVER=http://…, FLATCAR_RELEASE_VERSION=3333.0.0, and GROUP=stable) and triggered an update to see that it registers (but doesn't update because there is no newer version), then added the machine alias variable and triggered an update again, seeing the alias set in Nebraska.

@pothos pothos requested a review from a team November 30, 2020 19:46
@pothos pothos marked this pull request as ready for review November 30, 2020 19:49
Copy link

@margamanterola margamanterola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One nitpick about one of the comments.

Also, there's 2 typos in the commit description: the first line says "unique identifier or a client" and it should be "of a client". Then it says "Nebraska support" and it should be "Nebraska supports".

src/update_engine/omaha_request_params.h Outdated Show resolved Hide resolved
The machine ID is the unique identifier of a client but it does not
carry much information about the machine and is hard to remember or
compare for humans. Nebraska supports an optional machinealias Omaha
field to display besides the machine ID.
Allow to set a MACHINE_ALIAS variable in the update.conf file to
specify the machine_alias field and fall back to the empty string
otherwise which will be ignored by Nebraska. As with the other
variables in /etc/flatcar/update.conf the MACHINE_ALIAS variable can be
changed while update-engine runs and it will pick up the change, which
is useful for scripts that set the machine alias like this:
  sudo sed -i "/MACHINE_ALIAS=.*/d" /etc/flatcar/update.conf
  echo "MACHINE_ALIAS=$(hostname)" | sudo tee -a /etc/flatcar/update.conf
@pothos pothos merged commit 312ab26 into flatcar-master Dec 3, 2020
@pothos pothos deleted the kai/machine-alias branch December 3, 2020 13:25
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Dec 3, 2020
This pulls in
flatcar/update_engine#8
to support sending a machine alias to the update server.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Dec 8, 2020
This pulls in
flatcar/update_engine#8
to support sending a machine alias to the update server.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Dec 8, 2020
This pulls in
flatcar/update_engine#8
to support sending a machine alias to the update server.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Dec 15, 2020
This pulls in
flatcar/update_engine#8
to support sending a machine alias to the update server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants