-
Notifications
You must be signed in to change notification settings - Fork 0
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
GCP: Compute Routers #155
GCP: Compute Routers #155
Conversation
src/main/java/gyro/google/compute/RouterNatSubnetworkToNat.java
Outdated
Show resolved
Hide resolved
src/main/java/gyro/google/compute/RouterNatSubnetworkToNat.java
Outdated
Show resolved
Hide resolved
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.
Inline review
Use newSubResource. Refactor unnecessary null checks. Initialize null values to empty lists. clear lists before refreshing.
setSourceIpRangesToNat(model.getSourceIpRangesToNat() == null ? new ArrayList<>() : model.getSourceIpRangesToNat()); | ||
setSecondaryIpRangeNames(model.getSecondaryIpRangeNames() == null ? new ArrayList<>() : model.getSecondaryIpRangeNames()); |
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.
This is redundant now
.collect(Collectors.toList())); | ||
} | ||
|
||
getSubnet().clear(); |
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.
NPE if set to null
protected void doDelete(GyroUI ui, State state) throws Exception { | ||
Compute client = createComputeClient(); | ||
|
||
client.routers().delete(getProjectId(), getRegion(), getName()).execute(); |
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.
waitForCompletion(client, operation);
.collect(Collectors.toList())); | ||
} | ||
|
||
client.routers().patch(getProjectId(), getRegion(), getName(), router).execute(); |
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.
waitForCompletion(client, operation);
router.setNetwork(getNetwork().getSelfLink()); | ||
} | ||
|
||
Operation operation = client.routers().insert(getProjectId(), getRegion(), router).execute(); |
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.
waitForCompletion(client, operation);
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.
Inline changes
Fixes #144