Skip to content

Commit

Permalink
Use the v2alpha1 Cloud TPU API version in the google-beta Terraform p…
Browse files Browse the repository at this point in the history
…rovider (#12844) (#9131)

[upstream:a79573edd6ca3d8cb4f426bf629758ab4382956f]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jan 23, 2025
1 parent 4191fff commit ad13914
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .changelog/12844.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:note
tpuv2: used the v2alpha1 Cloud TPU API version in the google-beta provider.
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource: 'google_tpu_v2_queued_resource'
generation_type: 'mmv1'
api_service_name: 'tpu.googleapis.com'
api_version: 'v2'
api_version: 'v2alpha1'
api_resource_type_kind: 'QueuedResource'
fields:
- field: 'name'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func testSweepTpuV2QueuedResource(region string) error {
},
}

listTemplate := strings.Split("https://tpu.googleapis.com/v2/projects/{{project}}/locations/{{zone}}/queuedResources", "?")[0]
listTemplate := strings.Split("https://tpu.googleapis.com/v2alpha1/projects/{{project}}/locations/{{zone}}/queuedResources", "?")[0]
listUrl, err := tpgresource.ReplaceVars(d, config, listTemplate)
if err != nil {
log.Printf("[INFO][SWEEPER_LOG] error preparing sweeper list url: %s", err)
Expand Down Expand Up @@ -108,7 +108,7 @@ func testSweepTpuV2QueuedResource(region string) error {
continue
}

deleteTemplate := "https://tpu.googleapis.com/v2/projects/{{project}}/locations/{{zone}}/queuedResources/{{name}}"
deleteTemplate := "https://tpu.googleapis.com/v2alpha1/projects/{{project}}/locations/{{zone}}/queuedResources/{{name}}"
deleteUrl, err := tpgresource.ReplaceVars(d, config, deleteTemplate)
if err != nil {
log.Printf("[INFO][SWEEPER_LOG] error preparing delete url: %s", err)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource: 'google_tpu_v2_vm'
generation_type: 'mmv1'
api_service_name: 'tpu.googleapis.com'
api_version: 'v2'
api_version: 'v2alpha1'
api_resource_type_kind: 'Node'
fields:
- field: 'accelerator_config.topology'
Expand Down
4 changes: 2 additions & 2 deletions google-beta/services/tpuv2/resource_tpu_v2_vm_sweeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func testSweepTpuV2Vm(region string) error {
},
}

listTemplate := strings.Split("https://tpu.googleapis.com/v2/projects/{{project}}/locations/{{zone}}/nodes", "?")[0]
listTemplate := strings.Split("https://tpu.googleapis.com/v2alpha1/projects/{{project}}/locations/{{zone}}/nodes", "?")[0]
listUrl, err := tpgresource.ReplaceVars(d, config, listTemplate)
if err != nil {
log.Printf("[INFO][SWEEPER_LOG] error preparing sweeper list url: %s", err)
Expand Down Expand Up @@ -108,7 +108,7 @@ func testSweepTpuV2Vm(region string) error {
continue
}

deleteTemplate := "https://tpu.googleapis.com/v2/projects/{{project}}/locations/{{zone}}/nodes/{{name}}"
deleteTemplate := "https://tpu.googleapis.com/v2alpha1/projects/{{project}}/locations/{{zone}}/nodes/{{name}}"
deleteUrl, err := tpgresource.ReplaceVars(d, config, deleteTemplate)
if err != nil {
log.Printf("[INFO][SWEEPER_LOG] error preparing delete url: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion google-beta/transport/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ var DefaultBasePaths = map[string]string{
StorageTransferBasePathKey: "https://storagetransfer.googleapis.com/v1/",
TagsBasePathKey: "https://cloudresourcemanager.googleapis.com/v3/",
TPUBasePathKey: "https://tpu.googleapis.com/v1/",
TpuV2BasePathKey: "https://tpu.googleapis.com/v2/",
TpuV2BasePathKey: "https://tpu.googleapis.com/v2alpha1/",
TranscoderBasePathKey: "https://transcoder.googleapis.com/v1/",
VertexAIBasePathKey: "https://{{region}}-aiplatform.googleapis.com/v1beta1/",
VmwareengineBasePathKey: "https://vmwareengine.googleapis.com/v1/",
Expand Down

0 comments on commit ad13914

Please sign in to comment.