Skip to content

Conversation

@rahanar
Copy link
Collaborator

@rahanar rahanar commented Jul 3, 2019

This PR depends on PR #15.

This reimplements src-dst controller to use informers and workqueue. Will fix/add more tests and test on a cluster.

Copy link
Owner

@ottoyiu ottoyiu left a comment

Choose a reason for hiding this comment

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

Some minor comments but otherwise lgtm (apart from test coverage)

func (c *Controller) disableSrcDstCheck(key string) error {
defer c.workqueue.Done(key)

return retry.RetryOnConflict(retry.DefaultBackoff, func() error {
Copy link
Owner

Choose a reason for hiding this comment

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

is it possible to have a less greedy retry that does not calling 'c.modifySrcDstCheckAttribute' again if there's a conflict?

}

func (c *Controller) checkSrcDstAttributeEnabled(key string) (enabled bool, err error) {
defer c.workqueue.Done(key)
Copy link
Owner

Choose a reason for hiding this comment

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

Having this method call 'c.workqueue.Done' is a bit hard to follow. Perhaps it can be placed before :
https://github.com/ottoyiu/k8s-ec2-srcdst/pull/16/files#diff-bff40c211a4e0c5aed5c55ab3cdbda41R10

and have the failure cases on 'processNextWorkItem' return early instead.

if _, ok := node.Annotations[SrcDstCheckDisabledAnnotation]; ok {
srcDstCheckEnabled = false
func (c *Controller) disableSrcDstCheck(key string) error {
defer c.workqueue.Done(key)
Copy link
Owner

Choose a reason for hiding this comment

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

likewise to my other comment regarding modifying the workqueue in this method.

@gjtempleton
Copy link

Hey @ottoyiu really appreciate all your work on maintaining this project. Is there any chance of either this or #13 getting merged in the near future?

@rahanar
Copy link
Collaborator Author

rahanar commented Dec 6, 2019

hey @gjtempleton, I will work on merging this soon!

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