tinkerbell / actions

Suite of Tinkerbell Actions for use in Tinkerbell Workflows
Apache License 2.0
28 stars 43 forks source link

rootio inconsistent with the current metadata format #75

Closed vilkaspilkas closed 2 years ago

vilkaspilkas commented 2 years ago

According to https://github.com/tinkerbell/hub/blob/main/actions/rootio/v1/pkg/types.go/metadata.go#L14:L27 it would expect the storage block to be at the root of the returned metadata, but hegel returns everything wrapped in metadata":{...}. As a result rootio doesn't format/mount partitions as specified in the hardware config.

Expected Behaviour

rootio should partition and format the disks if host metadata has a storage block.

Current Behaviour

I get either Succesfully parsed the MetaData, Found [0] Disks or segfault in rootio.go:49.

Possible Solution

PR will follow.

Steps to Reproduce (for bugs)

run rootio partition action (image: /rootio:v1.0.1, command: ["partition"] in the template) against the following metadata returned for the box:


{
  "id": "f9f56dff-098a-4c5f-a51c-19ad35de85d4",
  "metadata": {
    "facility": {
      "facility_code": "onprem"
    },
    "instance": {},
    "storage": {
      "disks": [
        {
          "device": "/dev/sda",
          "partitions": [
            {
              "label": "BIOS",
              "number": 1,
              "size": 4096
            },
            {
              "label": "ROOT",
              "number": 2,
              "size": 8936000
            }
          ],
          "wipe_table": true
        }
      ]
    }
  },
  "network": {
....
}
vilkaspilkas commented 2 years ago

Hello, @markyjackson-taulia tagging you as requested.