-
Notifications
You must be signed in to change notification settings - Fork 1.5k
LocalDNS - Add more Live Test Cases #9237
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
Changes from 18 commits
ca0a1b1
c044f0e
19c6404
2778aba
6d0dd1e
ffa5a65
f9a3328
eb1363b
0fd5c83
450d1b8
e6474f3
f11d205
3c6153b
8d63c84
5a5e8fa
a77e76e
68e89e7
240b83e
0ed5860
3f17065
b43f7ad
8ac70f8
8ce451e
39e0ead
14d70aa
d73d85e
9ff61c9
734ad4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -448,3 +448,19 @@ def get_extension_in_allow_list(result): | |
| if _check_if_extension_type_is_in_allow_list(result.extension_type.lower()): | ||
| return result | ||
| return None | ||
|
|
||
|
|
||
| def process_dns_overrides(overrides_dict, target_dict, build_override_func): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar to the change in #9188, is the work duplicated?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will be a follow up PR! once #9188 is merged.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. abandoning/closing this PR and will be making a new PR since juan's is merged: #9252 |
||
| """Helper function to safely process DNS overrides with null checks. | ||
|
|
||
| Processes DNS override dictionaries from LocalDNS configuration, | ||
| filtering out null values and applying the build function to valid entries. | ||
|
|
||
| :param overrides_dict: Dictionary containing DNS overrides (can be None) | ||
| :param target_dict: Target dictionary to populate with processed overrides | ||
| :param build_override_func: Function to build override objects from dict values | ||
| """ | ||
| if overrides_dict is not None: | ||
| for key, value in overrides_dict.items(): | ||
| if value is not None: | ||
| target_dict[key] = build_override_func(value) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| { | ||
| "kubeDNSOverrides": { | ||
| ".": { | ||
| "cacheDurationInSeconds": 3600, | ||
| "forwardDestination": "ClusterCoreDNS", | ||
| "forwardPolicy": "Sequential", | ||
| "maxConcurrent": 1000, | ||
| "protocol": "PreferUDP", | ||
| "queryLogging": "Error", | ||
| "serveStale": "Immediate", | ||
| "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": "Immediate", | ||
| "serveStaleDurationInSeconds": 3600 | ||
| }, | ||
| "cluster.local": { | ||
| "cacheDurationInSeconds": 3600, | ||
| "forwardDestination": "ClusterCoreDNS", | ||
| "forwardPolicy": "Sequential", | ||
| "maxConcurrent": 1000, | ||
| "protocol": "ForceTCP", | ||
| "queryLogging": "Error", | ||
| "serveStale": "Immediate", | ||
| "serveStaleDurationInSeconds": 3600 | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "mode": "Disabled" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "mode": "" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "mode": "InvalidMode" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,4 +44,4 @@ | |
| "serveStaleDurationInSeconds": 3600 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| 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 | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "mode": null | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "mode": "Required", | ||
| "kubeDnsOverrides": {}, | ||
| "vnetDnsOverrides": {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "mode": "Required", | ||
| "extraProperty": "unexpected", | ||
| "kubeDnsOverrides": { | ||
| ".": { | ||
| "cacheDurationInSeconds": 3600, | ||
| "forwardDestination": "ClusterCoreDNS", | ||
| "forwardPolicy": "Sequential", | ||
| "maxConcurrent": 1000, | ||
| "protocol": "PreferUDP", | ||
| "queryLogging": "Error", | ||
| "serveStale": "Verify", | ||
| "serveStaleDurationInSeconds": 3600 | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "mode": "Required", | ||
| "kubeDnsOverrides": { | ||
| ".": { | ||
| "invalidField": 123 | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "mode": "Required", | ||
| "vnetDnsOverrides": { | ||
| ".": { | ||
| "invalidField": 456 | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "mode": "Required" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "mode": "Required", | ||
| "kubeDnsOverrides": { | ||
| ".": { | ||
| "cacheDurationInSeconds": 3600, | ||
| "forwardDestination": "ClusterCoreDNS", | ||
| "forwardPolicy": "Sequential", | ||
| "maxConcurrent": 1000, | ||
| "protocol": "PreferUDP", | ||
| "queryLogging": "Error", | ||
| "serveStale": "Verify", | ||
| "serveStaleDurationInSeconds": 3600 | ||
| } | ||
| }, | ||
| "vnetDnsOverrides": { | ||
| ".": "invalid" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "mode": "Required", | ||
| "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 | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "mode": "Required", | ||
| "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 | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please either choose a new version number or move your history notes to the pending section