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

Fix one pod to multiple PVC connection #3553

Merged

Conversation

qiell
Copy link
Contributor

@qiell qiell commented Jan 9, 2019

Read all the PVC source from a pod spec
and add adjacency between the pod and its PVCs.

screenshot from 2019-01-09 16-25-07

Signed-off-by: Akash Srivastava akashsrivastava4927@gmail.com

fixes: #3550

if p.VolumeClaimName() != "" {
latests[VolumeClaim] = p.VolumeClaimName()
if len(p.VolumeClaimNames()) > 0 {
latests[VolumeClaim] = strings.Join(p.VolumeClaimNames(), "~p$")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"~p$" should be a constant.
And is that necessary and/or sufficient? What are the rules on volume claim names?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PVC name must consist of lower case alphanumeric characters, - or ., and must start and end with an alphanumeric character.
We can use a single space or any special character to join them.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, can you please add a comment about the rules and put the separator in a const.
I would probably just use , as the separator, if that works, but don't really mind.

Copy link
Contributor Author

@qiell qiell Jan 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @bboreham, , will work or we can use the ; i.e. ScopeDelim.

Read all the PVC source from a pod spec
and add adjacency between the pod and its PVCs.

Signed-off-by: Akash Srivastava <akashsrivastava4927@gmail.com>
@qiell qiell force-pushed the fix/one-pod-multiple-pvc-adjacency branch from b3212dc to 60a1c66 Compare January 13, 2019 14:41
Copy link
Contributor

@satyamz satyamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Scope Delimiter makes sense. Rest looks good to me!
Thanks @Akash4927

Copy link
Collaborator

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bboreham bboreham merged commit 1367051 into weaveworks:master Jan 18, 2019
@bboreham bboreham mentioned this pull request Feb 5, 2019
@qiell qiell deleted the fix/one-pod-multiple-pvc-adjacency branch February 6, 2019 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

One-to-many connections between a pod and many PVCs
3 participants