Skip to content
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

Redis MRR Support #5449

Merged
merged 7 commits into from
Nov 19, 2021
Merged

Redis MRR Support #5449

merged 7 commits into from
Nov 19, 2021

Conversation

himanikh
Copy link
Contributor

@himanikh himanikh commented Nov 12, 2021

Changes to support Multi read replica feature on Cloud Memorystor redis

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know). - Unable to run these tests target testacc unavailable
  • [ X] Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

redis: Added Multi read replica field `replicaCount `, `nodes`,  `readEndpoint`, `readEndpointPort`, `readReplicasMode` in `google_redis_instance `

@google-cla google-cla bot added the cla: no label Nov 12, 2021
@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in /~https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@melinath, please review this PR or find an appropriate assignee.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 84 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 3 files changed, 323 insertions(+), 1 deletion(-))
TF OiCS: Diff ( 4 files changed, 135 insertions(+))

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a release note as described in the opening comment's template

properties:
alternativeLocationId: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
authorizedNetwork: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
custom_expand: 'templates/terraform/custom_expand/redis_instance_authorized_network.erb'
diff_suppress_func: 'compareSelfLinkOrResourceName'
locationId: !ruby/object:Overrides::Terraform::PropertyOverride
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an extraneous change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added back

@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in /~https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 84 insertions(+))
Terraform Beta: Diff ( 3 files changed, 323 insertions(+))
TF OiCS: Diff ( 4 files changed, 135 insertions(+))

@melinath melinath self-requested a review November 16, 2021 21:26
Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the changes below, please update your release note per the guidelines and sign the CLA as described here: /~https://github.com/GoogleCloudPlatform/magic-modules/pull/5449/checks?check_run_id=4196015153

name: readReplicasMode
description: |
Optional. Read replica mode.
If not set, Memorystore Redis backend will pick the mode based on other fields in the request.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks from the docs like the default is always READ_REPLICAS_DISABLED - is that not the case?

https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#readreplicasmode

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the description.

@google-cla google-cla bot added cla: yes and removed cla: no labels Nov 18, 2021
@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in /~https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 84 insertions(+))
Terraform Beta: Diff ( 3 files changed, 323 insertions(+))
TF OiCS: Diff ( 4 files changed, 135 insertions(+))

@melinath
Copy link
Member

/gcbrun

@melinath melinath self-requested a review November 18, 2021 17:15
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 84 insertions(+))
Terraform Beta: Diff ( 3 files changed, 323 insertions(+))
TF OiCS: Diff ( 4 files changed, 135 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccRedisInstanceDatasource_basic|TestAccCloudFunctionsFunction_vpcConnector|TestAccComputeRegionNetworkEndpointGroup_regionNetworkEndpointGroupAppengineExample|TestAccContainerNodePool_withInvalidUpgradeSettings|TestAccEventarcTrigger_BasicHandWritten|TestAccServiceNetworkingPeeredDNSDomain_basic|TestAccNetworkServicesEdgeCacheService_networkServicesEdgeCacheServiceAdvancedExample|TestAccRedisInstance_redisInstanceMrrExample|TestAccRedisInstance_redisInstanceBasicExample|TestAccRedisInstance_update|TestAccRedisInstance_redisInstanceFullExample|TestAccRedisInstance_redisInstanceAuthEnabled|TestAccRedisInstance_regionFromLocation|TestAccRedisInstance_downgradeRedisVersion|TestAccServiceDirectoryEndpoint_serviceDirectoryEndpointWithNetworkExample|TestAccSqlUser_postgresIAM You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=220806

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccRedisInstance_redisInstanceMrrExample|TestAccEventarcTrigger_BasicHandWritten|TestAccCloudFunctionsFunction_vpcConnector|TestAccRedisInstance_redisInstanceFullExample|TestAccComputeRegionNetworkEndpointGroup_regionNetworkEndpointGroupAppengineExample|TestAccContainerNodePool_withInvalidUpgradeSettings|TestAccSqlUser_postgresIAM Please fix these to complete your PR

@melinath
Copy link
Member

melinath commented Nov 19, 2021

TestAccRedisInstance_redisInstanceMrrExample is failing with the errors:

Error: Error creating Instance: googleapi: Error 400: Invalid IP range: 192.168.0.0/29. Require a minimum of /28 block size when read replica is enabled.
com.google.apps.framework.request.StatusException: <eye3 title='INVALID_ARGUMENT'/> generic::INVALID_ARGUMENT: Invalid IP range: 192.168.0.0/29. Require a minimum of /28 block size when read replica is enabled.
Details:
[
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"description": "Invalid value: 192.168.0.0/29",
"field": "instance.reserved_ip_range"
}
]
}
]
on terraform_plugin_test.tf line 2, in resource "google_redis_instance" "cache":
2: resource "google_redis_instance" "cache" {

Probably the test needs to be updated to have a valid value.


Additionally, TestAccRedisInstance_redisInstanceFullExample is failing with the error:

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# google_redis_instance.cache will be updated in-place
~ resource "google_redis_instance" "cache" {
id                       = "projects/project-id/locations/us-central1/instances/tf-test-ha-memory-cache7zfrzip0gk"
name                     = "tf-test-ha-memory-cache7zfrzip0gk"
- replica_count            = 1 -> null
# (23 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.

This probably means that the API server sets a default value of 1 if the replica_count isn't set in the request. If that field is likely to always default to 1, then you could resolve this by adding default_value: 1 to replica_count in api.yaml - otherwise, you could add default_from_api: true as an override in terraform.yaml (search the codebase for examples)

UPDATE: since the default depends on whether the user has a basic account or not, this will need to use default_from_api.

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above comment - forgot to leave it as a change request

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 84 insertions(+))
Terraform Beta: Diff ( 3 files changed, 323 insertions(+))
TF OiCS: Diff ( 4 files changed, 135 insertions(+))

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 88 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 3 files changed, 321 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 4 files changed, 135 insertions(+))

@melinath melinath self-requested a review November 19, 2021 21:01
@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic|TestAccCloudFunctionsFunction_vpcConnector|TestAccComputeRegionNetworkEndpointGroup_regionNetworkEndpointGroupAppengineExample|TestAccContainerNodePool_withWorkloadIdentityConfig|TestAccContainerNodePool_withInvalidUpgradeSettings|TestAccEventarcTrigger_BasicHandWritten|TestAccRedisInstance_redisInstanceMrrExample|TestAccRedisInstance_redisInstanceFullExample|TestAccRedisInstance_update|TestAccRedisInstance_redisInstanceAuthEnabled|TestAccSqlUser_postgresIAM You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=221572

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccEventarcTrigger_BasicHandWritten|TestAccCloudFunctionsFunction_vpcConnector|TestAccComputeRegionNetworkEndpointGroup_regionNetworkEndpointGroupAppengineExample|TestAccContainerNodePool_withInvalidUpgradeSettings|TestAccSqlUser_postgresIAM Please fix these to complete your PR

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - remaining failures are unrelated

@melinath melinath merged commit 2df428d into GoogleCloudPlatform:master Nov 19, 2021
betsy-lichtenberg pushed a commit to betsy-lichtenberg/magic-modules that referenced this pull request Apr 25, 2022
* Redis MRR Support

* [Bug fix]Add locationId back to instance properties

* Update api.yaml

* Update redis_instance_mrr.tf.erb

* Update api.yaml

* Update terraform.yaml

* Update api.yaml

Co-authored-by: Himani Khanduja <khimani@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants