-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Factorize labels managements. #3099
Conversation
dead79e
to
6eb53db
Compare
8d31825
to
20f1bfc
Compare
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.
Great job @ldez 👏
) | ||
|
||
func TestBuildConfigurationV1(t *testing.T) { | ||
tests := []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.
Could you please rename tests
into testCases
} | ||
|
||
func TestGetFuncStringValueV1(t *testing.T) { | ||
tests := []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.
Could you please rename tests
into testCases
} | ||
|
||
func TestGetFuncSliceStringV1(t *testing.T) { | ||
tests := []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.
Could you please rename tests
into testCases
} | ||
} | ||
|
||
func TestGetFuncSliceStringV1(t *testing.T) { |
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.
Could you please rename TestGetFuncSliceStringV1
into TestGetFuncSliceString
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.
I renamed GetFuncSliceString
to GetFuncSliceStringV1
instead.
provider/consulcatalog/config.go
Outdated
"getTag": getTag, | ||
"hasTag": hasTag, | ||
} | ||
tmpl := template.New("consul catalog frontend rule").Funcs(FuncMap) |
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.
You could replace this next two lines with only one line
p.frontEndRuleTemplate = template.New("consul catalog frontend rule").Funcs(FuncMap)
provider/consulcatalog/config.go
Outdated
// If the returned result is a singular marker, return the 'key' component | ||
return kv[0] | ||
} | ||
|
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.
Could you please remove this line
test := test | ||
t.Run(test.desc, func(t *testing.T) { | ||
|
||
actualConfig := p.buildConfigurationV1(test.tasks) |
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.
Is there a reason do don't run these test cases in parallel ?
888c818
to
c083479
Compare
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.
LGTM 👏
7a3a1c4
to
c2d7b22
Compare
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.
LGTM
c2d7b22
to
03a295e
Compare
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.
LGTM 🤠 👏 👏
03a295e
to
86d57a4
Compare
What does this PR do?
Factorize labels managements for:
Motivation
Homogenization of the providers [part5]: have a shared way to manage labels.
More
Additional Notes
Related to #2785