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

Instance import: Use import module for alpha and beta #1497

Conversation

EricEdens
Copy link
Contributor

Following this PR, instance imports in beta and alpha will delegate import to code that is shared with gce_vm_image_import. This enables the following:

  1. Native VMDK inflation
  2. UEFI detection and tagging
  3. Pre-allocating inflation target disk with correct size
  4. Inspection of OS on boot disk (although inspection is performed, I haven't updated import_ovf to allow import when it cannot determine the OS. That will come in a future PR)

@EricEdens EricEdens force-pushed the ovf-refactor-swap-daisy-workflows branch from e2d9678 to 731414d Compare January 20, 2021 19:33
@EricEdens EricEdens requested review from zoran15 and dntczdx and removed request for adjackura and hopkiw January 20, 2021 19:37
@EricEdens EricEdens force-pushed the ovf-refactor-swap-daisy-workflows branch 2 times, most recently from aa3191d to f79dd4c Compare January 20, 2021 20:27
cli_tools/common/image/importer/bootable_disk_processor.go Outdated Show resolved Hide resolved
cli_tools/common/image/importer/inflater.go Outdated Show resolved Hide resolved
cli_tools/common/utils/logging/logger.go Outdated Show resolved Hide resolved
cli_tools/common/utils/logging/logger.go Outdated Show resolved Hide resolved
cli_tools/common/utils/param/param_utils.go Outdated Show resolved Hide resolved
cli_tools/gce_ovf_import/ovf_importer/ovf_importer.go Outdated Show resolved Hide resolved
@EricEdens EricEdens force-pushed the ovf-refactor-swap-daisy-workflows branch 2 times, most recently from bc074c8 to 730df40 Compare January 21, 2021 21:09
@EricEdens EricEdens force-pushed the ovf-refactor-swap-daisy-workflows branch from 730df40 to 7f76bc7 Compare January 21, 2021 21:24
panic(fmt.Sprintf("Invalid image name %q: %v", imageName, err))
}
if err := validation.ValidateProjectID(projectID); err != nil {
panic(fmt.Sprintf("Invalid projectID %q: %v", projectID, err))
Copy link
Contributor

Choose a reason for hiding this comment

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

what if the pre-validation logic is not working as expected? In my opinion since it's not a trivial logic, a panic is dangerous, which may prevent cleanup from executing (which I didn't test). logic in "defer" won't be executed AFAIK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You have some good points!

How does this sound?

)

// To rebuild mocks, run `go generate ./...`
//go:generate go run github.com/golang/mock/mockgen -package ovfdomainmocks -source $GOFILE -destination mocks/mock_interfaces.go
Copy link
Contributor

Choose a reason for hiding this comment

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

these 2 lines are a bit confusion to me, which cmd is needed? Or both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question!

The first ("To rebuild mocks...") is a comment for devs. The second instructs go generate on how to rebuild mocks.

More info:

@google-oss-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dntczdx, EricEdens, zoran15

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:
  • OWNERS [EricEdens,dntczdx,zoran15]

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

@EricEdens EricEdens merged commit df208b7 into GoogleCloudPlatform:master Jan 28, 2021
EricEdens added a commit that referenced this pull request Feb 4, 2021
This is a follow-up to #1497 where we refactored instance import to use import modules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants