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

MachineDeployment should support spec.deletePolicy (like MS) #2585

Closed
rhockenbury opened this issue Mar 8, 2020 · 18 comments · Fixed by #3773
Closed

MachineDeployment should support spec.deletePolicy (like MS) #2585

rhockenbury opened this issue Mar 8, 2020 · 18 comments · Fixed by #3773
Assignees
Labels
area/api Issues or PRs related to the APIs help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@rhockenbury
Copy link

What steps did you take and what happened:

deletePolicy was implemented in #726 by adding a property to the machineSet to define the deletion policy (random, oldest, newest).

How is this intended to be leveraged since most users are only directly creating the machineDeployment api objects? I would have expected the machineDeployment to also expose a deletePolicy property.

Environment:

  • Cluster-api version:
  • Minikube/KIND version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 8, 2020
@detiber
Copy link
Member

detiber commented Mar 9, 2020

It looks like we'll likely need to expose this through the MachineRollingUpdateDeployment type for MachineDeployments

@vincepri
Copy link
Member

vincepri commented Mar 9, 2020

This seems like it can be made in a future release as a non-breaking change

/milestone v0.3.x

@k8s-ci-robot k8s-ci-robot added this to the v0.3.x milestone Mar 9, 2020
@erstaples
Copy link
Contributor

/assign

@vincepri
Copy link
Member

@erstaples are you still interested in working on this feature?

@erstaples
Copy link
Contributor

Hi @vincepri , I am indeed. Apologies for my self-assign-and-disappear act :) I can start work on it, at the latest, tomorrow.

@erstaples
Copy link
Contributor

@vincepri OK, having taken a look at it, it looks like its a matter of surfacing DeletePolicy on the MachineRollingUpdateDeployment type, setting a default in PopulateDefaultsMachineDeployment, and making sure to set DeletePolicy on the MachineSet in machinedeployment_sync.go.

What might the concerns be wrt backwards compatibility?

@vincepri
Copy link
Member

vincepri commented Apr 1, 2020

@erstaples If the MachineSet already has a default I don't think we need to set one in MachineDeployment, so it could effectively be empty (nil), maybe?

@erstaples
Copy link
Contributor

@vincepri I have this complete and ready for a PR, aside from one issue. I ran make generate, which deleted the autogenerated function Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1alpha2_MachineRollingUpdateDeployment.

After that, make test fails with the error

setting up [email protected] env vars
# sigs.k8s.io/cluster-api/api/v1alpha2
api/v1alpha2/zz_generated.conversion.go:162:10: undefined: Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1alpha2_MachineRollingUpdateDeployment
api/v1alpha2/zz_generated.conversion.go:700:13: undefined: Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1alpha2_MachineRollingUpdateDeployment
# sigs.k8s.io/cluster-api/api/v1alpha2 [sigs.k8s.io/cluster-api/api/v1alpha2.test]
api/v1alpha2/zz_generated.conversion.go:162:10: undefined: Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1alpha2_MachineRollingUpdateDeployment
api/v1alpha2/zz_generated.conversion.go:700:13: undefined: Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1alpha2_MachineRollingUpdateDeployment
FAIL	sigs.k8s.io/cluster-api/api/v1alpha2 [build failed]

Am I running the wrong version of a dependency used to generate the files, or...?

@vincepri
Copy link
Member

@erstaples sorry for the late reply, those errors usually means that the auto-conversion generation wasn't able to figure out how to convert from the old type to the new one, so it needs manual conversion

@vincepri
Copy link
Member

/help

@k8s-ci-robot
Copy link
Contributor

@vincepri:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

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 k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jun 10, 2020
@vincepri vincepri removed the kind/bug Categorizes issue or PR as related to a bug. label Jul 31, 2020
@vincepri
Copy link
Member

/area api
/milestone v0.4.0
/priority important-soon

@k8s-ci-robot k8s-ci-robot modified the milestones: v0.3.x, v0.4.0 Jul 31, 2020
@k8s-ci-robot k8s-ci-robot added area/api Issues or PRs related to the APIs priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Jul 31, 2020
@vincepri
Copy link
Member

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 31, 2020
@vincepri
Copy link
Member

/retitle MachineDeployment should support spec.deletePolicy (like MS)

@k8s-ci-robot k8s-ci-robot changed the title Usage of deletePolicy? MachineDeployment should support spec.deletePolicy (like MS) Jul 31, 2020
@shysank
Copy link
Contributor

shysank commented Oct 8, 2020

@vincepri is this still being worked on by someone? If not, can I take this one?

@vincepri
Copy link
Member

vincepri commented Oct 8, 2020

Sure yeah!

@shysank
Copy link
Contributor

shysank commented Oct 8, 2020

/assign

@fabriziopandini
Copy link
Member

/kind api-change

@k8s-ci-robot k8s-ci-robot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Issues or PRs related to the APIs help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants