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

Replaced use of strings.ToLower comparison with EqualFold #214

Merged
merged 1 commit into from
Feb 21, 2019
Merged

Replaced use of strings.ToLower comparison with EqualFold #214

merged 1 commit into from
Feb 21, 2019

Conversation

tothandras
Copy link
Contributor

Closes #181

Signed-off-by: András Tóth andras.toth@banzaicloud.com

@jpkrohling
Copy link
Contributor

This change is Reviewable

@tothandras
Copy link
Contributor Author

tothandras commented Feb 21, 2019

oh, my regex wasn't the best, 1 sec
EDIT: should be fine now

@tothandras tothandras changed the title Replaced use of strings.ToLower comparison with EqualFold [WIP] Replaced use of strings.ToLower comparison with EqualFold Feb 21, 2019
@tothandras tothandras changed the title [WIP] Replaced use of strings.ToLower comparison with EqualFold Replaced use of strings.ToLower comparison with EqualFold Feb 21, 2019
@codecov
Copy link

codecov bot commented Feb 21, 2019

Codecov Report

Merging #214 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #214   +/-   ##
======================================
  Coverage    96.7%   96.7%           
======================================
  Files          32      32           
  Lines        1639    1639           
======================================
  Hits         1585    1585           
  Misses         41      41           
  Partials       13      13
Impacted Files Coverage Δ
pkg/strategy/streaming.go 96.36% <100%> (ø) ⬆️
pkg/ingress/query.go 100% <100%> (ø) ⬆️
pkg/strategy/production.go 100% <100%> (ø) ⬆️
pkg/inject/sidecar.go 100% <100%> (ø) ⬆️
pkg/strategy/all-in-one.go 100% <100%> (ø) ⬆️
pkg/storage/types.go 100% <100%> (ø) ⬆️
pkg/storage/dependency.go 100% <100%> (ø) ⬆️
pkg/deployment/agent.go 100% <100%> (ø) ⬆️
pkg/strategy/controller.go 100% <100%> (ø) ⬆️

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 991bd48...f844380. Read the comment docs.

Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

Looks really good!

There's one change that shouldn't be there, for a source file within the vendor directory. Apart from that, there are a couple of other places missing:

./pkg/deployment/agent.go:	if strings.ToLower(a.jaeger.Spec.Agent.Strategy) != "daemonset" {
./pkg/cronjob/spark_dependencies.go:	return supportedStorageTypes[strings.ToLower(storage)]
./pkg/strategy/controller.go:	if strings.ToLower(jaeger.Spec.Strategy) != "production" && strings.ToLower(jaeger.Spec.Strategy) != "streaming" {
./pkg/strategy/controller.go:	if strings.EqualFold(jaeger.Spec.Storage.Type, "memory") && strings.ToLower(jaeger.Spec.Strategy) != "allinone" {
./pkg/strategy/controller.go:		if strings.ToLower(typ) == k {

Once they are changed, this is ready to be merged. Thanks for your PR!

Reviewed 9 of 9 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @tothandras)


vendor/github.com/PuerkitoBio/purell/purell.go, line 273 at r1 (raw file):

func forceHTTP(u *url.URL) {
	if strings.EqualFold(u.Scheme, "https") {

This one should probably not be here :-) (vendor)

@@ -17,7 +17,13 @@ import (
var supportedStorageTypes = map[string]bool{"elasticsearch": true, "cassandra": true}

func SupportedStorage(storage string) bool {
return supportedStorageTypes[strings.ToLower(storage)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jpkrohling codecov is not happy about this change.

Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 4 files at r2, 1 of 1 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @tothandras)


pkg/cronjob/spark_dependencies.go, line 20 at r3 (raw file):

func SupportedStorage(storage string) bool {
	for storageType, supported := range supportedStorageTypes {

Cool, I guess you found one place where it should indeed be ToLower ;)

Signed-off-by: András Tóth <andras.toth@banzaicloud.com>
@tothandras
Copy link
Contributor Author


pkg/cronjob/spark_dependencies.go, line 20 at r3 (raw file):

Previously, jpkrohling (Juraci Paixão Kröhling) wrote…

Cool, I guess you found one place where it should indeed be ToLower ;)

okay, reverted

Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r4.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@jpkrohling jpkrohling merged commit 07de1a2 into jaegertracing:master Feb 21, 2019
@jpkrohling
Copy link
Contributor

Thanks!

@tothandras tothandras deleted the issue/181 branch February 21, 2019 13:26
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