cluster-api icon indicating copy to clipboard operation
cluster-api copied to clipboard

Introduce a `NeedsRollout` filter in `util/collections` package

Open ykakarap opened this issue 3 years ago • 7 comments

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 avatar Sep 14 '22 01:09 ykakarap

@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 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.

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.

k8s-ci-robot avatar Sep 14 '22 01:09 k8s-ci-robot

Hello, I would like to work on this issue /assign

dharmicksai avatar Sep 15 '22 02:09 dharmicksai

/triage accepted

fabriziopandini avatar Sep 15 '22 11:09 fabriziopandini

@dharmicksai are you still working on this?

aniruddha2000 avatar Sep 23 '22 15:09 aniruddha2000

Hey , I am working on the task

dharmicksai avatar Sep 23 '22 15:09 dharmicksai

@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 ).

dharmicksai avatar Oct 12 '22 13:10 dharmicksai

Alternate solution to this would be to create the NeedsRollout filter in controlplane/kubeadm/internal

dharmicksai avatar Oct 12 '22 13:10 dharmicksai

Alternate solution to this would be to create the NeedsRollout filter in controlplane/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.

ykakarap avatar Nov 02 '22 01:11 ykakarap