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

chore(csi-driver): update driver to read PVC, PV name in CreateVolume request #90

Merged
merged 7 commits into from Jun 5, 2020

Conversation

mittachaitu
Copy link

@mittachaitu mittachaitu commented Jun 4, 2020

What this PR does:
This PR updates the CSI driver to read PVC name,
PVC namespace, and PV name during CreateVolume
request. If the driver gets PVC name and namespace
it will fetch the entire PVC object from etcd and propagate
the openebs.io/created-through annotation to CVC if it exists
on annotation.

This annotation will inform the CVC controller to create CVR
with annotation isRestoreVol: true. If this annotation is set then
CVR controller will not the targetIP during zfs dataset creation.

Note:

  • During restore of CStor-CSI volumes velero-plugin creates a
    PVC with the annotation openebs.io/created-through: restore.
  • The restore of CSI volumes is supported from 1.6.0 version of CSI-Provisioner.
  • If we pass argument extra-create-metadata to csi-provisioner
    then it will send PVC name, namespace and PV name to CSI-dirver
    as part of the CreateVolume request.
    Reference PR: add pvc metadata to createvolume req kubernetes-csi/external-provisioner#399

Which issue(s) this PR fixes:
Fixes # openebs/openebs#2905

Special notes for your reviewer:

Checklist

  • PR messages has document related information
  • Labelled this PR & related issue with documentation tag
  • PR messages has breaking changes related information
  • PR messages has upgrade related information
  • Labelled this PR & related issue with requires-upgrade tag
  • Tests updated

mittachaitu added 3 commits June 4, 2020 18:19
…uest

Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2020

Codecov Report

Merging #90 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #90   +/-   ##
=======================================
  Coverage   63.88%   63.88%           
=======================================
  Files           7        7           
  Lines         335      335           
=======================================
  Hits          214      214           
  Misses        108      108           
  Partials       13       13           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8ee47e...71e2471. Read the comment docs.

@mittachaitu mittachaitu requested a review from mynktl June 4, 2020 13:54
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Copy link

@mynktl mynktl left a comment

Choose a reason for hiding this comment

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

lgtm 👍 Given few comments. PTAL.

go.mod Show resolved Hide resolved
// volumeCreatedThrough used to identify through which PVC is created
// NOTE: This annoation will be available on PVC only if velero-plugin
// creates as PVC as a part of restore request
volumeCreatedThrough = "openebs.io/created-through"
Copy link

Choose a reason for hiding this comment

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

can we move it to openebs/api since this is used in plugin/maya/cstor-operator and here also, better to have it under openebs/api.

Copy link
Author

Choose a reason for hiding this comment

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

Sure, I need to make similar changes in cstor-operaters repo also. Once this gets PR gets in I will do that.

mittachaitu added 3 commits June 5, 2020 15:41
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Copy link
Contributor

@prateekpandey14 prateekpandey14 left a comment

Choose a reason for hiding this comment

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

lgtm

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.

None yet

6 participants