Skip to content

clusterctl: Make move sequence inside the single group ordered and predictable #12082

Open
@dmvolod

Description

@dmvolod

What would you like to be added (User Story)?

As a developer, I would like to have a predictable and ordered of moving objects during a move operation on one level (group). For example, a sequence that would perfectly suit most conditions:

  1. All Objects from the corev1 GV or Secrets and ConfigMaps only
  2. Cluster API Cluster and ClusterClass
  3. All other objects sorted by GVK and name (or not ordered). It does not matter in this case

Currently, moving objects in one group (level) is sporadic, so changes will not break the current behavior.

The reasons for such changes are that there may be native Cluster API extension objects that cannot be bound to the Cluster object or cannot enter into relationships with it using physical links, but the sequence of the move operation is important because of these objects can receive pause or any other information from the Cluster object being moved before.

Detailed Description

To implement this feature, the final move sequence can be changed at the end of this function

func getMoveSequence(graph *objectGraph) *moveSequence {

The move weight (order based on logic described above) function can be added to the node struct here

At the final of the getMoveSequence function we should iterate over the move groups and sort nodes inside each group based logic described above.

Anything else you would like to add?

I will take care about this issue if it will be accepted

Label(s) to be applied

/kind feature
/area clusterctl

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/clusterctlIssues or PRs related to clusterctlkind/featureCategorizes issue or PR as related to a new feature.needs-priorityIndicates an issue lacks a `priority/foo` label and requires one.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions