Skip to content

Commit

Permalink
Update third_party/ directory to change the EOL accelerator type 'nvi…
Browse files Browse the repository at this point in the history
…dia-tesla-k80'
  • Loading branch information
maqiuyujoyce committed May 29, 2024
1 parent a4c2af8 commit f2811e6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ func ResourceComputeInstance() *schema.Resource {
Required: true,
ForceNew: true,
DiffSuppressFunc: tpgresource.CompareSelfLinkOrResourceName,
Description: `The accelerator type resource exposed to this instance. E.g. nvidia-tesla-k80.`,
Description: `The accelerator type resource exposed to this instance. E.g. nvidia-tesla-t4.`,
},
},
},
Expand Down Expand Up @@ -2428,7 +2428,7 @@ func expandInstanceGuestAccelerators(d tpgresource.TerraformResourceData, config
// After reconciling the desired and actual state, we would otherwise see a
// perpetual diff resembling:
//
// [] != [{"count":0, "type": "nvidia-tesla-k80"}]
// [] != [{"count":0, "type": "nvidia-tesla-t4"}]
func suppressEmptyGuestAcceleratorDiff(_ context.Context, d *schema.ResourceDiff, meta interface{}) error {
oldi, newi := d.GetChange("guest_accelerator")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ be from 0 to 999,999,999 inclusive.`,
Required: true,
ForceNew: true,
DiffSuppressFunc: tpgresource.CompareSelfLinkOrResourceName,
Description: `The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80.`,
Description: `The accelerator type resource to expose to this instance. E.g. nvidia-tesla-t4.`,
},
},
},
Expand Down Expand Up @@ -1201,8 +1201,8 @@ func buildDisks(d *schema.ResourceData, config *transport_tpg.Config) ([]*comput
//
// Using a partial URL on an instance template results in:
// Invalid value for field 'resource.properties.guestAccelerators[0].acceleratorType':
// 'zones/us-east1-b/acceleratorTypes/nvidia-tesla-k80'.
// Accelerator type 'zones/us-east1-b/acceleratorTypes/nvidia-tesla-k80'
// 'zones/us-east1-b/acceleratorTypes/nvidia-tesla-t4'.
// Accelerator type 'zones/us-east1-b/acceleratorTypes/nvidia-tesla-t4'
// must be a valid resource name (not an url).
func expandInstanceTemplateGuestAccelerators(d tpgresource.TerraformResourceData, config *transport_tpg.Config) []*compute.AcceleratorConfig {
configs, ok := d.GetOk("guest_accelerator")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ func TestAccComputeInstanceTemplate_guestAccelerator(t *testing.T) {
Config: testAccComputeInstanceTemplate_guestAccelerator(acctest.RandString(t, 10), 1),
Check: resource.ComposeTestCheckFunc(
testAccCheckComputeInstanceTemplateExists(t, "google_compute_instance_template.foobar", &instanceTemplate),
testAccCheckComputeInstanceTemplateHasGuestAccelerator(&instanceTemplate, "nvidia-tesla-k80", 1),
testAccCheckComputeInstanceTemplateHasGuestAccelerator(&instanceTemplate, "nvidia-tesla-t4", 1),
),
},
{
Expand Down Expand Up @@ -2554,7 +2554,7 @@ resource "google_compute_instance_template" "foobar" {
guest_accelerator {
count = %d
type = "nvidia-tesla-k80"
type = "nvidia-tesla-t4"
}
}
`, i, count)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ func TestAccComputeInstance_guestAccelerator(t *testing.T) {
Config: testAccComputeInstance_guestAccelerator(instanceName, 1),
Check: resource.ComposeTestCheckFunc(
testAccCheckComputeInstanceExists(t, "google_compute_instance.foobar", &instance),
testAccCheckComputeInstanceHasGuestAccelerator(&instance, "nvidia-tesla-k80", 1),
testAccCheckComputeInstanceHasGuestAccelerator(&instance, "nvidia-tesla-t4", 1),
),
},
computeInstanceImportStep("us-east1-d", instanceName, []string{"metadata.baz", "metadata.foo"}),
Expand Down Expand Up @@ -5624,7 +5624,7 @@ resource "google_compute_instance" "foobar" {
guest_accelerator {
count = %d
type = "nvidia-tesla-k80"
type = "nvidia-tesla-t4"
}
}
`, instance, count)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ be from 0 to 999,999,999 inclusive.`,
Required: true,
ForceNew: true,
DiffSuppressFunc: tpgresource.CompareSelfLinkOrResourceName,
Description: `The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80.`,
Description: `The accelerator type resource to expose to this instance. E.g. nvidia-tesla-t4.`,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ func TestAccComputeRegionInstanceTemplate_guestAccelerator(t *testing.T) {
Config: testAccComputeRegionInstanceTemplate_guestAccelerator(acctest.RandString(t, 10), 1),
Check: resource.ComposeTestCheckFunc(
testAccCheckComputeRegionInstanceTemplateExists(t, "google_compute_region_instance_template.foobar", &instanceTemplate),
testAccCheckComputeRegionInstanceTemplateHasGuestAccelerator(&instanceTemplate, "nvidia-tesla-k80", 1),
testAccCheckComputeRegionInstanceTemplateHasGuestAccelerator(&instanceTemplate, "nvidia-tesla-t4", 1),
),
},
{
Expand Down Expand Up @@ -2458,7 +2458,7 @@ resource "google_compute_region_instance_template" "foobar" {
guest_accelerator {
count = %d
type = "nvidia-tesla-k80"
type = "nvidia-tesla-t4"
}
}
`, i, count)
Expand Down

0 comments on commit f2811e6

Please sign in to comment.