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

underscores get propagated into invalid names #420

Closed
idcrook opened this issue Feb 9, 2017 · 11 comments
Closed

underscores get propagated into invalid names #420

idcrook opened this issue Feb 9, 2017 · 11 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/P2

Comments

@idcrook
Copy link

idcrook commented Feb 9, 2017

searched for dupes, and found none.

docker compose file has name like: phant_server: in yaml, which contain embedded underscores. kompose does not normalize the name, resulting in invalid names being used.

pvc

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: null
  name: phant_server-claim0
...

yields error

The PersistentVolume "phant_server-persistent-volume" is invalid: metadata.name: Invalid value: "phant_server-persistent-volume": must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com')

deployment

The Deployment "phant_server" is invalid:
* metadata.name: Invalid value: "phant_server": must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com')

possible normalization suggestions

phant_server -> phant.server
phant_server -> phant-server
phant_server -> phantserver

@surajssd surajssd self-assigned this Feb 10, 2017
@kadel kadel added kind/bug Categorizes issue or PR as related to a bug. priority/P2 labels Feb 10, 2017
@surajssd
Copy link
Member

@idcrook see if it works for you!

@idcrook
Copy link
Author

idcrook commented Feb 15, 2017

Thx

@kadel kadel reopened this Mar 1, 2017
@kadel
Copy link
Member

kadel commented Mar 1, 2017

Opening this issue again as #429 fixed this problem only for service names, same problem is still in volume names.

@surajssd
Copy link
Member

surajssd commented Mar 8, 2017

@kadel so @containscafeine found that there is a caveat with what #429 did.

Let say if a user defines a docker-compose file as

services:
  foo-bar:
...
  blah-blah:
...

Now if the blah-blah service tries to access foo-bar it will simply call out on foo-bar but here we are converting foo-bar to foo_bar so now the name resolution works in docker-compose but not in k8s because we just changed the name in config but code is using old name.

So we need to give out a WARNING saying this is done.

@surajssd
Copy link
Member

surajssd commented Mar 8, 2017

so above is filed in #433

@procrypt
Copy link

@surajssd @kadel Taking this up.

@surajssd
Copy link
Member

@procrypt i think @surajnarwade is working on this

@surajnarwade
Copy link
Contributor

@surajssd @procrypt , its okay, I havn't started yet, will pick other one :)

@kadel
Copy link
Member

kadel commented Mar 16, 2017

Ah, sorry @surajnarwade @procrypt I didn't know that, or even more probably forgot about it 😊

@idcrook
Copy link
Author

idcrook commented Mar 28, 2017

Can be closed when #509 is released

@xiaoping378
Copy link

version: '2'

services:

  ca.org1.example.com:

docker-compose like upon, when "kubectl create" will ouput error

The Service "orderer.example.com" is invalid: metadata.name: Invalid value: "orderer.example.com": a DNS-1035 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/P2
Projects
None yet
Development

No branches or pull requests

6 participants