Skip to content

Refactor Machine Type detection logic out of the reconcile function. #172

@VanillaSpoon

Description

@VanillaSpoon

WHY

The current implementation of Instascale includes logic within the Reconcile function to check and set the machine type and verify if Hypershift is enabled. This logic is placed in the reconciliation loop because the client is not able to perform calls to the Kubernetes API until after the controller's SetupWithManager method has completed. As a result, fetching the ocmClusterId and checking if Hypershift is enabled cannot be done during setup.

The machineCheck is a crucial part of the controller setup, as it dictates the behaviour of the reconciliation process by determining whether we are working with a MachinePool, or NodePool. Performing this operation in the reconcile function is not optimal.

DONE

The machine type and Hypershift checks should be refactored out of the Reconcile loop to improve the controller's efficiency and code maintainability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions