-
Notifications
You must be signed in to change notification settings - Fork 770
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
normalize docker-compose service that has name with underscore #429
Conversation
pkg/loader/compose/compose_test.go
Outdated
for _, testCase := range testCases { | ||
returnValue := normalizeServiceNames(testCase.composeServiceName) | ||
if returnValue != testCase.normalizedServiceName { | ||
t.Log("Expected %q, got %q", testCase.normalizedServiceName, returnValue) |
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.
this should be Logf
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.
done!
kubernetes or openshift does not allow underscores in the object names, while docker-compose does, in this commit the code has been added to convert underscores to hypens.
28aa4b6
to
0bc24d5
Compare
{"foo_bar", "foo-bar"}, | ||
{"foo", "foo"}, | ||
{"foo.bar", "foo.bar"}, | ||
//{"", ""}, |
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.
remove this?
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.
that was purposeful!
|
||
func normalizeServiceNames(svcName string) string { | ||
return strings.Replace(svcName, "_", "-", -1) | ||
} |
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 👍
kubernetes or openshift does not allow underscores in the object
names, while docker-compose does, in this commit the code has been
added to convert underscores to hypens.
Fixes #420