From 47df12d308f3a95c907dea9b1eb8fd8dfc0404de Mon Sep 17 00:00:00 2001 From: abhishek kumar tiwari Date: Tue, 7 Jan 2025 12:29:16 +0000 Subject: [PATCH] fix: add new field location in apphub_workload_uri output of mig module (#462) --- autogen/outputs.tf.tmpl | 1 + metadata.yaml | 2 +- modules/compute_disk_snapshot/metadata.yaml | 2 +- modules/compute_instance/metadata.yaml | 2 +- modules/instance_template/metadata.yaml | 2 +- modules/mig/metadata.display.yaml | 2 +- modules/mig/metadata.yaml | 5 +++-- modules/mig/outputs.tf | 1 + modules/mig_with_percent/metadata.yaml | 2 +- .../preemptible_and_regular_instance_templates/metadata.yaml | 2 +- modules/umig/metadata.yaml | 2 +- 11 files changed, 13 insertions(+), 10 deletions(-) diff --git a/autogen/outputs.tf.tmpl b/autogen/outputs.tf.tmpl index f43d0a9a..460c4c01 100644 --- a/autogen/outputs.tf.tmpl +++ b/autogen/outputs.tf.tmpl @@ -41,6 +41,7 @@ output "apphub_workload_uri" { value = { workload_uri = "//compute.googleapis.com/projects${element(split("/projects", google_compute_region_instance_group_manager.mig.instance_group), 1)}" workload_id = substr(join("-", [tostring(google_compute_region_instance_group_manager.mig.name), md5(join("-", [var.region, var.project_id]))]), 0, 63) + location = var.region } description = "Workload URI in CAIS style to be used by Apphub." } diff --git a/metadata.yaml b/metadata.yaml index 82e5eb91..43ba4436 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/modules/compute_disk_snapshot/metadata.yaml b/modules/compute_disk_snapshot/metadata.yaml index d2f1661f..b8155454 100644 --- a/modules/compute_disk_snapshot/metadata.yaml +++ b/modules/compute_disk_snapshot/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/modules/compute_instance/metadata.yaml b/modules/compute_instance/metadata.yaml index d1417175..0c5340a5 100644 --- a/modules/compute_instance/metadata.yaml +++ b/modules/compute_instance/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/modules/instance_template/metadata.yaml b/modules/instance_template/metadata.yaml index 517d1eae..bc08db0e 100644 --- a/modules/instance_template/metadata.yaml +++ b/modules/instance_template/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/modules/mig/metadata.display.yaml b/modules/mig/metadata.display.yaml index affbb014..3b979ca4 100644 --- a/modules/mig/metadata.display.yaml +++ b/modules/mig/metadata.display.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/modules/mig/metadata.yaml b/modules/mig/metadata.yaml index 8993a764..26214d66 100644 --- a/modules/mig/metadata.yaml +++ b/modules/mig/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -291,7 +291,8 @@ spec: description: Workload URI in CAIS style to be used by Apphub. type: - object - - workload_id: string + - location: string + workload_id: string workload_uri: string - name: health_check_self_links description: All self_links of healthchecks created for the instance group. diff --git a/modules/mig/outputs.tf b/modules/mig/outputs.tf index 28570b66..c8670770 100644 --- a/modules/mig/outputs.tf +++ b/modules/mig/outputs.tf @@ -40,6 +40,7 @@ output "apphub_workload_uri" { value = { workload_uri = "//compute.googleapis.com/projects${element(split("/projects", google_compute_region_instance_group_manager.mig.instance_group), 1)}" workload_id = substr(join("-", [tostring(google_compute_region_instance_group_manager.mig.name), md5(join("-", [var.region, var.project_id]))]), 0, 63) + location = var.region } description = "Workload URI in CAIS style to be used by Apphub." } diff --git a/modules/mig_with_percent/metadata.yaml b/modules/mig_with_percent/metadata.yaml index 2d1bd952..7a65da0c 100644 --- a/modules/mig_with_percent/metadata.yaml +++ b/modules/mig_with_percent/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/modules/preemptible_and_regular_instance_templates/metadata.yaml b/modules/preemptible_and_regular_instance_templates/metadata.yaml index e7d98c90..6dab9510 100644 --- a/modules/preemptible_and_regular_instance_templates/metadata.yaml +++ b/modules/preemptible_and_regular_instance_templates/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/modules/umig/metadata.yaml b/modules/umig/metadata.yaml index b63ec928..7a025100 100644 --- a/modules/umig/metadata.yaml +++ b/modules/umig/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.