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

Factorize labels managements. #3099

Merged
merged 5 commits into from
Apr 4, 2018
Merged

Conversation

ldez
Copy link
Contributor

@ldez ldez commented Mar 28, 2018

What does this PR do?

Factorize labels managements for:

  • ECS
  • Consul Catalog
  • Mesos

Motivation

Homogenization of the providers [part5]: have a shared way to manage labels.

More

  • Added/updated tests
  • Added/updated documentation

Additional Notes

Related to #2785

Copy link
Member

@mmatur mmatur left a 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 {
Copy link
Member

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 {
Copy link
Member

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 {
Copy link
Member

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) {
Copy link
Member

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

Copy link
Contributor Author

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.

"getTag": getTag,
"hasTag": hasTag,
}
tmpl := template.New("consul catalog frontend rule").Funcs(FuncMap)
Copy link
Member

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)

// If the returned result is a singular marker, return the 'key' component
return kv[0]
}

Copy link
Member

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)
Copy link
Member

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 ?

Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

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

LGTM 👏

@ldez ldez force-pushed the feature/labels-factorized branch from 7a3a1c4 to c2d7b22 Compare March 30, 2018 10:05
Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

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

LGTM

@ldez ldez force-pushed the feature/labels-factorized branch from c2d7b22 to 03a295e Compare April 3, 2018 09:57
Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

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

LGTM 🤠 👏 👏

@traefiker traefiker merged commit 6845068 into traefik:v1.6 Apr 4, 2018
@ldez ldez deleted the feature/labels-factorized branch April 4, 2018 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants