Skip to content

Always set HetznerBareMetalHost.Spec.Status.HardwareDetails #1789

@guettli

Description

@guettli

/kind feature

Describe the solution you'd like

After the IP of a bm machine was change, I want reprovisioning to work. I don't want to modify the hbmh by hand/script.

Currently, the hardwareDetails of hbmh are only set, when they do not exist yet:

in ActionRegisteringing():

...
	if s.scope.HetznerBareMetalHost.Spec.Status.HardwareDetails == nil {
		hardwareDetails, err := getHardwareDetails(sshClient)
		if err != nil {
			return actionError{err: fmt.Errorf("failed to get hardware details: %w", err)}
		}
		s.scope.HetznerBareMetalHost.Spec.Status.HardwareDetails = &hardwareDetails
	}
...

I suggest that we always do that (always overwrite the struct).

Use-case of a customer: They ordered a better NIC and thus the machine got a new IP.

Now the customer needs to update or recreate the hbmh. That is not convenient.

Currently I see no reason to not always update hardwareDetails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions