-
Notifications
You must be signed in to change notification settings - Fork 772
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
Replace underscores with dashes while rendering container names #606
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Signed! |
@achanda This looking great! Code LGTM 👍 💯 |
@cdrage I took the liberty of refactoring this so that we call the normalization code only once. |
pkg/loader/compose/compose.go
Outdated
newName := normalizeServiceNames(composeServiceConfig.ContainerName) | ||
serviceConfig.ContainerName = newName | ||
if newName != composeServiceConfig.ContainerName { | ||
log.Infof("Container name in docker-compose has been changed from %q to %q", composeServiceConfig.ContainerName, newName) |
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.
nit: can we change the log to Container name in %q has been changed from %q to %q
where the first %q
being variable name
this shows what service we have made change in!
@achanda thanks for the PR, apart from that nit code LGTM! |
Kubernetes container names must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])? This excludes underscores, which is common in container names in compose.
@surajssd thanks, done! |
@achanda LGTM |
@achanda awesome! |
Kubernetes container names must match the regex a-z0-9?
This excludes underscores, which is common in container names in compose. Given this docker compose file
Before this patch, compose generates this deployment
After the patch, it generates
The CLI output: