Skip to content

Commit

Permalink
[#1525][Platform] New Universe creation gets public IP assigned even …
Browse files Browse the repository at this point in the history
…with flag = false

Summary:
When creating the universe,  while choosing the node and replication factor, the nodeDetailsSet is added to the configuration. The **assignPublicIP** field in the nodeDetailsSet takes the current value of the **assignPublicIP** form value.
So, later even if we change the value of **assignPublicIP** in form, it is not getting modified inside the nodeDetailsSet. This gets passed to the platform, and the platform creates nodes corresponding to the values present in the nodeDetailsSet , causing this discrepancy.

Fix:
Before submitting the form, we iterate through all of the nodeDetailsSet and assign the form value of the **assignPublicIP** to each the nodes inside nodeDetailsSet.

Test Plan:
Steps followed:
1) Choose Provider
2) toggle off the assignPublicIP
3) configure regions, nodes and replication factor.
4) Turn on the assignPublicIP
5) check , if the newly created universe has the public ip.

and reversed the initial state of the toggle and tested again.

The universe doesn't have the public IP (Actually, we can't test this scenario in portal. We need to subnet to test. The universe simple won't come up).

Reviewers: sshevchenko, andrew, mjoshi, cpadinjareveettil, ssutar

Reviewed By: cpadinjareveettil, ssutar

Subscribers: hsu, jenkins-bot, ui

Differential Revision: https://phabricator.dev.yugabyte.com/D12705
  • Loading branch information
haikarthikssk committed Aug 26, 2021
1 parent 1191dd3 commit 9caa6f6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions managed/ui/src/components/universes/UniverseForm/UniverseForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,16 @@ class UniverseForm extends Component {
];
}

submitPayload.nodeDetailsSet = submitPayload.nodeDetailsSet.map(nodeDetail => {
return {
...nodeDetail,
cloudInfo: {
...nodeDetail.cloudInfo,
assignPublicIP: formValues["primary"].assignPublicIP
}
}
})

submitPayload.clusters = submitPayload.clusters.filter((c) => c.userIntent !== null);
// filter clusters array if configuring(adding only) Read Replica due to server side validation
if (type === 'Async') {
Expand Down

0 comments on commit 9caa6f6

Please sign in to comment.