Files
Packer-Cn/builder/googlecompute/image.go
T

36 lines
645 B
Go
Raw Normal View History

package googlecompute
import (
"strings"
2020-03-30 15:05:16 +02:00
compute "google.golang.org/api/compute/v1"
)
type Image struct {
2020-03-30 15:05:16 +02:00
GuestOsFeatures []*compute.GuestOsFeature
Labels map[string]string
Licenses []string
Name string
ProjectId string
SelfLink string
SizeGb int64
}
func (i *Image) IsWindows() bool {
for _, license := range i.Licenses {
if strings.Contains(license, "windows") {
return true
}
}
return false
}
2020-03-30 15:05:16 +02:00
func (i *Image) IsSecureBootCompatible() bool {
for _, osFeature := range i.GuestOsFeatures {
if osFeature.Type == "UEFI_COMPATIBLE" {
2020-03-30 15:05:16 +02:00
return true
}
}
return false
}