Skip to content

Commit

Permalink
libvirt: Reverse default firmware logic
Browse files Browse the repository at this point in the history
The packer build doesn't want a custom firmware,
so we can't easily keep the default to be ovmf.
Instead reverse the logic and set it as blank unless provided.

In order to preserve the existing behaviour set the
kustomization.yaml with the old default and update
the packer e2e testing to comment it out

Signed-off-by: stevenhorsman <[email protected]>
  • Loading branch information
stevenhorsman committed Nov 22, 2024
1 parent db9a441 commit cc94780
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/e2e_libvirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ jobs:
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | \
sudo bash -s /usr/local/bin
# For the legacy packer approach we don't want to use the default firmware, so comment it out
- name: Set blank firmware for packer libvirt tests
if: ${{ !inputs.oras }}
run: |
pushd "install/overlays/libvirt"
sed -i 's/\(- LIBVIRT_FIRMWARE=.*\)/#\1/g' kustomization.yaml
# Print for debugging
echo "::group::Kustomization.yaml"
cat kustomization.yaml
echo "::endgroup::"
popd
- name: Update kustomization configuration
run: |
pushd "install/overlays/libvirt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ configMapGenerator:
- DISABLECVM="true" # set as false to enable confidential VM
- SECURE_COMMS="false" # set as true to enable Secure Comms
- INITDATA="" # set default initdata for podvm
- LIBVIRT_FIRMWARE="/usr/share/edk2/ovmf/OVMF_CODE.fd" # Set if you want to change the firmware path, or comment to unset.
#- LIBVIRT_LAUNCH_SECURITY="" #sev or s390-pv
#- LIBVIRT_FIRMWARE="" # Uncomment and set if you want to change the firmware path. Defaults to /usr/share/edk2/ovmf/OVMF_CODE.fd
#- LIBVIRT_VOL_NAME="" # Uncomment and set if you want to use a specific volume name. Defaults to podvm-base.qcow2
#- PAUSE_IMAGE="" # Uncomment and set if you want to use a specific pause image
#- VXLAN_PORT="" # Uncomment and set if you want to use a specific vxlan port. Defaults to 4789
Expand Down
2 changes: 1 addition & 1 deletion src/cloud-providers/libvirt/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
defaultDataDir = "/var/lib/libvirt/images"
defaultVolName = "podvm-base.qcow2"
defaultLaunchSecurity = ""
defaultFirmware = "/usr/share/edk2/ovmf/OVMF_CODE.fd"
defaultFirmware = ""
)

func init() {
Expand Down

0 comments on commit cc94780

Please sign in to comment.