Skip to content

Commit

Permalink
frontend: Fix AWS VPC validation when no subnets are selected
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoto committed Jan 15, 2018
1 parent 5a90a6e commit cc2622b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions installer/frontend/components/aws-vpc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ const validateVPC = async (data, cc, updatedId, dispatch) => {

const controllerSubnets = getSubnets(cc[isCreate ? AWS_CONTROLLER_SUBNETS : AWS_CONTROLLER_SUBNET_IDS]);
const workerSubnets = getSubnets(cc[isCreate ? AWS_WORKER_SUBNETS : AWS_WORKER_SUBNET_IDS]);
if (_.isEmpty(controllerSubnets) || _.isEmpty(workerSubnets)) {
return 'You must provide subnets for both masters and workers.';
}

const isPrivate = cc[AWS_CREATE_VPC] === VPC_PRIVATE;
const network = {
Expand All @@ -107,11 +110,6 @@ const validateVPC = async (data, cc, updatedId, dispatch) => {
serviceCIDR: cc[SERVICE_CIDR],
};

// No need to validate if no subnets have been set yet
if (_.isEmpty(network.privateSubnets) && _.isEmpty(network.publicSubnets)) {
return;
}

if (isCreate) {
network.vpcCIDR = cc[AWS_VPC_CIDR];
} else {
Expand Down

0 comments on commit cc2622b

Please sign in to comment.