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

Rename controller to strategy #125

Merged

Conversation

jpkrohling
Copy link
Contributor

Signed-off-by: Juraci Paixão Kröhling juraci@kroehling.de

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
@jpkrohling
Copy link
Contributor Author

This change is Reviewable

@jpkrohling
Copy link
Contributor Author

Summary of changes:

  1. Moved the old controller code to strategy
  2. Renamed controllers to strategy (allInOneController -> allInOneStrategy)
  3. Renamed the interface Controller to S, referenced by code in other packages as strategy.S
  4. Renamed NewController to For, referenced by code in other packages as strategy.For(ctx, jaeger)

@codecov
Copy link

codecov bot commented Nov 22, 2018

Codecov Report

Merging #125 into master will increase coverage by 0.34%.
The diff coverage is 88.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #125      +/-   ##
==========================================
+ Coverage   95.64%   95.99%   +0.34%     
==========================================
  Files          27       27              
  Lines        1148     1148              
==========================================
+ Hits         1098     1102       +4     
+ Misses         38       36       -2     
+ Partials       12       10       -2
Impacted Files Coverage Δ
pkg/strategy/production.go 100% <100%> (ø)
pkg/strategy/controller.go 100% <100%> (ø)
pkg/strategy/all-in-one.go 100% <100%> (ø)
pkg/controller/jaeger/jaeger_controller.go 54.87% <76.92%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96ccc24...977ba16. Read the comment docs.

@objectiser
Copy link
Contributor

@jpkrohling Before doing the review - don't like S as an interface name - could it be changed to Strategy, or if don't want strategy.Strategy, possibly Plan (i.e. the outcome of a strategy)?

@jpkrohling
Copy link
Contributor Author

don't like S as an interface name

I'm not a big fan either and I did name it strategy.Strategy first, but I changed it to follow Go conventions in naming the type with a single letter when the type has the same name as the package. testing.T is the most common reference of this rule.

Copy link
Contributor

@objectiser objectiser left a comment

Choose a reason for hiding this comment

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

LGTM - although codecov/patch has failed still.

@@ -179,7 +179,7 @@ func getDeployments(objs []runtime.Object) []*appsv1.Deployment {
return deps
}

func assertHasAllObjects(t *testing.T, name string, objs []runtime.Object, deployments map[string]bool, daemonsets map[string]bool, services map[string]bool, ingresses map[string]bool, routes map[string]bool, serviceAccounts map[string]bool) {
func assertHasAllObjects(t *testing.T, name string, objs []runtime.Object, deployments map[string]bool, daemonsets map[string]bool, services map[string]bool, ingresses map[string]bool, routes map[string]bool, serviceAccounts map[string]bool, configMaps map[string]bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessarily for now, but could probably do with a struct to contain all of these parameters.

assertDeploymentsAndServicesForProduction(t, name, objs, true, false, false)
}

func TestCreateProductionDeploymentWithUIConfigMap(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I missed these :)

@jpkrohling jpkrohling merged commit 624b342 into jaegertracing:master Nov 22, 2018
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.

2 participants