-
Notifications
You must be signed in to change notification settings - Fork 223
OCPBUGS-43033: e2e/ingress_dns: support both private & public #1153
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 all commits
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 |
|---|---|---|
|
|
@@ -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" | ||
|
|
@@ -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 { | ||
|
Comment on lines
+55
to
+56
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. I would suggest adding
Member
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. I'm in favor of doing it as a follow-up with your help maybe. I've tried myself and I suspect I didn't get it right. |
||
| t.Fatalf("failed to get DNS config: %v", err) | ||
| } | ||
|
|
||
| // step 1 | ||
| expected := []configv1.ClusterOperatorStatusCondition{ | ||
| {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue}, | ||
|
|
||
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.
You should be able to remove the
Get(..., ..., &dnsConfig)above sinceTestMaininitializesdnsConfig, but we can keep it if you prefer to keep the test logic self-contained.For that matter, we should use
kclientthatTestMainalso initializes, but that can be left as a follow-up clean-up.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.
I'll try doing it here
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.
I'll follow-up with a PR to address both comments. That'll help me to iterate at the same time on my other PR for LB.
Thanks