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

support OVF file upload besides ova #323

Merged
merged 6 commits into from
Aug 24, 2020
Merged

Conversation

guo1017138
Copy link

close #322
The added logic will check the file is ovf or not. if it is OVF, will skip unpack step and will check if it depend disk exists or not.
Signed-off-by: Guo, Larry (NSB - CN/Qingdao) [email protected]

IMPORTANT

To help us process your pull request efficiently, please follow the
guidelines shown below.

A Pull Request should be associated with an Issue

We wish to have discussions in Issues. A single issue may be targeted by multiple PRs.
If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues,
and potentially we'll be able to point development in a particular direction.

We accept PRs without associated issues provided the change is sufficiently evident
from the commit message. If you have typos or simple bug fixes go for it.

Description

Related issue: (<URL or #NUMBER of your Issue>)

  • (Required) Short description of changes in the PR subject

  • (Required) Detailed description of changes include tests and
    documentation. If the pull request contains multiple commits with
    detailed messages, refer to those instead

  • (Optional) Names of reviewers using @ sign + name

@vmwclabot
Copy link
Member

@guo1017138, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

@vmwclabot
Copy link
Member

@guo1017138, VMware has approved your signed contributor license agreement.

@lvirbalas lvirbalas requested a review from vbauzys July 20, 2020 10:19
@vbauzys
Copy link
Contributor

vbauzys commented Jul 20, 2020

Thank you for your improvements. To fully review it and accept we require new functionality to have tests.
It would be nice to have test which verifies OVF uppload. We can have in github folder with files in test-resource for it. Would be nice if files would be as small as possible. Similar we have with OVA.

@guo1017138
Copy link
Author

I will add test case ASAP. Thanks.

@guo1017138
Copy link
Author

@vbauzysvmware , I've add test case for OVF file (contents from untar ova), please help to review again and give comments if any

Copy link
Contributor

@vbauzys vbauzys left a comment

Choose a reason for hiding this comment

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

Overall looks good, test passed.
One issue is that after test run, test resources files are missing:

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	deleted:    ../test-resources/test_vapp_template_ovf/descriptor.ovf
	deleted:    ../test-resources/test_vapp_template_ovf/vm-20b41fa7-3212-4faf-9295-045d0bc49783-disk-0.vmdk

After these is fixed, I all for other to review/approve.

@guo1017138 guo1017138 force-pushed the ovfadd branch 2 times, most recently from 7752a7a to 7605725 Compare August 3, 2020 01:51
@guo1017138 guo1017138 requested a review from vbauzys August 3, 2020 01:54
@guo1017138
Copy link
Author

Overall looks good, test passed.
One issue is that after test run, test resources files are missing:

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	deleted:    ../test-resources/test_vapp_template_ovf/descriptor.ovf
	deleted:    ../test-resources/test_vapp_template_ovf/vm-20b41fa7-3212-4faf-9295-045d0bc49783-disk-0.vmdk

After these is fixed, I all for other to review/approve.

Add logic check, if this is origin OVF folder directly, won't delete. If it is not OVF folder(means extracted folder from OVA), keep old logic to delete
Add fixed the suggestion changes.
Please help to review again.

@vbauzys
Copy link
Contributor

vbauzys commented Aug 3, 2020

Overall looks good, test passed.
One issue is that after test run, test resources files are missing:

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	deleted:    ../test-resources/test_vapp_template_ovf/descriptor.ovf
	deleted:    ../test-resources/test_vapp_template_ovf/vm-20b41fa7-3212-4faf-9295-045d0bc49783-disk-0.vmdk

After these is fixed, I all for other to review/approve.

Add logic check, if this is origin OVF folder directly, won't delete. If it is not OVF folder(means extracted folder from OVA), keep old logic to delete
Add fixed the suggestion changes.
Please help to review again.

Thank you.
Verified with 9.5 and 10.1 versions.

Only changelog input is needed now and from my side everything is good. @dataclouder @lvirbalas @Didainius - please review also.

Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

Hello,

Please add a detailed message to CHANGELOG.md :)

@guo1017138
Copy link
Author

Thank you all for the review. change log is added in my latest commit.

Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

Small suggestion in-line.

BTW, please commit changes in a separate commit. We are squashing them before merging the PR either way, and it's only possible to understand what was changed after a discussion when separate commits are used.

Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

@vbauzysvmware confirmed that pulling in this go-vcloud-director build Terraform provider is able to upload OVFs without changes. Thanks for contribution! Waiting for review from @Didainius and @dataclouder next.

Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Contributor

@dataclouder dataclouder left a comment

Choose a reason for hiding this comment

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

Overall, it looks good.
There is an error in the test that needs to be fixed.
Apart from that, I would like to know the provenance of the test OVF (for future reference)

@guo1017138 guo1017138 requested a review from dataclouder August 17, 2020 06:31
Copy link
Contributor

@dataclouder dataclouder left a comment

Choose a reason for hiding this comment

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

I am waiting for the info on the testing OVF provenance.
Another thing that worries me is that some tests are failing, such as

Running: TestVCD.Test_UploadOvf_ShowUploadProgress_works
catalog_test.go:230:
    check.Assert(string(result), Matches, ".*Upload progress 100.00%")
... value string = "Waiting...\rUpload progress 0.00%\rUpload progress 100.00%\n"
... regex string = ".*Upload progress 100.00%"

FAIL: catalog_test.go:202: TestVCD.Test_UploadOvf_ShowUploadProgress_works

I wasn't able to find the root cause. However, using the repository from July 15 the failing tests succeed, and fails with the current HEAD.

@guo1017138 guo1017138 requested a review from dataclouder August 18, 2020 01:42
Guo, Larry (NSB - CN/Qingdao) added 6 commits August 20, 2020 08:56
Signed-off-by: Guo, Larry (NSB - CN/Qingdao) <[email protected]>
Support upload ovf which has ovf:size specified for each dependency file
ShowUploadProgress can exit whenever task stop, such like cancel on GUI
Return status directly for reponse code 400 and 416 due to no body

Signed-off-by: Guo, Larry (NSB - CN/Qingdao) <[email protected]>
ovaPath is a variable now instead of a hardcode checking

Signed-off-by: Guo, Larry (NSB - CN/Qingdao) <[email protected]>
Signed-off-by: Guo, Larry (NSB - CN/Qingdao) <[email protected]>
Signed-off-by: Guo, Larry (NSB - CN/Qingdao) <[email protected]>
@guo1017138
Copy link
Author

Rebase done to resolve conflict.

@Didainius Didainius merged commit bc933b6 into vmware:master Aug 24, 2020
@Didainius
Copy link
Collaborator

@guo1017138 ,
Thanks for your PR. This is now merged and tagged v2.9.0-alpha.3 of you need to pick it up immediately.

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.

support ovf file besides ova in UploadOvf function
6 participants