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

Add controller framework #2

Merged
merged 7 commits into from
Jul 8, 2019
Merged

Add controller framework #2

merged 7 commits into from
Jul 8, 2019

Conversation

shague
Copy link
Contributor

@shague shague commented Jun 27, 2019

This adds the initial controller framework as well as Makefile and Travis support. The etcd interactions will be added in subsequent patches.

Sam Hague added 5 commits June 27, 2019 08:26
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>
@shague shague requested review from dougbtv, trozet, fepan, vpickard and a team June 27, 2019 17:35
@shague shague self-assigned this Jun 27, 2019
Copy link
Contributor

@trozet trozet left a 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 Show resolved Hide resolved
cmd/stargazer/main.go Outdated Show resolved Hide resolved
cmd/stargazer/main.go Outdated Show resolved Hide resolved
pkg/controllers/node/node_controller.go Outdated Show resolved Hide resolved
}

// Object for keeping track of Controller information.
type controllerState struct {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

pkg/controllers/node/node_controller.go Outdated Show resolved Hide resolved
@trozet
Copy link
Contributor

trozet commented Jun 27, 2019

Looks like the travis stuff is passing even though their are lint failures? maybe not exiting with non-zero return code
https://travis-ci.com/nimbess/stargazer/builds/117186434#L477

Dockerfile Show resolved Hide resolved
Sam Hague added 2 commits June 28, 2019 10:59
Signed-off-by: Sam Hague <shague@gmail.com>
Signed-off-by: Sam Hague <shague@gmail.com>
@shague
Copy link
Contributor Author

shague commented Jun 28, 2019

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.

@shague shague requested a review from trozet June 28, 2019 21:33
@fepan fepan merged commit 2208568 into nimbess:master Jul 8, 2019
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