Skip to content

Commit

Permalink
Merge pull request #1153 from shiftstack/e2e_dns_nil
Browse files Browse the repository at this point in the history
OCPBUGS-43033: e2e/ingress_dns: support both private & public
  • Loading branch information
openshift-merge-bot[bot] authored Oct 11, 2024
2 parents 6587d8c + 77fb903 commit 8bf1b36
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/e2e/dns_ingressdegrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
configv1 "github.com/openshift/api/config/v1"
operatorclient "github.com/openshift/cluster-ingress-operator/pkg/operator/client"

"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/config"

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

// Run DNS Config update tests on private and public zones when
// they are defined in the DNS config (which depends on the platform).
if dnsConfig.Spec.PrivateZone != nil {
t.Log("Testing private zone")
testUpdateDNSConfig(t, kubeClient)
}
if dnsConfig.Spec.PublicZone != nil {
t.Log("Testing public zone")
testUpdateDNSConfig(t, kubeClient)
}
}

func testUpdateDNSConfig(t *testing.T, kubeClient client.Client) {
if err := kubeClient.Get(context.TODO(), types.NamespacedName{Name: "cluster"}, &dnsConfig); err != nil {
t.Fatalf("failed to get DNS config: %v", err)
}

// step 1
expected := []configv1.ClusterOperatorStatusCondition{
{Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue},
Expand Down

0 comments on commit 8bf1b36

Please sign in to comment.