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

Get controller.go test coverage to 100% #9

Merged
merged 1 commit into from
Jun 8, 2018

Conversation

pwittrock
Copy link
Contributor

No description provided.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 8, 2018
Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

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

LGTM, minor comments. Feel free to self-merge it after fixing those comments.

@@ -93,6 +93,8 @@ type controller struct {
// the queue for processing
queue workqueue.RateLimitingInterface

jitterPeriod time.Duration
Copy link
Contributor

Choose a reason for hiding this comment

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

May be a comment explaining what is this really for ?

@@ -145,21 +149,33 @@ func (c *controller) Start(stop <-chan struct{}) error {
for _, informer := range allInformers {
syncedFuncs = append(syncedFuncs, informer.HasSynced)
}
if ok := cache.WaitForCacheSync(stop, syncedFuncs...); !ok {

// Allow waitForCache to be mocked out for tests
Copy link
Contributor

Choose a reason for hiding this comment

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

May be move this comment where this is declared ?

go wait.Until(func() {
// TODO(pwittrock): Should we really use wait.Until to continuously restart this if it exits?
fmt.Printf("Running\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

fmt --> log ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were debug statements :P

for c.processNextWorkItem() {
}
}, time.Second, stop)
fmt.Printf("Stopping\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

fmt --> log ?


})
})
})
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: filename has "manger" --> manager :)

Choose a reason for hiding this comment

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

Should Describe be "controller manager", and //TODO comments be needed ?

@fanzhangio
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 8, 2018
Copy link

@fanzhangio fanzhangio left a comment

Choose a reason for hiding this comment

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

lgtm


})
})
})

Choose a reason for hiding this comment

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

Should Describe be "controller manager", and //TODO comments be needed ?

@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 8, 2018
@pwittrock pwittrock merged commit 63acb0c into kubernetes-sigs:master Jun 8, 2018
justinsb pushed a commit to justinsb/controller-runtime that referenced this pull request Dec 7, 2018
Get controller.go test coverage to 100%
DirectXMan12 pushed a commit that referenced this pull request Jan 31, 2020
Better help messaging for kubebuilder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants