Skip to content

Commit

Permalink
fix: [M3-7270] - Edit Linode VLAN config interface (linode#9798)
Browse files Browse the repository at this point in the history
## Description πŸ“
Bug from linode#9709

On the prod env, we were unable to edit a config due to the config interface being deleted. This was due to the `regionHasVPCs` variable being coupled with `regionHasVLANS` in the if statement to delete config interfaces. The fix was to handle VPCs and VLANs separately.

## How to test πŸ§ͺ

### Prerequisites
- Point to the prod environment

### Reproduction steps
- Go to a Linode's details page and click on the `Configurations` tab
- Click the edit button and scroll down to the Networking section
- Select a VLAN and save changes

### Verification steps 
- The VLAN changes should be reflected in the Configurations table
  • Loading branch information
hana-akamai authored and abailly-akamai committed Oct 17, 2023
1 parent acb4565 commit 42aff6d
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,16 @@ export const LinodeConfigDialog = (props: Props) => {
configData.initrd = finnixDiskID;
}

if (!regionHasVLANS || !regionHasVPCs) {
delete configData.interfaces;
if (!regionHasVLANS) {
configData.interfaces = configData.interfaces?.filter(
(_interface) => _interface.purpose !== 'vlan'
);
}

if (!regionHasVPCs) {
configData.interfaces = configData.interfaces?.filter(
(_interface) => _interface.purpose !== 'vpc'
);
}

const actionType = Boolean(config) ? 'updated' : 'created';
Expand Down

0 comments on commit 42aff6d

Please sign in to comment.