-
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
fix driver:local in prefixing volumes with current dir name #557
Conversation
} | ||
for _, label := range pvc.Labels { | ||
if strings.Contains(label, "_") { | ||
pvc.Labels = transformer.ConfigLabels(strings.Replace(label, "_", "-", -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.
A better idea here might be not to hardcode underscore-to-dash transition but instead to allow for an array of tuples (blacklisted char, replacement char) which will enable easier fix for this problem with other characters (if they show up) in the future.
@procrypt this doesn't seem to work, here's the full test (using Compose file from #554 (comment)). Note that version says 0.4.0, but the SHA is correct.
|
I've figured it out: if you leave the root-level
Also, it works in HEAD too, without this PR. |
@dkarlovi Did you build $ kompose convert -f dev.yml --stdout | grep PersistentVolumeClaim -A 5
WARN Unsupported root level volumes key - ignoring
WARN Unsupported depends_on key - ignoring
WARN Unsupported hostname key - ignoring
WARN Kubernetes provider doesn't support build key - ignoring
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: komposefiles-broker
name: komposefiles-broker
--
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: komposefiles-cache
name: komposefiles-cache
--
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: komposefiles-db
name: komposefiles-db kompose version
0.5.0 (HEAD) Please make sure you build |
@procrypt @dkarlovi , its working for me,
output is:
Make sure you are building from this PR only:
|
@surajnarwade @procrypt if it's working for you two, let's just assume I've PEBKACed because of my inexperience with Go and that it works for me too, I just can't reproduce it. :) I've followed the instructions to check out the PR branch locally, did a build and my Here's what I did:
|
@procrypt why this can't be fixed as it was done in #509 ? I think here we need to normalize only in https://github.com/kubernetes-incubator/kompose/blob/master/pkg/loader/compose/compose.go#L341 ? |
So with this we take care of it at source so we don;t have problems later since the data is scattered in all over the place. |
@surajssd Thanks I have updated the PR. |
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.
code lgtm. Can you explain the main update in glide @procrypt ?
@procrypt tests, functional ones. |
Hey @procrypt ! Almost there. Could you update your commit messages with what you wrote here? Otherwise, code LGTM. |
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.
code lgtm. Can you explain the main update in glide @procrypt ?
Same question here. What was reason for updating those vendored libraries?
Is it required for this to work?
@procrypt LGTM :) |
Ideally some tests should be added, but I don't see any issues arising because of this. LGTM. @kadel Wanna have a quick-lookover this before we merge this in before today's release? |
@cdrage Tests added 👍 |
If we have a docker-file with root level volumes and we do a kompose up using that docker-file, libcompose will add an additional _ followed by the current directory name. Since kubernetes doesn't allow _ in the objects created so kompose up will fail to deploy it. As a solution we replace _ to - and we can then deploy it successfully.
I am gonna merge this as all reviewers have approved. |
If we have a
docker-file
with root levelvolumes
and we do akompose up
using thatdocker-file
, libcompose will add an additional_
followed by the current directory name.docker-compose.yml
usedSince
kubernetes
doesn't allow_
in the objects created sokompose up
will fail to deploy it.As a solution we replace
_
to-
and we can then deploy it successfully.CC: @kadel @cdrage
Fixes #550