You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[DEVOPS-621] Fix $ingressWhitelist being set incorrectly (#176)
<details open>
<summary><a href="https://amuniversal.atlassian.net/browse/DEVOPS-621"
title="DEVOPS-621" target="_blank">DEVOPS-621</a></summary>
<br />
<table>
<tr>
<th>Summary</th>
<td>ingressWhitelist is not being set properly during AKS deploys</td>
</tr>
<tr>
<th>Type</th>
<td>
<img alt="Bug"
src="https://amuniversal.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10308?size=medium"
/>
Bug
</td>
</tr>
<tr>
<th>Status</th>
<td>In Progress</td>
</tr>
<tr>
<th>Points</th>
<td>N/A</td>
</tr>
<tr>
<th>Labels</th>
<td>-</td>
</tr>
</table>
</details>
<!--
do not remove this marker as it will break action-jira-linter's
functionality.
added_by_jira_lint
-->
---
<!-- Please make sure you read the contribution guidelines and then fill
out the blanks below.
Please format the PR title appropriately based on the type of change:
[JIRA-XXX]: <description>
-->
## Description
Fix `$ingressWhitelist` being set incorrectly
Basically, the `$ingressWhitelist` variable was being set before the
loop so anytime there was a modification made to it during one of the
first items in the loop, it would apply those changes to the rest of the
ingresses.
- Move setting the `$ingressWhitelist` variable to be inside the loop
- Check to make sure `$ingressWhitelist` includes valid CIDR notation
before setting it to the default values.
## Related Links
<!-- List any links related to this pull request here
Replace "JIRA-XXX" with the your Jira issue key -->
- Jira Issue: DEVOPS-621
if ($ingressWhitelist -notmatch '^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.((25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.){2}(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)(/(3[0-2]|[1-2]?[0-9]))?$') {
395
400
Write-Output "Ingress whitelist not set for $($item.Key)"
396
401
if (($ingressWhitelist -eq "service") -or ($item.Value.annotations."nginx.ingress.kubernetes.io/whitelist-source-range" -match "207.67.20.239,40.86.103.124,40.77.105.170")) {
0 commit comments