tink icon indicating copy to clipboard operation
tink copied to clipboard

tink-cli and boots model confusion about the source of the hostname property

Open rgl opened this issue 4 years ago • 2 comments

Expected Behaviour

Expected that tink hardware get would get the hostname value from the same place as Boots.

Current Behaviour

While trying to understand why Boots was not returning the hostname to the worker I've probably found some model confusion about where the hostname should be configured from.

At some point, this was the working hardware definition with the hostname set at .network.interfaces.dhcp.hostnam (I've trimmed it a bit to make it fit this issue; see the full version if required):

{
  "metadata": {
    "instance": {}
  },
  "network": {
    "interfaces": [
      {
        "dhcp": {
          "hostname": "$worker_name"
        },
      }
    ]
  }
}

But with recent Boots, we must set the hostname at .metadata.instance.hostname:

{
  "metadata": {
    "instance": {
      "hostname": "$worker_name"
    },
  },
  "network": {
    "interfaces": [
      {
        "dhcp": {
        },
      }
    ]
  }
}

But doing so has a collateral effect of making tink hardware get return an empty hostname, e.g.:

$ docker exec -i compose-tink-cli-1 tink hardware get
+--------------------------------------+-------------------+------------+----------+
| ID                                   | MAC ADDRESS       | IP ADDRESS | HOSTNAME |
+--------------------------------------+-------------------+------------+----------+
| 00000000-0000-4000-8000-080027000001 | 08:00:27:00:00:01 | 10.3.0.11  |          |
+--------------------------------------+-------------------+------------+----------+

Which was unexpected, hence this bug report.

Possible Solution

Either fix Boots or tink-cli.

Steps to Reproduce (for bugs)

  1. create an hardware like described before and observe the Boots vs tink-cli behaviour.

Your Environment

  • Operating System and version (e.g. Linux, Windows, MacOS): Ubuntu 20.04

  • How are you running Tinkerbell? Vagrant & Libvirt.

  • Link to your project or a code example to reproduce issue: https://github.com/rgl/rpi-tinkerbell-vagrant

rgl avatar Oct 10 '21 09:10 rgl

@mmlb is this one of those instances where metadata is load-bearing in spite of having not official schema?

nshalman avatar Nov 16 '21 16:11 nshalman

@nshalman yes :(.

mmlb avatar Feb 08 '22 16:02 mmlb

https://github.com/tinkerbell/tink/pull/654 might close this. I will check Boots with the Kubernetes backend to see if this is still an issue.

jacobweinstock avatar Dec 23 '22 01:12 jacobweinstock

Given Tink CLI has been superseded and removed this is no longer an issue.

chrisdoherty4 avatar Dec 27 '22 03:12 chrisdoherty4