Skip to content

Commit 8bf1b36

Browse files
Merge pull request #1153 from shiftstack/e2e_dns_nil
OCPBUGS-43033: e2e/ingress_dns: support both private & public
2 parents 6587d8c + 77fb903 commit 8bf1b36

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/e2e/dns_ingressdegrade_test.go

+18
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
configv1 "github.com/openshift/api/config/v1"
1111
operatorclient "github.com/openshift/cluster-ingress-operator/pkg/operator/client"
1212

13+
"sigs.k8s.io/controller-runtime/pkg/client"
1314
"sigs.k8s.io/controller-runtime/pkg/client/config"
1415

1516
"k8s.io/apimachinery/pkg/types"
@@ -39,6 +40,23 @@ func TestIngressStatus(t *testing.T) {
3940
t.Fatalf("failed to get DNS config: %v", err)
4041
}
4142

43+
// Run DNS Config update tests on private and public zones when
44+
// they are defined in the DNS config (which depends on the platform).
45+
if dnsConfig.Spec.PrivateZone != nil {
46+
t.Log("Testing private zone")
47+
testUpdateDNSConfig(t, kubeClient)
48+
}
49+
if dnsConfig.Spec.PublicZone != nil {
50+
t.Log("Testing public zone")
51+
testUpdateDNSConfig(t, kubeClient)
52+
}
53+
}
54+
55+
func testUpdateDNSConfig(t *testing.T, kubeClient client.Client) {
56+
if err := kubeClient.Get(context.TODO(), types.NamespacedName{Name: "cluster"}, &dnsConfig); err != nil {
57+
t.Fatalf("failed to get DNS config: %v", err)
58+
}
59+
4260
// step 1
4361
expected := []configv1.ClusterOperatorStatusCondition{
4462
{Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue},

0 commit comments

Comments
 (0)