-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat(compute): add compute instance attach regional disk force sample #9730
base: main
Are you sure you want to change the base?
feat(compute): add compute instance attach regional disk force sample #9730
Conversation
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please, apply the feedback comments to the code sample file.
please, remove order in the e2e testing. i would strongly encourage to use mocking of the client library instead. it will simplify and speed up the testing.
compute/cloud-client/src/main/java/compute/disks/AttachRegionalDiskForce.java
Outdated
Show resolved
Hide resolved
compute/cloud-client/src/main/java/compute/disks/AttachRegionalDiskForce.java
Outdated
Show resolved
Hide resolved
compute/cloud-client/src/main/java/compute/disks/AttachRegionalDiskForce.java
Outdated
Show resolved
Hide resolved
compute/cloud-client/src/main/java/compute/disks/AttachRegionalDiskForce.java
Outdated
Show resolved
Hide resolved
For the samples in the compute package we use real client, not mocked one. I followed this approach. Please leave it as is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please refactor tests to remove introduced sequential execution before proceed.
see a few minor comments for your consideration.
please, rebase the branch before moving forward since it conflicts with changes that were previously merged.
// Project ID or project number of the Cloud project you want to use. | ||
String projectId = "YOUR_PROJECT_ID"; | ||
// Name of the zone of your compute instance. | ||
String zone = "us-central1-a"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: refactor the name to "instanceLocation" be more verbose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Changed
// The name of the compute instance where you are adding the replicated disk. | ||
String instanceName = "YOUR_INSTANCE_NAME"; | ||
// The region where your replicated disk is located. | ||
String region = "us-central1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: refactor the name to "diskLocation" be more verbose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Changed
@@ -265,13 +275,15 @@ public void afterEach() { | |||
} | |||
|
|||
@Test | |||
@Order(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please consider to setup for each test separately instead of enforcing the order.
note that the order may fail upcoming tests despite that they are OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Deleted
Description
Documentation - https://cloud.google.com/compute/docs/disks/repd-failover?authuser=0#force-attach
Node.js sample - GoogleCloudPlatform/nodejs-docs-samples#3922
Fixes #
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
pom.xml
parent set to latestshared-configuration
mvn clean verify
requiredmvn -P lint checkstyle:check
requiredmvn -P lint clean compile pmd:cpd-check spotbugs:check
advisory only