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

Various refactorings #172

Merged
merged 7 commits into from
Mar 16, 2022
Merged

Various refactorings #172

merged 7 commits into from
Mar 16, 2022

Conversation

dgkanatsios
Copy link
Collaborator

@dgkanatsios dgkanatsios commented Mar 1, 2022

Minor refactorings on the project.
Details:

  1. Removes the sorting for the GameServers in the GameServerBuild controller. The sorting was meant to make for faster deletion, since Initializing and StandingBy servers would be in the first places of the array. However, Initializing could convert to StandingBy which would have changed their ResourceVersion, so there would be conflicts in deleting them. So we decided to remove the sorting and potentially get some CPU cycles back.
  2. Simplifies the if checks by combining the non active game servers count into a single variable
  3. creates a function for game server deletion, that checks for the resource version before deletion. If the CR has been updated, deletion will return a conflict
  4. Updates the addSafeToEvictAnnotation method to add the safe to evict "true" attribute to Initializing GameServer objects
  5. removing the sorting revealed another bug where we didn't delete enough game servers when conflicts occurred
  6. updating kind version
  7. updating controller-runtime to 0.11.1
  8. updates the allocate path to make sure that we delete the GameServerDetail when there is an error in Updating the GameServer and setting it to Active

@dgkanatsios dgkanatsios marked this pull request as draft March 8, 2022 20:01
@dgkanatsios dgkanatsios force-pushed the refactorings branch 3 times, most recently from 2f435c7 to 31ba61e Compare March 9, 2022 00:11
@dgkanatsios dgkanatsios marked this pull request as ready for review March 9, 2022 00:28
@dgkanatsios dgkanatsios added this to the 0.3.0 milestone Mar 10, 2022
@dgkanatsios dgkanatsios changed the title Minor refactorings Various refactorings Mar 11, 2022
@dgkanatsios dgkanatsios merged commit d87fd5b into main Mar 16, 2022
@dgkanatsios dgkanatsios deleted the refactorings branch March 16, 2022 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants