cluster-api
cluster-api copied to clipboard
Introduce a `NeedsRollout` filter in `util/collections` package
Detailed Description
The MachinesNeedingRollout and the UpToDateMachines functions in controlplane/kubeadm/internal/ use a combination of filters to determine if a machine needs rollout (or the negation = is stable).
Let's introduce a new filter named NeedsRollout that will be used as the single filter in these two functions. This way we can keep the list of filters that make up a rollout in a single place.
/kind cleanup /good-first-issue
/hold until https://github.com/kubernetes-sigs/cluster-api/pull/6983 is merged as it introduces a new filter to the list.
@ykakarap: This request has been marked as suitable for new contributors.
Guidelines
Please ensure that the issue body includes answers to the following questions:
- Why are we solving this issue?
- To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
- Does this issue have zero to low barrier of entry?
- How can the assignee reach out to you for help?
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.
In response to this:
Detailed Description
The
MachinesNeedingRolloutand theUpToDateMachinesfunctions incontrolplane/kubeadm/internal/use a combination of filters to determine if a machine needs rollout (or the negation = is stable).Let's introduce a new filter named
NeedsRolloutthat will be used as the single filter in these two functions. This way we can keep the list of filters that make up a rollout in a single place./kind cleanup /good-first-issue
/hold until https://github.com/kubernetes-sigs/cluster-api/pull/6983 is merged as it introduces a new filter to the list.
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/test-infra repository.
Hello, I would like to work on this issue /assign
/triage accepted
@dharmicksai are you still working on this?
Hey , I am working on the task
@ykakarap , I dont think it is possible to create NeedsRollout filter in utils/collection .
NeedsRollout filter requires MatchesMachineSpec filter , this filter is present in controlplane/kubeadm/internal and this package imports utils/collections. Inorder to implement NeedsRollout in utils/collection we would be required to import controlplane/kubeadm/internal but this will cause compiler error ( becoz of cyclic imports ).
Alternate solution to this would be to create the NeedsRollout filter in controlplane/kubeadm/internal
Alternate solution to this would be to create the
NeedsRolloutfilter incontrolplane/kubeadm/internal
Sounds good. Go ahead with this. The controlplane/kubeadm/internal/filters.go is probably the best place for this since it already holds definitions for other filters.