Skip to content

Commit

Permalink
feat: [google-cloud-config] Infrastructure manager supports 1.2.3, 1.…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
3 people authored Apr 24, 2024
1 parent 5c373f6 commit 765e198
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ class Deployment(proto.Message):
resources in terraform configuration files.
There are limited resources on which quota
validation applies.
annotations (MutableMapping[str, str]):
Optional. Arbitrary key-value metadata
storage e.g. to help client tools identify
deployments during automation. See
https://google.aip.dev/148#annotations for
details on format and size limitations.
"""

class State(proto.Enum):
Expand Down Expand Up @@ -419,6 +425,11 @@ class LockState(proto.Enum):
number=23,
enum="QuotaValidation",
)
annotations: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=24,
)


class TerraformBlueprint(proto.Message):
Expand Down Expand Up @@ -2013,6 +2024,15 @@ class Preview(proto.Message):
logs (str):
Output only. Location of preview logs in
``gs://{bucket}/{object}`` format.
tf_version (str):
Output only. The current Terraform version
set on the preview. It is in the format of
"Major.Minor.Patch", for example, "1.3.10".
tf_version_constraint (str):
Optional. The user-specified Terraform
version constraint. Example: "=1.3.10".
This field is a member of `oneof`_ ``_tf_version_constraint``.
"""

class State(proto.Enum):
Expand Down Expand Up @@ -2182,6 +2202,15 @@ class ErrorCode(proto.Enum):
proto.STRING,
number=17,
)
tf_version: str = proto.Field(
proto.STRING,
number=18,
)
tf_version_constraint: str = proto.Field(
proto.STRING,
number=19,
optional=True,
)


class PreviewOperationMetadata(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6652,6 +6652,8 @@ def test_get_preview(request_type, transport: str = "grpc"):
build="build_value",
error_logs="error_logs_value",
logs="logs_value",
tf_version="tf_version_value",
tf_version_constraint="tf_version_constraint_value",
)
response = client.get_preview(request)

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


def test_get_preview_empty_call():
Expand Down Expand Up @@ -6742,6 +6746,8 @@ async def test_get_preview_empty_call_async():
build="build_value",
error_logs="error_logs_value",
logs="logs_value",
tf_version="tf_version_value",
tf_version_constraint="tf_version_constraint_value",
)
)
response = await client.get_preview()
Expand Down Expand Up @@ -6779,6 +6785,8 @@ async def test_get_preview_async(
build="build_value",
error_logs="error_logs_value",
logs="logs_value",
tf_version="tf_version_value",
tf_version_constraint="tf_version_constraint_value",
)
)
response = await client.get_preview(request)
Expand All @@ -6802,6 +6810,8 @@ async def test_get_preview_async(
assert response.build == "build_value"
assert response.error_logs == "error_logs_value"
assert response.logs == "logs_value"
assert response.tf_version == "tf_version_value"
assert response.tf_version_constraint == "tf_version_constraint_value"


@pytest.mark.asyncio
Expand Down Expand Up @@ -9421,6 +9431,7 @@ def test_create_deployment_rest(request_type):
"tf_version_constraint": "tf_version_constraint_value",
"tf_version": "tf_version_value",
"quota_validation": 1,
"annotations": {},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down Expand Up @@ -9844,6 +9855,7 @@ def test_update_deployment_rest(request_type):
"tf_version_constraint": "tf_version_constraint_value",
"tf_version": "tf_version_value",
"quota_validation": 1,
"annotations": {},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down Expand Up @@ -13520,6 +13532,8 @@ def test_create_preview_rest(request_type):
"artifacts": "artifacts_value",
},
"logs": "logs_value",
"tf_version": "tf_version_value",
"tf_version_constraint": "tf_version_constraint_value",
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down Expand Up @@ -13888,6 +13902,8 @@ def test_get_preview_rest(request_type):
build="build_value",
error_logs="error_logs_value",
logs="logs_value",
tf_version="tf_version_value",
tf_version_constraint="tf_version_constraint_value",
)

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


def test_get_preview_rest_required_fields(request_type=config.GetPreviewRequest):
Expand Down

0 comments on commit 765e198

Please sign in to comment.