Skip to content

Commit

Permalink
secure boot needs smm feature state
Browse files Browse the repository at this point in the history
fixed dapper builds and default bus type on vmware
  • Loading branch information
ibrokethecloud committed Jun 12, 2024
1 parent 9e33784 commit fdf9e14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN export K8S_VERSION=1.24.2 && \
mkdir /usr/local/kubebuilder && \
tar -C /usr/local/kubebuilder --strip-components=1 -zvxf envtest-bins.tar.gz

RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/v1.57.1/install.sh | sh -s v1.57.1

# The docker version in dapper is too old to have buildx. Install it manually.
RUN curl -sSfL https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} -o buildx-v0.13.1.linux-${ARCH} && \
Expand Down
13 changes: 6 additions & 7 deletions pkg/source/vmware/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,13 @@ func (c *Client) GenerateVirtualMachine(vm *migration.VirtualMachineImport) (*ku
}
if *o.Config.BootOptions.EfiSecureBootEnabled {
firmware.Bootloader.EFI.SecureBoot = &boolTrue
}
vmSpec.Template.Spec.Domain.Firmware = firmware
if *o.Summary.Config.TpmPresent {
vmSpec.Template.Spec.Domain.Features.SMM = &kubevirt.FeatureState{
Enabled: &boolTrue,
}
}
vmSpec.Template.Spec.Domain.Firmware = firmware
if *o.Summary.Config.TpmPresent {

vmSpec.Template.Spec.Domain.Devices.TPM = &kubevirt.TPMDevice{}
}
}
Expand Down Expand Up @@ -445,12 +446,10 @@ func mapNetworkCards(networkCards []networkInfo, mapping []migration.NetworkMapp

// adapterType tries to identify the disk bus type from vmware
// to attempt and set correct bus types in kubevirt
// default is to switch to SATA to ensure device boots
func adapterType(deviceID string) kubevirt.DiskBus {
if strings.Contains(deviceID, "AHCI") {
return kubevirt.DiskBusSATA
}
if strings.Contains(deviceID, "SCSI") {
return kubevirt.DiskBusSCSI
}
return kubevirt.DiskBusVirtio
return kubevirt.DiskBusSATA
}

0 comments on commit fdf9e14

Please sign in to comment.