-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add LocalDNS Live Tests for valid and invalid scenarios #9252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
necusjz
merged 77 commits into
Azure:main
from
saewoni:sakwa/feature-localdns-none-input-handling
Oct 8, 2025
Merged
Changes from all commits
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
ca0a1b1
skip none overrides on localdns profile
c044f0e
update history rst
19c6404
refactor to process dns overrides func
2778aba
move overrides function to helper file
6d0dd1e
apply linter suggestions
ffa5a65
Merge branch 'main' into juanbe/feature-localdns-none-input-handling
jdbencardinop f9a3328
add localdnsconfig folder
saewoni eb1363b
add more tests
saewoni 0fd5c83
add new json files
saewoni 450d1b8
add default dns overrides
saewoni e6474f3
add more test cases
saewoni f11d205
move tests around, move invalid cases to another file
saewoni 3c6153b
add back import semver
saewoni 8d63c84
reorder the existing tests
saewoni 5a5e8fa
delete preferred mode only
saewoni a77e76e
delete null.json
saewoni 68e89e7
remove redundant json file
saewoni 240b83e
remove redundant json file
saewoni 0ed5860
fix the mistake at line 3349
saewoni 3f17065
forgot that i put all the configs in data/localconfig folder
saewoni b43f7ad
remove unused file
saewoni 8ac70f8
spelling error
saewoni 8ce451e
fix default dnsOverrides check when we create agentpool with required…
saewoni 39e0ead
restore localdnsconfig file
saewoni 14d70aa
delete extra property case from invalid test file
saewoni d73d85e
add extra property cases in src/aks-preview/azext_aks_preview/tests/l…
saewoni 9ff61c9
add extra property files
saewoni 734ad4c
check for defaulted *dnsOverrides when making agent pool with mode: r…
saewoni d2e900f
Merge remote-tracking branch 'origin' into sakwa/feature-localdns-non…
saewoni 0734db0
comment out cleanup in test_aks_nodepool_add_with_localdns_required_mode
saewoni 1786254
add more logging for debugging
saewoni b747438
add print statements in src/aks-preview/azext_aks_preview/vendored_sd…
saewoni 6a57dc3
only initialize the dictionaries if dnsoverrides are provided
saewoni 7432a92
process dns overrides only when dns overrides are provided
saewoni 45fb82f
consolidate duplicated build_localdns_profile function
saewoni 7753f07
move invalid cases to line 4133
saewoni f08686b
update test_aks_commands.py
saewoni 54c428d
look for vnetDnsOverrides and kubeDNSOverrides keys, case-insensitive
saewoni 00b2fbd
fix test_aks_nodepool_add_with_localdns_required_mode_single_vnetdns
saewoni 7f6a6e6
check for dictionary for build_override
saewoni 61bc4d6
update failing test cases
saewoni af0aa93
rename from required_mode_extra_property.json -> required_mode_kubedn…
saewoni e121b3a
fix azdev style
saewoni 794fc05
temporarily add self.fail statements s.t. i can see the error_message
saewoni 8f3e3d2
change from assertTrue to assertIn with more specific error msg, dele…
saewoni c526128
change from print to debug
saewoni 0504217
remove logger.debug line to print localdnsprofile
saewoni 0af69ba
Merge remote-tracking branch 'origin' into sakwa/feature-localdns-non…
saewoni 8f81a8f
add null config file
saewoni e1895b4
fix the tests
saewoni 12e0f94
fix the tests
saewoni c53d6fd
update src/aks-preview/HISTORY.rst with a new note under 18.0.0b42
saewoni 661a342
update src/aks-preview/HISTORY.rst
saewoni 417cf30
Revert "add print statements in src/aks-preview/azext_aks_preview/ven…
saewoni 4b66d2d
Merge branch 'main' into sakwa/feature-localdns-none-input-handling
saewoni 28d0caf
update src/aks-preview/HISTORY.rst
saewoni 965f69b
Revert "add more logging for debugging"
saewoni dac66cc
mix the casing for *dnsoverrides
saewoni a7afe9a
throw an exception from cli if the values of kubednsoverrides or vnet…
saewoni f03ba28
add tests for null and non-dict overrides
saewoni 68d4a41
make the keys of localdnsprofile mixed-case
saewoni 64c7b27
add required_mode_null_dnsOverrides.json and required_mode_number_dns…
saewoni 1e4966c
correct the error message I'm looking for, for non-dict dns overrides
saewoni 33cc65a
remove print stmt from src/aks-preview/azext_aks_preview/_helpers.py
saewoni c86acb5
add check for DNS override settings
saewoni 4b00a09
update the test with dns override settings check
saewoni b2f8721
update assertIn msg for test_aks_nodepool_add_with_localdns_required_…
saewoni 59a78ae
break down InvalidArgumentValueError msg into two lines
saewoni b2dac0c
update existing cassette files
saewoni 55f4c50
new cassette files for new tests
saewoni 0a3bfc5
add three additional cassette files I did not commit before
saewoni 101f367
expect InvalidArgumentValueError when None is provided for DNS overrides
saewoni a2ae22c
update AKSPreviewAgentPoolUpdateDecoratorCommonTestCase.common_update…
saewoni 9a3023d
revert the import statement for from azure.cli.command_modules.acs.te…
saewoni 2c347c3
Add a new line
jdbencardinop 3c32af3
Revert "Add a new line"
saewoni 2a85b4d
update version in src/aks-preview/setup.py to align with azure-cli-ex…
saewoni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/aks-preview/azext_aks_preview/tests/latest/data/localdnsconfig/disabled_mode_only.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"mode": "Disabled" | ||
} |
1 change: 1 addition & 0 deletions
1
src/aks-preview/azext_aks_preview/tests/latest/data/localdnsconfig/empty.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
3 changes: 3 additions & 0 deletions
3
src/aks-preview/azext_aks_preview/tests/latest/data/localdnsconfig/empty_mode.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"mode": "" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/aks-preview/azext_aks_preview/tests/latest/data/localdnsconfig/invalid_mode.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"mode": "InvalidMode" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...zext_aks_preview/tests/latest/data/localdnsconfig/localdnsconfig_with_extra_property.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"mode": "Required", | ||
"extraProperty": "unexpected", | ||
"kubeDNSOverrides": { | ||
".": { | ||
"cacheDurationInSeconds": 3600, | ||
"forwardDestination": "ClusterCoreDNS", | ||
"forwardPolicy": "Sequential", | ||
"maxConcurrent": 1000, | ||
"protocol": "PreferUDP", | ||
"queryLogging": "Error", | ||
"serveStale": "Verify", | ||
"serveStaleDurationInSeconds": 3600 | ||
}, | ||
"cluster.local": { | ||
"cacheDurationInSeconds": 3600, | ||
"forwardDestination": "ClusterCoreDNS", | ||
"forwardPolicy": "Sequential", | ||
"maxConcurrent": 1000, | ||
"protocol": "ForceTCP", | ||
"queryLogging": "Error", | ||
"serveStale": "Immediate", | ||
"serveStaleDurationInSeconds": 3600 | ||
} | ||
}, | ||
"vnetDNSOverrides": { | ||
".": { | ||
"cacheDurationInSeconds": 3600, | ||
"forwardDestination": "VnetDNS", | ||
"forwardPolicy": "Sequential", | ||
"maxConcurrent": 1000, | ||
"protocol": "PreferUDP", | ||
"queryLogging": "Error", | ||
"serveStale": "Verify", | ||
"serveStaleDurationInSeconds": 3600 | ||
}, | ||
"cluster.local": { | ||
"cacheDurationInSeconds": 3600, | ||
"forwardDestination": "ClusterCoreDNS", | ||
"forwardPolicy": "Sequential", | ||
"maxConcurrent": 1000, | ||
"protocol": "ForceTCP", | ||
"queryLogging": "Error", | ||
"serveStale": "Immediate", | ||
"serveStaleDurationInSeconds": 3600 | ||
} | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
.../tests/latest/data/localdnsconfig/localdnsconfig_with_extra_property_in_dnsOverrides.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"mode": "Required", | ||
"extraProperty": "unexpected", | ||
saewoni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"kubeDNSOverrides": { | ||
".": { | ||
"extraProperty": "unexpected", | ||
"cacheDurationInSeconds": 3600, | ||
"forwardDestination": "ClusterCoreDNS", | ||
"forwardPolicy": "Sequential", | ||
"maxConcurrent": 1000, | ||
"protocol": "PreferUDP", | ||
"queryLogging": "Error", | ||
"serveStale": "Verify", | ||
"serveStaleDurationInSeconds": 3600 | ||
}, | ||
"cluster.local": { | ||
"extraProperty": "unexpected", | ||
"cacheDurationInSeconds": 3600, | ||
"forwardDestination": "ClusterCoreDNS", | ||
"forwardPolicy": "Sequential", | ||
"maxConcurrent": 1000, | ||
"protocol": "ForceTCP", | ||
"queryLogging": "Error", | ||
"serveStale": "Immediate", | ||
"serveStaleDurationInSeconds": 3600 | ||
} | ||
}, | ||
"vnetDNSOverrides": { | ||
".": { | ||
"extraProperty": "unexpected", | ||
"cacheDurationInSeconds": 3600, | ||
"forwardDestination": "VnetDNS", | ||
"forwardPolicy": "Sequential", | ||
"maxConcurrent": 1000, | ||
"protocol": "PreferUDP", | ||
"queryLogging": "Error", | ||
"serveStale": "Verify", | ||
"serveStaleDurationInSeconds": 3600 | ||
}, | ||
"cluster.local": { | ||
"extraProperty": "unexpected", | ||
"cacheDurationInSeconds": 3600, | ||
"forwardDestination": "ClusterCoreDNS", | ||
"forwardPolicy": "Sequential", | ||
"maxConcurrent": 1000, | ||
"protocol": "ForceTCP", | ||
"queryLogging": "Error", | ||
"serveStale": "Immediate", | ||
"serveStaleDurationInSeconds": 3600 | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/aks-preview/azext_aks_preview/tests/latest/data/localdnsconfig/missing_mode.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"kubeDnsOverrides": { | ||
".": { | ||
"cacheDurationInSeconds": 3600, | ||
"forwardDestination": "ClusterCoreDNS", | ||
"forwardPolicy": "Sequential", | ||
"maxConcurrent": 1000, | ||
"protocol": "PreferUDP", | ||
"queryLogging": "Error", | ||
"serveStale": "Verify", | ||
"serveStaleDurationInSeconds": 3600 | ||
} | ||
}, | ||
"vnetDnsOverrides": { | ||
".": { | ||
"cacheDurationInSeconds": 3600, | ||
"forwardDestination": "VnetDNS", | ||
"forwardPolicy": "Sequential", | ||
"maxConcurrent": 1000, | ||
"protocol": "PreferUDP", | ||
"queryLogging": "Error", | ||
"serveStale": "Verify", | ||
"serveStaleDurationInSeconds": 3600 | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/aks-preview/azext_aks_preview/tests/latest/data/localdnsconfig/null_config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
null |
3 changes: 3 additions & 0 deletions
3
src/aks-preview/azext_aks_preview/tests/latest/data/localdnsconfig/null_mode.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"mode": null | ||
} |
5 changes: 5 additions & 0 deletions
5
...iew/azext_aks_preview/tests/latest/data/localdnsconfig/required_mode_empty_overrides.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"mode": "Required", | ||
"kubeDnsOverrides": {}, | ||
"vnetDnsOverrides": {} | ||
} |
8 changes: 8 additions & 0 deletions
8
...iew/azext_aks_preview/tests/latest/data/localdnsconfig/required_mode_invalid_kubedns.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"mode": "Required", | ||
"kubeDnsOverrides": { | ||
".": { | ||
"invalidField": 123 | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...iew/azext_aks_preview/tests/latest/data/localdnsconfig/required_mode_invalid_vnetdns.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"mode": "Required", | ||
"vnetDnsOverrides": { | ||
".": { | ||
"invalidField": 456 | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.