Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dmvolod opened this issue Apr 9, 2025 · 2 comments
Labels
area/clusterctl Issues or PRs related to clusterctl kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates an issue lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@dmvolod
Copy link
Member

dmvolod commented Apr 9, 2025

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

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. area/clusterctl Issues or PRs related to clusterctl needs-priority Indicates an issue lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 9, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If CAPI contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@chrischdi
Copy link
Member

Note: xref documentation about clusterctl move and order: https://cluster-api.sigs.k8s.io/developer/providers/contracts/clusterctl#move

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.

Could you please provide more details and examples for the issue so it is better for me to understand?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clusterctl Issues or PRs related to clusterctl kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates an issue lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

3 participants