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

VM Image Controller, Webhook and Download/Upload Refactor for Various Backend Support #7170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WebberHuang1118
Copy link
Member

@WebberHuang1118 WebberHuang1118 commented Dec 16, 2024

Code Structure:

  • Backend interfaces:
    • pkg/image/backend
  • Common VM Image operation package
    • pkg/image/common
  • Backing image implementation
    • pkg/image/backingimage
  • CDI implementation skeleton
    • pkg/image/cdi

Problem:
VM Image should support various source backend

Solution:
Enhance VM Image implementation to have a clear interface for different image backend

Related Issue:
#6936

Test plan:

  • Prerequisites
    • Building Harvester Cluster with the master-head branch ( 0cea310be669040bc682c75edd40fd6f81051bce in my env)
    • Updating VirtualMachineImage CRD
      • $ kubectl apply -f deploy/charts/harvester-crd/templates/harvesterhci.io_virtualmachineimages.yaml
    • Updating harvester deployment with this PR
    • Updating harvester-webhook deployment with this PR
  • Case 1: Creating VM image with upload
    • Uploading an OS image file from local
    • Checking the VM image could progress to the completed status
    • Creating a VM with the VM image
  • Case 2: Creating VM image with download
    • Downloading an OS image file from a certain URL
    • Checking the VM image could progress to the completed status
    • Creating a VM with the VM image
  • Case 3: Creating VM image with export
    • Creating a volume with an existing OS VM Image
    • Exporting the volume as a new image
    • Checking the exported VM image could progress to the completed status
    • Creating a VM with the VM image
  • Case 4: VM Image encryption
    • Creating a secret and sc for encryption
    • Creating an encrypted VM image from an existing VM image (non-encrypted)
    • Checking the encrypted VM image could progress to the completed status
    • Creating a VM with the VM image
  • Case 5: VM Image decryption
    • Continuing from the above steps
    • Creating a VM image by decrypting the encrypted VM image
    • Checking the decrypted VM image could progress to the completed status
    • Creating a VM with the VM image
  • Case 6: VM Image Downloading
    • Triggering downloading an existing VM image
    • The VM image should downloaded as a compressed file

** Additional Context **
Since the VM image implementation has the new interfaces, the original unit testing is not applicable and removed. Creating a separate ticket to track the unit testing implementation #7204

@WebberHuang1118 WebberHuang1118 marked this pull request as draft December 16, 2024 07:46
@WebberHuang1118 WebberHuang1118 force-pushed the issue-6936 branch 4 times, most recently from 4301f89 to 875df5f Compare December 18, 2024 08:54
…d for various backend support

Signed-off-by: Webber Huang <[email protected]>
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.

1 participant