github.phpd.cn/hashicorp/packer@v1.3.2/builder/googlecompute/image.go (about)

     1  package googlecompute
     2  
     3  import (
     4  	"strings"
     5  )
     6  
     7  type Image struct {
     8  	Labels    map[string]string
     9  	Licenses  []string
    10  	Name      string
    11  	ProjectId string
    12  	SelfLink  string
    13  	SizeGb    int64
    14  }
    15  
    16  func (i *Image) IsWindows() bool {
    17  	for _, license := range i.Licenses {
    18  		if strings.Contains(license, "windows") {
    19  			return true
    20  		}
    21  	}
    22  	return false
    23  }