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

cherr-pick(fix,restore): removing annotation openebs.io/created-through from PVC #86

Merged
merged 1 commit into from
May 12, 2020

Conversation

mynktl
Copy link
Member

@mynktl mynktl commented May 12, 2020

Why is this PR required? What issue does it fix?:
This PR is fix for #84 and openebs-archive/maya#1689

What this PR does?:
This PR clears the annotation openebs.io/created-through from restore cstor PVC.
Cherry-pick of #85

Does this PR require any upgrade changes?: No

If the changes in this PR are manually verified, list down the scenarios covered and commands you used for testing with logs:
Following scenario verified

  • Created remote backup of percona application, using cstor volume in namespace test, through velero-plugin
    • Created restore from that backup in different namespace ns1
    • Verified that PVC doesn't have annotation openebs.io/created-through
    • Created restic backup for the restored percona application
    • Created restore from that restic backup to different namespace ns2

Output:

  • List of PVC
mayank@mayank:~/cloudvm$ kubectl get pvc -A 
NAMESPACE   NAME                       STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS           AGE
ns1         demo-cstor-vol-claim-1     Bound    pvc-d7620526-f982-4cc1-9397-9914a4354dcc   5G         RWO            openebs-cstor-sparse   28m
ns2         demo-cstor-vol-claim-1     Bound    pvc-1245be62-8a12-49b4-b1f2-653995f63613   5G         RWO            openebs-cstor-sparse   4m17s
test        demo-cstor-vol-claim-1     Bound    pvc-4bf06db4-2cba-4c23-998b-f6e3249d4fa6   5G         RWO            openebs-cstor-sparse   96m
  • List of CVR
mayank@mayank:~/cloudvm$ kubectl get cvr -n openebs
NAME                                                       USED    ALLOCATED   STATUS    AGE
pvc-1245be62-8a12-49b4-b1f2-653995f63613-cstor-pool-z7ra   36.4M   12.1M       Healthy   4m39s
pvc-4bf06db4-2cba-4c23-998b-f6e3249d4fa6-cstor-pool-z7ra   6.50K   6.50K       Healthy   97m
pvc-d7620526-f982-4cc1-9397-9914a4354dcc-cstor-pool-z7ra   54.7M   16.1M       Healthy   28m
  • Annotation in CVR
mayank@mayank:~/cloudvm$ kubectl get cvr pvc-1245be62-8a12-49b4-b1f2-653995f63613-cstor-pool-z7ra   -n openebs  -o json |jq ".metadata.annotations" 
{
  "cstorpool.openebs.io/hostname": "127.0.0.1",
  "isRestoreVol": "false",
  "openebs.io/storage-class-ref": "name: openebs-cstor-sparse\nresourceVersion: 538\n"
}
mayank@mayank:~/cloudvm$ kubectl get cvr pvc-d7620526-f982-4cc1-9397-9914a4354dcc-cstor-pool-z7ra    -n openebs  -o json |jq ".metadata.annotations" 
{
  "cstorpool.openebs.io/hostname": "127.0.0.1",
  "isRestoreVol": "true",
  "openebs.io/storage-class-ref": "name: openebs-cstor-sparse\nresourceVersion: 538\n"
}
mayank@mayank:~/cloudvm$ kubectl get cvr pvc-4bf06db4-2cba-4c23-998b-f6e3249d4fa6-cstor-pool-z7ra     -n openebs  -o json |jq ".metadata.annotations" 
{
  "cstorpool.openebs.io/hostname": "127.0.0.1",
  "isRestoreVol": "false",
  "openebs.io/storage-class-ref": "name: openebs-cstor-sparse\nresourceVersion: 538\n"
}
  • PVC Annotations
mayank@mayank:~/cloudvm$ kubectl get pvc demo-cstor-vol-claim-1 -n ns1  -o json |jq ".metadata.annotations" 
{
  "pv.kubernetes.io/bind-completed": "yes",
  "pv.kubernetes.io/bound-by-controller": "yes",
  "volume.beta.kubernetes.io/storage-provisioner": "openebs.io/provisioner-iscsi"
}
mayank@mayank:~/cloudvm$ kubectl get pvc demo-cstor-vol-claim-1 -n ns2  -o json |jq ".metadata.annotations" 
{
  "pv.kubernetes.io/bind-completed": "yes",
  "pv.kubernetes.io/bound-by-controller": "yes",
  "volume.beta.kubernetes.io/storage-provisioner": "openebs.io/provisioner-iscsi"
}
mayank@mayank:~/cloudvm$ kubectl get pvc demo-cstor-vol-claim-1 -n test  -o json |jq ".metadata.annotations" 
{
  "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"PersistentVolumeClaim\",\"metadata\":{\"annotations\":{},\"name\":\"demo-cstor-vol-claim-1\",\"namespace\":\"test\"},\"spec\":{\"accessModes\":[\"ReadWriteOnce\"],\"resources\":{\"requests\":{\"storage\":\"5G\"}},\"storageClassName\":\"openebs-cstor-sparse\"}}\n",
  "pv.kubernetes.io/bind-completed": "yes",
  "pv.kubernetes.io/bound-by-controller": "yes",
  "volume.beta.kubernetes.io/storage-provisioner": "openebs.io/provisioner-iscsi"
}

Checklist:

Signed-off-by: mayank mayank.patel@mayadata.io

…openebs#85)

removing annotation openebs.io/created-through from PVC once CVR are updated

Signed-off-by: mayank <mayank.patel@mayadata.io>
@mynktl mynktl requested a review from kmova May 12, 2020 13:51
@mynktl mynktl added the Bug issue/pr is a bug/fix to existing feature label May 12, 2020
@mynktl mynktl added this to the 1.10 milestone May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug issue/pr is a bug/fix to existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants