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

GCP: Compute Routers #155

Merged
merged 7 commits into from
Apr 16, 2020
Merged

GCP: Compute Routers #155

merged 7 commits into from
Apr 16, 2020

Conversation

harjain99
Copy link
Contributor

Fixes #144

Copy link
Contributor

@deepanjan90 deepanjan90 left a 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.
Comment on lines 95 to 96
setSourceIpRangesToNat(model.getSourceIpRangesToNat() == null ? new ArrayList<>() : model.getSourceIpRangesToNat());
setSecondaryIpRangeNames(model.getSecondaryIpRangeNames() == null ? new ArrayList<>() : model.getSecondaryIpRangeNames());
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

Choose a reason for hiding this comment

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

waitForCompletion(client, operation);

Copy link
Contributor

@deepanjan90 deepanjan90 left a comment

Choose a reason for hiding this comment

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

Inline changes

@deepanjan90 deepanjan90 requested review from beetlebugorg and deepanjan90 and removed request for beetlebugorg and deepanjan90 April 15, 2020 14:53
@beetlebugorg beetlebugorg merged commit 727434c into master Apr 16, 2020
@beetlebugorg beetlebugorg deleted the feature/compute-router branch April 16, 2020 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GCP : Compute Routers
3 participants