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

Changes to support velero 1.10 #500

Merged
merged 1 commit into from
Dec 23, 2022

Conversation

deepakkinni
Copy link
Collaborator

@deepakkinni deepakkinni commented Nov 23, 2022

What this PR does / why we need it:
Changes to support velero 1.10

Updated to go 1.18

Testing
Build/Unit

make push:

harbor-repo.vmware.com/velero/data-manager-for-plugin:vel_1_10_v1-c8d90ee-08.Dec.2022.11.49.13
harbor-repo.vmware.com/velero/velero-plugin-for-vsphere:vel_1_10_v1-c8d90ee-08.Dec.2022.11.49.13
harbor-repo.vmware.com/velero/backup-driver:vel_1_10_v1-c8d90ee-08.Dec.2022.11.49.13

make test:

Running tests: ./pkg/...
go test ./pkg/... -timeout=300s
Success!

Backup:

Without specifying default-volumes-to-fs-backup with annotation on the Pod

dkinni@dkinniCMD6R snapshot-vanilla-testing % velero backup create dec21bk4 --include-namespaces=foo --snapshot-volumes   
Backup request "dec21bk4" submitted successfully.
Run `velero backup describe dec21bk4` or `velero backup logs dec21bk4` for more details.

dkinni@dkinniCMD6R snapshot-vanilla-testing % velero backup describe dec21bk4                                          
Name:         dec21bk4
Namespace:    velero
Labels:       velero.io/storage-location=default
Annotations:  velero.io/source-cluster-k8s-gitversion=v1.25.2
              velero.io/source-cluster-k8s-major-version=1
              velero.io/source-cluster-k8s-minor-version=25

Phase:  Completed


Logs:
time="2022-12-22T04:41:37Z" level=info msg="Executing custom action" backup=velero/dec21bk4 logSource="pkg/backup/item_backupper.go:321" name=example-vanilla-block-pvc namespace=foo resource=persistentvolumeclaims
time="2022-12-22T04:41:37Z" level=info msg="Backing up resource persistentvolumeclaims: blocked = false" backup=velero/dec21bk4 cmd=/plugins/velero-plugin-for-vsphere logSource="/go/src/github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/plugin/backup_pvc_action_plugin.go:54" pluginName=velero-plugin-for-vsphere
time="2022-12-22T04:41:37Z" level=info msg="VSphere PVCBackupItemAction for PVC foo/example-vanilla-block-pvc started. Storage Class Name: example-vanilla-block-sc" backup=velero/dec21bk4 cmd=/plugins/velero-plugin-for-vsphere logSource="/go/src/github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/plugin/backup_pvc_action_plugin.go:70" pluginName=velero-plugin-for-vsphere
time="2022-12-22T04:41:37Z" level=info msg="Fetching underlying PV for PVC foo/example-vanilla-block-pvc" backup=velero/dec21bk4 cmd=/plugins/velero-plugin-for-vsphere logSource="/go/src/github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/plugin/backup_pvc_action_plugin.go:96" pluginName=velero-plugin-for-vsphere
time="2022-12-22T04:41:37Z" level=info msg="Skipping PVC foo/example-vanilla-block-pvc, PV pvc-01490ccc-792a-4332-88b6-3f984581d609 will be backed up using fs backup" backup=velero/dec21bk4 cmd=/plugins/velero-plugin-for-vsphere logSource="/go/src/github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/plugin/backup_pvc_action_plugin.go:109" pluginName=velero-plugin-for-vsphere
time="2022-12-22T04:41:37Z" level=info msg="VSphere PVCBackupItemAction for PVC foo/example-vanilla-block-pvc completed with err: <nil>" backup=velero/dec21bk4 cmd=/plugins/velero-plugin-for-vsphere logSource="/go/src/github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/plugin/backup_pvc_action_plugin.go:73" pluginName=velero-plugin-for-vsphere

With specifying default-volumes-to-fs-backup and no annotation on the Pod

dkinni@dkinniCMD6R snapshot-vanilla-testing % velero backup create dec21bk5 --include-namespaces=foo --snapshot-volumes --default-volumes-to-fs-backup
Backup request "dec21bk5" submitted successfully.
Run `velero backup describe dec21bk5` or `velero backup logs dec21bk5` for more details.
dkinni@dkinniCMD6R snapshot-vanilla-testing % velero backup describe dec21bk5
Name:         dec21bk5
Namespace:    velero
Labels:       velero.io/storage-location=default
Annotations:  velero.io/source-cluster-k8s-gitversion=v1.25.2
              velero.io/source-cluster-k8s-major-version=1
              velero.io/source-cluster-k8s-minor-version=25

Phase:  Completed

Logs:
time="2022-12-22T04:46:13Z" level=info msg="Executing custom action" backup=velero/dec21bk5 logSource="pkg/backup/item_backupper.go:321" name=example-vanilla-block-pvc namespace=foo resource=persistentvolumeclaims
time="2022-12-22T04:46:13Z" level=info msg="Backing up resource persistentvolumeclaims: blocked = false" backup=velero/dec21bk5 cmd=/plugins/velero-plugin-for-vsphere logSource="/go/src/github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/plugin/backup_pvc_action_plugin.go:54" pluginName=velero-plugin-for-vsphere
time="2022-12-22T04:46:13Z" level=info msg="VSphere PVCBackupItemAction for PVC foo/example-vanilla-block-pvc started. Storage Class Name: example-vanilla-block-sc" backup=velero/dec21bk5 cmd=/plugins/velero-plugin-for-vsphere logSource="/go/src/github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/plugin/backup_pvc_action_plugin.go:70" pluginName=velero-plugin-for-vsphere
time="2022-12-22T04:46:13Z" level=info msg="Fetching underlying PV for PVC foo/example-vanilla-block-pvc" backup=velero/dec21bk5 cmd=/plugins/velero-plugin-for-vsphere logSource="/go/src/github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/plugin/backup_pvc_action_plugin.go:96" pluginName=velero-plugin-for-vsphere
time="2022-12-22T04:46:13Z" level=info msg="Skipping PVC foo/example-vanilla-block-pvc, PV pvc-01490ccc-792a-4332-88b6-3f984581d609 will be backed up using fs backup" backup=velero/dec21bk5 cmd=/plugins/velero-plugin-for-vsphere logSource="/go/src/github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/plugin/backup_pvc_action_plugin.go:109" pluginName=velero-plugin-for-vsphere
time="2022-12-22T04:46:13Z" level=info msg="VSphere PVCBackupItemAction for PVC foo/example-vanilla-block-pvc completed with err: <nil>" backup=velero/dec21bk5 cmd=/plugins/velero-plugin-for-vsphere logSource="/go/src/github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/plugin/backup_pvc_action_plugin.go:73" pluginName=velero-plugin-for-vsphere

No annotation on the pod and without specifying default-volumes-to-fs-backup

This is regular backup, and works as expected.

Which issue(s) this PR fixes:
Fixes #485

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Changes to support velero v1.10

Signed-off-by: Deepak Kinni dkinni@vmware.com

go.mod Outdated Show resolved Hide resolved
@deepakkinni deepakkinni changed the title [WIP]Changes to support velero 1.10 Changes to support velero 1.10 Dec 8, 2022
@svcbot-qecnsdp
Copy link

Sorry, some of the pre-check tests are failing for this PR !

Please check the Jenkins job for more details
https://container-dp.svc.eng.vmware.com/job/CNSDP-CI/772/

Copy link
Contributor

@xinyanw409 xinyanw409 left a comment

Choose a reason for hiding this comment

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

Do we need to push vendor/ folder to the repo?

@deepakkinni
Copy link
Collaborator Author

Do we need to push vendor/ folder to the repo?

It was not a part of .gitignore in the past, so I assume it's expected.

@xing-yang
Copy link
Contributor

xing-yang commented Dec 10, 2022

Do we need to push vendor/ folder to the repo?

It was not a part of .gitignore in the past, so I assume it's expected.

We don't have a vendor folder. I don't think we should start having this in the github. Can you add /vendor to .gitignore?

@deepakkinni
Copy link
Collaborator Author

Do we need to push vendor/ folder to the repo?

It was not a part of .gitignore in the past, so I assume it's expected.

We don't have a vendor folder. I don't think we should start having this in the github. Can you add /vendor to .gitignore?

Fixed, removed the vendor, and added it as a part of gitignore.
cc: @xinyanw409

@svcbot-qecnsdp
Copy link

Sorry, some of the pre-check tests are failing for this PR !

Please check the Jenkins job for more details
https://container-dp.svc.eng.vmware.com/job/CNSDP-CI/773/

@xing-yang
Copy link
Contributor

Signed-off-by: Deepak Kinni <dkinni@vmware.com>
@deepakkinni
Copy link
Collaborator Author

@svcbot-qecnsdp
Copy link

Sorry, some of the pre-check tests are failing for this PR !

Please check the Jenkins job for more details
https://container-dp.svc.eng.vmware.com/job/CNSDP-CI/775/

@xing-yang
Copy link
Contributor

@deepakkinni With or without specifying default-volumes-to-fs-backup, the logs look identical. So what is the difference there? What does default-volumes-to-fs-backup do?

@deepakkinni
Copy link
Collaborator Author

@deepakkinni With or without specifying default-volumes-to-fs-backup, the logs look identical. So what is the difference there? What does default-volumes-to-fs-backup do?

From the plugin's perspective, the primary change is DefaultVolumesToRestic param is deprecated, and instead, users are supposed to specify DefaultVolumesToFsBackup/default-volumes-to-fs-backup.

The primary goal of the restic support is to ensure that specific volumes are skipped from backup. This is done by annotating the pod (https://velero.io/docs/v1.10/file-system-backup/#to-back-up).

When --default-volumes-to-fs-backup is False the plugin looks for backup.velero.io/backup-volumes annotation and skips them.

When --default-volumes-to-fs-backup is True, the plugin automatically assumes that all volumes attached to the pod are to be backed up by fs backup and hence are skipped.

@xing-yang
Copy link
Contributor

Can you add one test:

  • Remove annotations + without default flag
  • Remove annotations + add the default flag

@deepakkinni
Copy link
Collaborator Author

Can you add one test:

* Remove annotations + without default flag

* Remove annotations + add the default flag

Clarified this in testing.

Copy link
Contributor

@xing-yang xing-yang left a comment

Choose a reason for hiding this comment

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

LGTM

@deepakkinni deepakkinni merged commit 61468e6 into vmware-tanzu:main Dec 23, 2022
lipingxue pushed a commit to lipingxue/velero-plugin-for-vsphere that referenced this pull request May 19, 2023
 Changes to support velero 1.10

Signed-off-by: Deepak Kinni <dkinni@vmware.com>
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.

Update doc and code regarding restic
4 participants