Bug: Underscores in docker-compose services names #74
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version
3, develop branch
Reproduce
Create a docker-compose file with service names containing underscores and convert it. Same problem with volume names.
Expected behavior
Valid Helm-Chart with underscores converted to dashes in K8s resource names.
Faulty behavior
Note
Hi, yes right 👍🏻
I fixed this in
d72f371c59
Hi
The dashes problem
I wanted to add that with the 3.0.0-rc2 version, I get the same kind of problems, where having dashes in the name of a compose service pass through in the values names, and those cannot have dashes in their names.
Sources
Docker compose file :
The error
Katenary converts it, and then when trying to apply the helmchart I get this error :
Problem in the generated files
When inspecting the generated file, we can see that the problem is the naming of the variable, being the first line containing such problem it raised the aforementionned error :
So Katenary needs to convert this type of characters too to prevent this case from happening.
I suggest the conversion of dashes into underscores to name the variables.
The underscores problem
Okay now for the more "fun" part, let's say I try to fix the problem just by replacing the dashes with underscores in the service name and then I try to generate. Well, it doesn't work either at the moment.
Sources
Compose file :
The error
Some commands you've already seen, but with another twist :
Problem in the generated files
And here's part of the generated file for more context :
And, two things here :
container_name
key from the compose file, which is not the real problem hereConclusion
To conclude, we can see that in both cases there is a problem with the generated chart when we are in presence of dashes or underscores in the services'names.
I'd suggest to completely segragate the two names, having one with underscores for values, and the other with dashes for the name of the container and other helm keys.
Yep, right, the main problem is that each resource has got its own rule. I missed this one (volume name).
I will fix it tomorrow