Skip to content

Use the v2alpha1 Cloud TPU API version in the google-beta Terraform provider #9131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading