Fix GKE range name and CidrBlock conflict

This commit is contained in:
Neil MacDougall 2024-01-17 09:16:01 +00:00
parent 714f2be4d5
commit 778fb9f095
2 changed files with 18 additions and 1 deletions

View File

@ -755,13 +755,21 @@ export default Component.extend(ClusterDriver, {
if (subnetworkMatch) {
const { secondaryIpRanges = [] } = subnetworkMatch;
return secondaryIpRanges.map((s) => {
const items = secondaryIpRanges.map((s) => {
return {
label: `${ s.rangeName }(${ s.ipCidrRange })`,
value: s.rangeName,
ipCidrRange: s.ipCidrRange,
}
});
items.unshift({
label: this.intl.t('clusterNew.googlegke.ipAllocationPolicy.noSecondaryRange'),
value: null,
ipCidrRange: '',
});
return items;
}
return [];
@ -954,6 +962,14 @@ export default Component.extend(ClusterDriver, {
}
}
if (get(config, 'ipAllocationPolicy.clusterSecondaryRangeName') && get(config, 'ipAllocationPolicy.clusterIpv4CidrBlock')) {
set(config, 'ipAllocationPolicy.clusterIpv4CidrBlock', null);
}
if (get(config, 'ipAllocationPolicy.servicesSecondaryRangeName') && get(config, 'ipAllocationPolicy.servicesIpv4CidrBlock')) {
set(config, 'ipAllocationPolicy.servicesIpv4CidrBlock', null);
}
if (!get(config, 'masterAuthorizedNetworks.enabled')) {
delete config.masterAuthorizedNetworks.cidrBlocks
}

View File

@ -3975,6 +3975,7 @@ clusterNew:
cidrLabel: Service Secondary CIDR Block
nameLabel: Services Secondary Range Name
title: IP Allocation Policy
noSecondaryRange: "<None>"
ipPolicyClusterIpv4CidrBlock:
label: Pod address range
placeholder: e.g. 10.96.0.0/11