Skip to content
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

Support clusterctl move ExperimentalResourceMutators in CLI mode #11694

Open
dmvolod opened this issue Jan 17, 2025 · 3 comments
Open

Support clusterctl move ExperimentalResourceMutators in CLI mode #11694

dmvolod opened this issue Jan 17, 2025 · 3 comments
Assignees
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

dmvolod commented Jan 17, 2025

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

As developer I'm successfully using ExperimentalResourceMutators functionality in clusterctl API MoveOptions and wrote a large number of custom mutators in our project. We are using for specific fields values fill during move, status transformation (storing), as well as for move procedure markers required for the our infrastructure providers.

Now, as operator I would like to have the same functionality for the clusterctl CLI out-of-the-box. Now, we need to write custom CLI for this feature to extend clusterctl move resource mutators functions.

Detailed Description

Providing solution looks like:

  • Utilizeing plugin approach in common sense. Use the same functions for discovery, lookup and execute as for clusterctl plugins
  • Adding --resource-mutator-plugin (single or multiple values. need to discuss with community) flag for the move command in clusterctl
  • Implementingcluster.ResourceMutatorFunc which will serialize unstructured.Unstructured to yaml, call plugin send serialized data into stdin, read stdout, deserialize and return it back.
  • Modifying e2e test and rewriting Move -> MoveClusterWithBinary (or creating a new one) function in sigs.k8s.io/cluster-api/test/framework/clusterctl package to call it like CLI instead of API.
  • Implementing simple plugin or using jq/yq with shell wrappers for test.

Anything else you would like to add?

/assign

Label(s) to be applied

/kind feature

@k8s-ci-robot k8s-ci-robot added 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. labels Jan 17, 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.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 17, 2025
@dmvolod
Copy link
Author

dmvolod commented Jan 17, 2025

/area clusterctl

@k8s-ci-robot k8s-ci-robot added the area/clusterctl Issues or PRs related to clusterctl label Jan 17, 2025
@fabriziopandini
Copy link
Member

fabriziopandini commented Jan 22, 2025

I'm personally -1 to add yet another kind of plugins to clusterctl and to add more complexity on mutators.

Have you considered to use the existing plugin mechanism implementing your own move command (that can build on top of clusterctl as a library)?

The CLI is intended to be simple, and move specifically is designed only for bootstrap/pivot, as well as mutators have been designed for simple use cases like changing namespaces, and it was intentionally limited to the library.

With this regard, frankly speaking, I think that the amount of transformation described above is stretching the cuurent scope of clusterctl move, and implementing your own move commend sets a better boundary between what the community support and what not, as well as give you the chance to go down your own path if and when your customisation will cross the boundaries above.

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