Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions test/e2e/dns_ingressdegrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,27 @@ func TestIngressStatus(t *testing.T) {
}
}

// updateDNSConfig - utility to set/unset PrivateZone Tags/ID
// updateDNSConfig sets an invalid Tag or ID for the cluster DNS config's
// PrivateZone if the set argument is true and reverts the DNS config back to
// its original setting if the set argument is false.
func updateDNSConfig(set bool, dnsConfig *configv1.DNS) {
// Azure privateZone uses "/" notation the original error- prefix did not cause the privateZone to fail
// Tested on AWS and GCP
injectError := "/error"
// Tested on Azure, AWS, and GCP. Azure privateZone uses "/" notation,
// so prepending "error-" without "/" does not cause a failure on Azure.
const injectError = "/error"
if dnsConfig.Spec.PrivateZone.ID != "" {
if set {
dnsConfig.Spec.PrivateZone.ID = injectError + dnsConfig.Spec.PrivateZone.ID
} else {
// remove injectError from prefix
dnsConfig.Spec.PrivateZone.ID = dnsConfig.Spec.PrivateZone.ID[6:]
// Remove injectError from prefix.
dnsConfig.Spec.PrivateZone.ID = dnsConfig.Spec.PrivateZone.ID[len(injectError):]
}
}
if dnsConfig.Spec.PrivateZone.Tags["Name"] != "" {
if set {
dnsConfig.Spec.PrivateZone.Tags["Name"] = injectError + dnsConfig.Spec.PrivateZone.Tags["Name"]
} else {
// remove injectError from prefix
dnsConfig.Spec.PrivateZone.Tags["Name"] = dnsConfig.Spec.PrivateZone.Tags["Name"][6:]
// Remove injectError from prefix.
dnsConfig.Spec.PrivateZone.Tags["Name"] = dnsConfig.Spec.PrivateZone.Tags["Name"][len(injectError):]
}
}
}