Skip to content

Commit

Permalink
container network gateway use cidr pattern (#611) (#619)
Browse files Browse the repository at this point in the history
Signed-off-by: Meina Zhou <meinaz@vmware.com>
  • Loading branch information
zhoumeina committed Oct 23, 2018
1 parent 41cf385 commit 3ffccdb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ export class CreateVchWizardComponent implements OnInit {
network['ip_ranges'] = [net.containerNetworkIpRange];

network['gateway'] = {
address: net.containerNetworkGateway
address: net.containerNetworkGateway.split('/')[0],
routing_destinations: [net.containerNetworkGateway]
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class NetworksComponent implements OnInit {
]],
containerNetworkGateway: [{ value: '', disabled: true }, [
Validators.required,
Validators.pattern(ipPattern)
Validators.pattern(cidrPattern)
]],
containerNetworkLabel: [{ value: '', disabled: true }, [
Validators.required,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
</span>

<span class="tooltip-content" *ngIf="form.get('publicNetworkIp').hasError('pattern')">
CIDR is not valid
Public network is not valid, please input it in CIDR format *.*.*.*/*. e.g. 172.28.64.0/22
</span>

</label>
Expand Down Expand Up @@ -252,7 +252,7 @@
</span>

<span class="tooltip-content" *ngIf="form.get('clientNetworkIp').hasError('pattern')">
CIDR is not valid
Client network is not valid, please input it in CIDR format *.*.*.*/*. e.g. 172.28.64.0/22
</span>

</label>
Expand Down Expand Up @@ -344,7 +344,7 @@
</span>

<span class="tooltip-content" *ngIf="form.get('managementNetworkIp').hasError('pattern')">
CIDR is not valid
Management network is not valid, please input it in CIDR format *.*.*.*/*. e.g. 172.28.64.0/22
</span>

</label>
Expand Down Expand Up @@ -559,14 +559,14 @@
<label for="container-network-gateway" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-top-left"
[class.invalid]="form.get('containerNetworks').controls[i].controls.containerNetworkGateway.invalid && (form.get('containerNetworks').controls[i].controls.containerNetworkGateway.dirty || form.get('containerNetworks').controls[i].controls.containerNetworkGateway.touched)">

<input class="form-control" id="container-network-gateway" type="text" placeholder="IP address" formControlName="containerNetworkGateway">
<input class="form-control" id="container-network-gateway" type="text" placeholder="CIDR" formControlName="containerNetworkGateway">

<span class="tooltip-content" *ngIf="form.get('containerNetworks').controls[i].controls.containerNetworkGateway.hasError('required')">
Container network gateway cannot be empty
</span>

<span class="tooltip-content" *ngIf="form.get('containerNetworks').controls[i].controls.containerNetworkGateway.hasError('pattern')">
Gateway address is not valid
Gateway address is not valid, please input it in CIDR format *.*.*.*/*. e.g. 172.28.64.0/22
</span>

</label>
Expand Down

0 comments on commit 3ffccdb

Please sign in to comment.