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

Moved IP Reconciler code into IP Control Loop #238

Merged
merged 2 commits into from
Jul 12, 2022

Conversation

nicklesimba
Copy link
Collaborator

This commit removes the IP Reconciler as a separate binary, and also removes the cronjob that launched it.

Instead, the code now invokes the reconciler code at a user configurable interval (once per day default).

As part of these changes, the code has also been reorganized with more clear file names etc.

README.md Outdated Show resolved Hide resolved
cmd/controlloop/controlloop.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Mostly I just have nits.

.github/CODEOWNERS Show resolved Hide resolved
cmd/controlloop/controlloop.go Outdated Show resolved Hide resolved
cmd/controlloop/controlloop.go Outdated Show resolved Hide resolved
pkg/controlloop/pod.go Outdated Show resolved Hide resolved
pkg/reconciler/errors.go Outdated Show resolved Hide resolved
pkg/controlloop/pod.go Outdated Show resolved Hide resolved
pkg/reconciler/ip.go Outdated Show resolved Hide resolved
cmd/controlloop/controlloop.go Show resolved Hide resolved
pkg/reconciler/ip.go Outdated Show resolved Hide resolved
pkg/reconciler/ip.go Outdated Show resolved Hide resolved
pkg/types/types.go Outdated Show resolved Hide resolved
pkg/reconciler/controlloop/pod.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to move the shutdown of the work-queue to the main function - it must run after the stopChannel is caught.

I would simply defer it within the main. For that, you'll need to add a receiver function to the pod controller that shuts down the queue.

cmd/controlloop/controlloop.go Outdated Show resolved Hide resolved
pkg/reconciler/controlloop/pod.go Outdated Show resolved Hide resolved
@nicklesimba nicklesimba force-pushed the cronjob-removal branch 2 times, most recently from fdb5977 to 1ba8ea9 Compare July 6, 2022 20:31
Copy link
Collaborator

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You now registering the fail handler, and attempting to run the specs twice in the same pkg.

You cannot do that. Remove the following lines from the pkg/reconciler/suite_test.go file.

func TestAPIs(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecsWithDefaultAndCustomReporters(t,
		"Whereabouts IP reconciler Suite",
		[]Reporter{})
}

Or, better yet, merge the pkg/reconciler/ip_test.go and pkg/reconciler/iploop_test.go - each should have a different Describe block.

This would address your current unit test error.

@coveralls
Copy link

coveralls commented Jul 7, 2022

Pull Request Test Coverage Report for Build 2630891680

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 27 of 61 (44.26%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+5.3%) to 59.227%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/config/config.go 27 34 79.41%
pkg/reconciler/ip.go 0 27 0.0%
Files with Coverage Reduction New Missed Lines %
pkg/config/config.go 2 56.18%
Totals Coverage Status
Change from base Build 2618291237: 5.3%
Covered Lines: 950
Relevant Lines: 1604

💛 - Coveralls

Copy link
Member

@dougbtv dougbtv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ready to move forward on this change. Thanks for the hard work and all the follow up to get it in order. Well done.

Let's just squash the commits. Keep one commit for the vendor changes, and one more commit for the rest of the changes 👍

Copy link
Member

@dougbtv dougbtv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 💯

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.

4 participants