Skip to content

Remove pods job

Marcos Huck requested to merge feature/remove_pods into feature/code_refactor

This MR adds a job for removing simulation pods.

List of tasks

  • Create a generic job to remove pods.
  • Create a subt-specific job to extend the generic job.
  • Add tests.

Context:

I'm working on the job in charge of removing pods, we only have a method to delete a single pod by name and namespace, meaning that we need to get the resources that identify each pod one by one and perform multiple calls to delete pods

O(2n) being n the amount of calls to the k8s api.

This scenario could be avoided by listing the elements that we want to delete, that's true, but we don't have a method for that just yet.

I'd like to avoid this scenario for two reasons: I don't see any value on having that many calls, and it doesn't make sense to me to implement the list method to end up with n calls to the Delete method.

I don't know if we've been doing this way on purpose or maybe there was no way to delete multiple pods at once when that part of the code was under development.

After a quick research, there's another trade-off to consider:

  • If you try to delete a single pod that doesn't exist, it will return an error.
  • If you try to delete a set of pods, and if one of those doesn't exist, it won't return an eror.

Solution:

I can use the selectors and set up a new method in the pods interface called DeleteBulk that calls a DeleteCollection on the background.

NOTE

The solution described above has not been implemented and has been postponed for future work.

Edited by Marcos Huck

Merge request reports