Skip to content

Commit cf17370

Browse files
authored
New tool versions.py to manage versions.tf/tofu (#2803)
* Add provider_metadata to all modules * Fix linting version check * Another way * Fix syntax * Add fabric prefix to all provider meta * Fix linting.yml
1 parent 9723cc2 commit cf17370

File tree

198 files changed

+1479
-201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+1479
-201
lines changed

.github/workflows/linting.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -105,18 +105,18 @@ jobs:
105105
- name: Check modules versions
106106
id: versions
107107
run: |
108-
OUTPUT_TF=$(find . -type f -name 'versions.tf' -exec diff -ub default-versions.tf {} \;)
108+
OUTPUT_TF=$(find . -type f -name 'versions.tf' -exec diff -I '[[:space:]]*module_name' -ub default-versions.tf {} \;)
109109
if [[ -n "${OUTPUT_TF}" ]] ; then
110110
echo "Terraform versions.tf:"
111111
echo "${OUTPUT_TF}"
112112
fi
113-
OUTPUT_TOFU=$(find . -type f -name 'versions.tofu' -exec diff -ub default-versions.tofu {} \;)
113+
OUTPUT_TOFU=$(find . -type f -name 'versions.tofu' -exec diff -I '[[:space:]]*module_name' -ub default-versions.tofu {} \;)
114114
if [[ -n "${OUTPUT_TOFU}" ]] ; then
115115
echo "Terraform versions.tofu:"
116116
echo "${OUTPUT_TOFU}"
117117
fi
118-
grep -v required_version default-versions.tf > /tmp/versions.tf
119-
grep -v required_version default-versions.tofu > /tmp/versions.tofu
118+
egrep -v "(required_version|module_name)" default-versions.tf > /tmp/versions.tf
119+
egrep -v "(required_version|module_name)" default-versions.tofu > /tmp/versions.tofu
120120
diff -rub /tmp/versions.tf /tmp/versions.tofu
121121
DIFF_EC=$?
122122
[[ "${DIFF_EC}" -eq "0" || -z "${OUTPUT_TF}" || -z "${OUTPUT_TOFU}" ]]

blueprints/gke/patterns/autopilot-cluster/versions.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,4 +26,10 @@ terraform {
2626
version = ">= 6.13.0, < 7.0.0" # tftest
2727
}
2828
}
29+
provider_meta "google" {
30+
module_name = "fabric:tf:blueprints/gke/patterns/autopilot-cluster:v36.0.1"
31+
}
32+
provider_meta "google-beta" {
33+
module_name = "fabric:tf:blueprints/gke/patterns/autopilot-cluster:v36.0.1"
34+
}
2935
}

blueprints/gke/patterns/autopilot-cluster/versions.tofu

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,4 +26,10 @@ terraform {
2626
version = ">= 6.13.0, < 7.0.0" # tftest
2727
}
2828
}
29+
provider_meta "google" {
30+
module_name = "fabric:tofu:blueprints/gke/patterns/autopilot-cluster:v36.0.1"
31+
}
32+
provider_meta "google-beta" {
33+
module_name = "fabric:tofu:blueprints/gke/patterns/autopilot-cluster:v36.0.1"
34+
}
2935
}

blueprints/gke/patterns/batch/versions.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,4 +26,10 @@ terraform {
2626
version = ">= 6.13.0, < 7.0.0" # tftest
2727
}
2828
}
29+
provider_meta "google" {
30+
module_name = "fabric:tf:blueprints/gke/patterns/batch:v36.0.1"
31+
}
32+
provider_meta "google-beta" {
33+
module_name = "fabric:tf:blueprints/gke/patterns/batch:v36.0.1"
34+
}
2935
}

blueprints/gke/patterns/batch/versions.tofu

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,4 +26,10 @@ terraform {
2626
version = ">= 6.13.0, < 7.0.0" # tftest
2727
}
2828
}
29+
provider_meta "google" {
30+
module_name = "fabric:tofu:blueprints/gke/patterns/batch:v36.0.1"
31+
}
32+
provider_meta "google-beta" {
33+
module_name = "fabric:tofu:blueprints/gke/patterns/batch:v36.0.1"
34+
}
2935
}

blueprints/gke/patterns/kafka/versions.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,4 +26,10 @@ terraform {
2626
version = ">= 6.13.0, < 7.0.0" # tftest
2727
}
2828
}
29+
provider_meta "google" {
30+
module_name = "fabric:tf:blueprints/gke/patterns/kafka:v36.0.1"
31+
}
32+
provider_meta "google-beta" {
33+
module_name = "fabric:tf:blueprints/gke/patterns/kafka:v36.0.1"
34+
}
2935
}

blueprints/gke/patterns/kafka/versions.tofu

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,4 +26,10 @@ terraform {
2626
version = ">= 6.13.0, < 7.0.0" # tftest
2727
}
2828
}
29+
provider_meta "google" {
30+
module_name = "fabric:tofu:blueprints/gke/patterns/kafka:v36.0.1"
31+
}
32+
provider_meta "google-beta" {
33+
module_name = "fabric:tofu:blueprints/gke/patterns/kafka:v36.0.1"
34+
}
2935
}

blueprints/gke/patterns/kong-cloudrun/versions.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,4 +26,10 @@ terraform {
2626
version = ">= 6.13.0, < 7.0.0" # tftest
2727
}
2828
}
29+
provider_meta "google" {
30+
module_name = "fabric:tf:blueprints/gke/patterns/kong-cloudrun:v36.0.1"
31+
}
32+
provider_meta "google-beta" {
33+
module_name = "fabric:tf:blueprints/gke/patterns/kong-cloudrun:v36.0.1"
34+
}
2935
}

blueprints/gke/patterns/kong-cloudrun/versions.tofu

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,4 +26,10 @@ terraform {
2626
version = ">= 6.13.0, < 7.0.0" # tftest
2727
}
2828
}
29+
provider_meta "google" {
30+
module_name = "fabric:tofu:blueprints/gke/patterns/kong-cloudrun:v36.0.1"
31+
}
32+
provider_meta "google-beta" {
33+
module_name = "fabric:tofu:blueprints/gke/patterns/kong-cloudrun:v36.0.1"
34+
}
2935
}

blueprints/gke/patterns/mysql/versions.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,4 +26,10 @@ terraform {
2626
version = ">= 6.13.0, < 7.0.0" # tftest
2727
}
2828
}
29+
provider_meta "google" {
30+
module_name = "fabric:tf:blueprints/gke/patterns/mysql:v36.0.1"
31+
}
32+
provider_meta "google-beta" {
33+
module_name = "fabric:tf:blueprints/gke/patterns/mysql:v36.0.1"
34+
}
2935
}

0 commit comments

Comments
 (0)