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

NOJIRA Break PodReconciler.Reconcile() into helpers #66

Merged
merged 7 commits into from
Jan 8, 2024

Conversation

miguelbernadi
Copy link
Contributor

Context

The PodReconciler.Reconcile() is long and convoluted, making it hard to understand and parse. As there are distinct steps in its operation, let's break them into helpers named after the logical operation to simplify understanding it.

What this changes

  • Extract interface for caching and platform statistics into its own private methods, starting a new internal API.

  • Group all the code required to determine if an existing Pod is already scheduled properly into its own private method.

  • Streamline the main method's flow to reduce indentation and clarify the logical process.

Non-goals

  • Modify the behaviour of the reconcile method

Change-Id: Id39d5caf4120b1f20a138b6dfecd5ae8be344eab

 # Context

The `PodReconciler.Reconcile()` is long and convoluted, making it hard
to understand and parse. As there are distinct steps in its operation,
let's break them into helpers named after the logical operation to
simplify understanding it.

 # What this changes

- Extract interface for caching and platform statistics into its own
private methods, starting a new internal API.

- Group all the code required to determine if an existing Pod is
already scheduled properly into its own private method.

- Streamline the main method's flow to reduce indentation and clarify
the logical process.

 # Non-goals

- Modify the behaviour of the reconcile method

Change-Id: Id39d5caf4120b1f20a138b6dfecd5ae8be344eab
pkg/controllers/pod.go Outdated Show resolved Hide resolved
pkg/controllers/pod.go Outdated Show resolved Hide resolved
pkg/controllers/pod.go Outdated Show resolved Hide resolved
pkg/controllers/pod.go Outdated Show resolved Hide resolved
pkg/controllers/pod.go Outdated Show resolved Hide resolved
@joaoqalves joaoqalves self-requested a review January 8, 2024 09:42
pkg/controllers/pod.go Outdated Show resolved Hide resolved
pkg/controllers/pod.go Outdated Show resolved Hide resolved
@miguelbernadi miguelbernadi merged commit 62ea3e9 into adevinta:main Jan 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants