mirror of https://github.com/rancher/ui.git
Merge pull request #2277 from westlywright/aks-ci-dir-bug
Fix AKS field validation
This commit is contained in:
commit
a0c3a40b13
|
|
@ -187,36 +187,36 @@ export default Component.extend(ClusterDriver, {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
parsedServiceCidr = ipaddr.parseCIDR(serviceCidr);
|
parsedServiceCidr = ipaddr.parseCIDR(serviceCidr);
|
||||||
|
|
||||||
|
// check if serviceCidr falls within the VNet/Subnet range
|
||||||
|
if (parsedServiceCidr && vnetRange[0].match(parsedServiceCidr)) {
|
||||||
|
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.parsedServiceCidr'));
|
||||||
|
}
|
||||||
} catch ( err ) {
|
} catch ( err ) {
|
||||||
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.serviceCidr'));
|
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.serviceCidr'));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
parsedDnsServiceIp = ipaddr.parse(dnsServiceIp);
|
parsedDnsServiceIp = ipaddr.parse(dnsServiceIp);
|
||||||
|
|
||||||
|
// check if dnsService exists in range
|
||||||
|
if (parsedDnsServiceIp && vnetRange[0].match(parsedDnsServiceIp, vnetRange[1])) {
|
||||||
|
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.parsedDnsServiceIp'));
|
||||||
|
}
|
||||||
} catch ( err ) {
|
} catch ( err ) {
|
||||||
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.dnsServiceIp'));
|
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.dnsServiceIp'));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
parsedDockerBridgeCidr = ipaddr.parseCIDR(dockerBridgeCidr);
|
parsedDockerBridgeCidr = ipaddr.parseCIDR(dockerBridgeCidr);
|
||||||
|
|
||||||
|
// check that dockerBridge doesn't overlap
|
||||||
|
if (parsedDockerBridgeCidr && ( vnetRange[0].match(parsedDockerBridgeCidr) || parsedServiceCidr[0].match(parsedDockerBridgeCidr) )) {
|
||||||
|
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.parsedDockerBridgeCidr'));
|
||||||
|
}
|
||||||
} catch ( err ) {
|
} catch ( err ) {
|
||||||
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.dockerBridgeCidr'));
|
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.dockerBridgeCidr'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if serviceCidr falls within the VNet/Subnet range
|
|
||||||
if (vnetRange[0].match(parsedServiceCidr)) {
|
|
||||||
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.parsedServiceCidr'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if dnsService exists in range
|
|
||||||
if (vnetRange[0].match(parsedDnsServiceIp, vnetRange[1])) {
|
|
||||||
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.parsedDnsServiceIp'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// check that dockerBridge doesn't overlap
|
|
||||||
if (vnetRange[0].match(parsedDockerBridgeCidr) || parsedServiceCidr[0].match(parsedDockerBridgeCidr)) {
|
|
||||||
errors.pushObject(intl.t('clusterNew.azureaks.errors.included.parsedDockerBridgeCidr'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue