@@ -10,6 +10,7 @@ import (
10
10
configv1 "github.com/openshift/api/config/v1"
11
11
operatorclient "github.com/openshift/cluster-ingress-operator/pkg/operator/client"
12
12
13
+ "sigs.k8s.io/controller-runtime/pkg/client"
13
14
"sigs.k8s.io/controller-runtime/pkg/client/config"
14
15
15
16
"k8s.io/apimachinery/pkg/types"
@@ -39,6 +40,23 @@ func TestIngressStatus(t *testing.T) {
39
40
t .Fatalf ("failed to get DNS config: %v" , err )
40
41
}
41
42
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
+
42
60
// step 1
43
61
expected := []configv1.ClusterOperatorStatusCondition {
44
62
{Type : configv1 .OperatorAvailable , Status : configv1 .ConditionTrue },
0 commit comments