Skip to content

Commit

Permalink
Merge pull request #1902 from maqiuyujoyce/202405-update-accelerator-…
Browse files Browse the repository at this point in the history
…type

Change the accelerate type 'nvidia-tesla-k80' as it's no longer supported
  • Loading branch information
google-oss-prow[bot] authored May 29, 2024
2 parents bbdd7e2 + 3a99017 commit e2ca7bc
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ spec:
type: integer
type:
description: Immutable. The accelerator type resource exposed
to this instance. E.g. nvidia-tesla-k80.
to this instance. E.g. nvidia-tesla-t4.
type: string
required:
- count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ spec:
type: integer
type:
description: Immutable. The accelerator type resource to expose
to this instance. E.g. nvidia-tesla-k80.
to this instance. E.g. nvidia-tesla-t4.
type: string
required:
- count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
- compute-ro
- storage-ro
guestAccelerator:
- type: nvidia-tesla-k80
- type: nvidia-tesla-t4
count: 1
minCpuPlatform: "Intel Skylake"
shieldedInstanceConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
- "https://www.googleapis.com/auth/logging.write"
- "https://www.googleapis.com/auth/monitoring"
guestAccelerator:
- type: "nvidia-tesla-k80"
- type: "nvidia-tesla-t4"
count: 1
metadata:
disable-legacy-endpoints: "true"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ zone: string
</td>
<td>
<p><code class="apitype">string</code></p>
<p>{% verbatim %}Immutable. The accelerator type resource exposed to this instance. E.g. nvidia-tesla-k80.{% endverbatim %}</p>
<p>{% verbatim %}Immutable. The accelerator type resource exposed to this instance. E.g. nvidia-tesla-t4.{% endverbatim %}</p>
</td>
</tr>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ local SSD.{% endverbatim %}</p>
</td>
<td>
<p><code class="apitype">string</code></p>
<p>{% verbatim %}Immutable. The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80.{% endverbatim %}</p>
<p>{% verbatim %}Immutable. The accelerator type resource to expose to this instance. E.g. nvidia-tesla-t4.{% endverbatim %}</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -2053,7 +2053,7 @@ spec:
- compute-ro
- storage-ro
guestAccelerator:
- type: nvidia-tesla-k80
- type: nvidia-tesla-t4
count: 1
minCpuPlatform: "Intel Skylake"
shieldedInstanceConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,7 @@ spec:
- "https://www.googleapis.com/auth/logging.write"
- "https://www.googleapis.com/auth/monitoring"
guestAccelerator:
- type: "nvidia-tesla-k80"
- type: "nvidia-tesla-t4"
count: 1
metadata:
disable-legacy-endpoints: "true"
Expand Down
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 e2ca7bc

Please sign in to comment.