Skip to content

Commit 765e198

Browse files
feat: [google-cloud-config] Infrastructure manager supports 1.2.3, 1.3.10, 1.4.7, 1.5.7 versions of Terraform when creating a preview of a deployment (#12624)
BEGIN_COMMIT_OVERRIDE feat: Infrastructure manager supports 1.2.3, 1.3.10, 1.4.7, 1.5.7 versions of Terraform when creating a preview of a deployment feat: Annotations are now supported to help client tools identify deployments during automation END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. feat: Annotations are now supported to help client tools identify deployments during automation PiperOrigin-RevId: 627386467 Source-Link: googleapis/googleapis@64be76a Source-Link: googleapis/googleapis-gen@0491a38 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbmZpZy8uT3dsQm90LnlhbWwiLCJoIjoiMDQ5MWEzOGU3MjdmYmY0ODA4NzUyZjJhM2YxMDIzMjU0ODg2MzVjZSJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <omairnaveed@ymail.com>
1 parent 5c373f6 commit 765e198

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

packages/google-cloud-config/google/cloud/config_v1/types/config.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ class Deployment(proto.Message):
219219
resources in terraform configuration files.
220220
There are limited resources on which quota
221221
validation applies.
222+
annotations (MutableMapping[str, str]):
223+
Optional. Arbitrary key-value metadata
224+
storage e.g. to help client tools identify
225+
deployments during automation. See
226+
https://google.aip.dev/148#annotations for
227+
details on format and size limitations.
222228
"""
223229

224230
class State(proto.Enum):
@@ -419,6 +425,11 @@ class LockState(proto.Enum):
419425
number=23,
420426
enum="QuotaValidation",
421427
)
428+
annotations: MutableMapping[str, str] = proto.MapField(
429+
proto.STRING,
430+
proto.STRING,
431+
number=24,
432+
)
422433

423434

424435
class TerraformBlueprint(proto.Message):
@@ -2013,6 +2024,15 @@ class Preview(proto.Message):
20132024
logs (str):
20142025
Output only. Location of preview logs in
20152026
``gs://{bucket}/{object}`` format.
2027+
tf_version (str):
2028+
Output only. The current Terraform version
2029+
set on the preview. It is in the format of
2030+
"Major.Minor.Patch", for example, "1.3.10".
2031+
tf_version_constraint (str):
2032+
Optional. The user-specified Terraform
2033+
version constraint. Example: "=1.3.10".
2034+
2035+
This field is a member of `oneof`_ ``_tf_version_constraint``.
20162036
"""
20172037

20182038
class State(proto.Enum):
@@ -2182,6 +2202,15 @@ class ErrorCode(proto.Enum):
21822202
proto.STRING,
21832203
number=17,
21842204
)
2205+
tf_version: str = proto.Field(
2206+
proto.STRING,
2207+
number=18,
2208+
)
2209+
tf_version_constraint: str = proto.Field(
2210+
proto.STRING,
2211+
number=19,
2212+
optional=True,
2213+
)
21852214

21862215

21872216
class PreviewOperationMetadata(proto.Message):

packages/google-cloud-config/tests/unit/gapic/config_v1/test_config.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6652,6 +6652,8 @@ def test_get_preview(request_type, transport: str = "grpc"):
66526652
build="build_value",
66536653
error_logs="error_logs_value",
66546654
logs="logs_value",
6655+
tf_version="tf_version_value",
6656+
tf_version_constraint="tf_version_constraint_value",
66556657
)
66566658
response = client.get_preview(request)
66576659

@@ -6674,6 +6676,8 @@ def test_get_preview(request_type, transport: str = "grpc"):
66746676
assert response.build == "build_value"
66756677
assert response.error_logs == "error_logs_value"
66766678
assert response.logs == "logs_value"
6679+
assert response.tf_version == "tf_version_value"
6680+
assert response.tf_version_constraint == "tf_version_constraint_value"
66776681

66786682

66796683
def test_get_preview_empty_call():
@@ -6742,6 +6746,8 @@ async def test_get_preview_empty_call_async():
67426746
build="build_value",
67436747
error_logs="error_logs_value",
67446748
logs="logs_value",
6749+
tf_version="tf_version_value",
6750+
tf_version_constraint="tf_version_constraint_value",
67456751
)
67466752
)
67476753
response = await client.get_preview()
@@ -6779,6 +6785,8 @@ async def test_get_preview_async(
67796785
build="build_value",
67806786
error_logs="error_logs_value",
67816787
logs="logs_value",
6788+
tf_version="tf_version_value",
6789+
tf_version_constraint="tf_version_constraint_value",
67826790
)
67836791
)
67846792
response = await client.get_preview(request)
@@ -6802,6 +6810,8 @@ async def test_get_preview_async(
68026810
assert response.build == "build_value"
68036811
assert response.error_logs == "error_logs_value"
68046812
assert response.logs == "logs_value"
6813+
assert response.tf_version == "tf_version_value"
6814+
assert response.tf_version_constraint == "tf_version_constraint_value"
68056815

68066816

68076817
@pytest.mark.asyncio
@@ -9421,6 +9431,7 @@ def test_create_deployment_rest(request_type):
94219431
"tf_version_constraint": "tf_version_constraint_value",
94229432
"tf_version": "tf_version_value",
94239433
"quota_validation": 1,
9434+
"annotations": {},
94249435
}
94259436
# The version of a generated dependency at test runtime may differ from the version used during generation.
94269437
# Delete any fields which are not present in the current runtime dependency
@@ -9844,6 +9855,7 @@ def test_update_deployment_rest(request_type):
98449855
"tf_version_constraint": "tf_version_constraint_value",
98459856
"tf_version": "tf_version_value",
98469857
"quota_validation": 1,
9858+
"annotations": {},
98479859
}
98489860
# The version of a generated dependency at test runtime may differ from the version used during generation.
98499861
# Delete any fields which are not present in the current runtime dependency
@@ -13520,6 +13532,8 @@ def test_create_preview_rest(request_type):
1352013532
"artifacts": "artifacts_value",
1352113533
},
1352213534
"logs": "logs_value",
13535+
"tf_version": "tf_version_value",
13536+
"tf_version_constraint": "tf_version_constraint_value",
1352313537
}
1352413538
# The version of a generated dependency at test runtime may differ from the version used during generation.
1352513539
# Delete any fields which are not present in the current runtime dependency
@@ -13888,6 +13902,8 @@ def test_get_preview_rest(request_type):
1388813902
build="build_value",
1388913903
error_logs="error_logs_value",
1389013904
logs="logs_value",
13905+
tf_version="tf_version_value",
13906+
tf_version_constraint="tf_version_constraint_value",
1389113907
)
1389213908

1389313909
# Wrap the value into a proper Response obj
@@ -13914,6 +13930,8 @@ def test_get_preview_rest(request_type):
1391413930
assert response.build == "build_value"
1391513931
assert response.error_logs == "error_logs_value"
1391613932
assert response.logs == "logs_value"
13933+
assert response.tf_version == "tf_version_value"
13934+
assert response.tf_version_constraint == "tf_version_constraint_value"
1391713935

1391813936

1391913937
def test_get_preview_rest_required_fields(request_type=config.GetPreviewRequest):

0 commit comments

Comments
 (0)