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

Add support for persistent volume claims in kube files #8497

Merged
merged 2 commits into from
Nov 28, 2020

Conversation

AlbanBedel
Copy link
Contributor

This PR add simple support for persistent volume claims (PVC) to kube files by simply using a named volume with the name of the claim. The first commit rework the code for volumes in kube to allow supporting several types and the second one then add the new volume type.

This should solve bug #5788, but it doesn't overlap with PR #8266 which afaict is about creating the volumes and not using them.

Replace the simple map of names to paths with a map of names to a struct
to allow passing more parameters. Also move the code to parse the volumes
to its own file to avoid making the playKubePod() function overly complex.
Finally rework the kube volumes test to also be ready to support more
volume types.

Signed-off-by: Alban Bedel <[email protected]>
In k8s a persistent volume claim (PVC) allow pods to define a volume
by referencing the name of a PVC. The PVC basically contains criterias
that k8s then use to select which storage source it will use for the
volume.

Podman only provide one abtracted storage, the named volumes, and
create them if they don't exists yet. So this patch simply use a
volume with the name of the PVC.

Signed-off-by: Alban Bedel <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Nov 27, 2020

Thanks @AlbanBedel
You need to gofmt your code.

@haircommander @mheon PTAL

@AlbanBedel
Copy link
Contributor Author

I just found about make gofmt, CONTRIBUTING.md doesn't mention it and I had no luck with lint and validate in the gate container up to now. Currently it doesn't start at all (ERROR: Expecting libpod repository root at /usr/src/libpod (gate container entrypoint)) and last time I tried it froze my machine after a few minutes and then the container crashed.

@zhangguanzhang
Copy link
Collaborator

maybe need rebase?

@baude
Copy link
Member

baude commented Nov 28, 2020

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlbanBedel, baude

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 28, 2020
@baude
Copy link
Member

baude commented Nov 28, 2020

lgtm

@mheon
Copy link
Member

mheon commented Nov 28, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 28, 2020
@openshift-merge-robot openshift-merge-robot merged commit f0d48aa into containers:master Nov 28, 2020
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants