-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add controller framework #2
Conversation
Signed-off-by: Sam Hague <shague@gmail.com>
Signed-off-by: Sam Hague <shague@gmail.com>
Signed-off-by: Sam Hague <shague@gmail.com>
Signed-off-by: Sam Hague <shague@gmail.com>
Signed-off-by: Sam Hague <shague@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, i think its fine to approve after that
cmd/stargazer/main.go
Outdated
} | ||
|
||
// Object for keeping track of Controller information. | ||
type controllerState struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name seems like it doesn't really fit. This doesn't maintain a state variable or anything, it just tracks a controller and how many threads it supports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Controller is just an interface with a Run function. This is the controller itself, so it sounds like that is state since it's all I have. I can't think of a better name but am not tied to it either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any struct which implements Run will be a Controller. You already do that with Node Controller. This is just a struct holding a controller and threadiness. If your goal is for this object to be a controller, then I think it would be better to just include your threadiness field inside of the controller struct itself, and then you don't need this struct at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed ControllerState to ControllerInfo since it holds the controller along with the request number of workers. This ControllerInfo is used with the ControllerControl map of controllerType,Info to start each controller type requested via the configuration.
Looks like the travis stuff is passing even though their are lint failures? maybe not exiting with non-zero return code |
Signed-off-by: Sam Hague <shague@gmail.com>
Signed-off-by: Sam Hague <shague@gmail.com>
Also updated the .travis.yml to include the set -e so it fails. Not needed this patchset, though, as the checks passed with no issues because I fixed the previous issues found. |
This adds the initial controller framework as well as Makefile and Travis support. The etcd interactions will be added in subsequent patches.