Skip to content

Commit

Permalink
fix: [M3-7270] - Edit Linode VLAN config interface (#9798)
Browse files Browse the repository at this point in the history
## Description 📝
Bug from #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 Oct 17, 2023
1 parent 49d9db2 commit b8e1b04
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 b8e1b04

Please sign in to comment.