mirror of https://github.com/k3s-io/k3s
Fix e2e_node for changes to /api/compute/v0.beta package
parent
c5f672a0d5
commit
a0e95f9475
|
@ -369,7 +369,7 @@ func getImageMetadata(input string) *compute.Metadata {
|
|||
val := v
|
||||
metadataItems = append(metadataItems, &compute.MetadataItems{
|
||||
Key: k,
|
||||
Value: val,
|
||||
Value: &val,
|
||||
})
|
||||
}
|
||||
ret := compute.Metadata{Items: metadataItems}
|
||||
|
@ -540,10 +540,11 @@ func createInstance(imageConfig *internalGCEImage) (string, error) {
|
|||
|
||||
for _, accelerator := range imageConfig.resources.Accelerators {
|
||||
if i.GuestAccelerators == nil {
|
||||
autoRestart := true
|
||||
i.GuestAccelerators = []*compute.AcceleratorConfig{}
|
||||
i.Scheduling = &compute.Scheduling{
|
||||
OnHostMaintenance: "TERMINATE",
|
||||
AutomaticRestart: true,
|
||||
AutomaticRestart: &autoRestart,
|
||||
}
|
||||
}
|
||||
aType := fmt.Sprintf(acceleratorTypeResourceFormat, *project, *zone, accelerator.Type)
|
||||
|
@ -627,7 +628,7 @@ func isCloudInitUsed(metadata *compute.Metadata) bool {
|
|||
return false
|
||||
}
|
||||
for _, item := range metadata.Items {
|
||||
if item.Key == "user-data" && strings.HasPrefix(item.Value, "#cloud-config") {
|
||||
if item.Key == "user-data" && item.Value != nil && strings.HasPrefix(*item.Value, "#cloud-config") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue