Skip to content

Commit 4b1cc71

Browse files
committed
Add tests that verify the EndpointPublishingStrategy
Add tests to verify value of EndpointPublishingStrategy on AWS platform when BYO DNS is enabled.
1 parent db05f51 commit 4b1cc71

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

pkg/operator/controller/ingress/controller_test.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,29 @@ func TestSetDefaultPublishingStrategySetsPlatformDefaults(t *testing.T) {
215215
}
216216
}
217217

218+
makeDefaultAWSPlatformStatus = func(platform configv1.PlatformType) *configv1.PlatformStatus {
219+
return &configv1.PlatformStatus{
220+
Type: platform,
221+
AWS: &configv1.AWSPlatformStatus{
222+
CloudLoadBalancerConfig: &configv1.CloudLoadBalancerConfig{
223+
DNSType: configv1.PlatformDefaultDNSType,
224+
},
225+
},
226+
}
227+
}
228+
229+
makeBYODNSAWSPlatformStatus = func(platform configv1.PlatformType) *configv1.PlatformStatus {
230+
return &configv1.PlatformStatus{
231+
Type: platform,
232+
AWS: &configv1.AWSPlatformStatus{
233+
CloudLoadBalancerConfig: &configv1.CloudLoadBalancerConfig{
234+
DNSType: configv1.ClusterHostedDNSType,
235+
ClusterHosted: &configv1.CloudLoadBalancerIPs{},
236+
},
237+
},
238+
}
239+
}
240+
218241
ingressConfigWithDefaultClassicLB = &configv1.Ingress{
219242
Spec: configv1.IngressSpec{
220243
LoadBalancer: configv1.LoadBalancer{
@@ -292,6 +315,18 @@ func TestSetDefaultPublishingStrategySetsPlatformDefaults(t *testing.T) {
292315
expectedIC: ingressControllerWithHostNetwork,
293316
domainMatchesBaseDomain: true,
294317
},
318+
{
319+
name: "AWS",
320+
platformStatus: makeDefaultAWSPlatformStatus(configv1.AWSPlatformType),
321+
expectedIC: ingressControllerWithLoadBalancer,
322+
domainMatchesBaseDomain: true,
323+
},
324+
{
325+
name: "AWS With BYO DNS",
326+
platformStatus: makeBYODNSAWSPlatformStatus(configv1.AWSPlatformType),
327+
expectedIC: ingressControllerWithLoadBalancerUnmanagedDNS,
328+
domainMatchesBaseDomain: true,
329+
},
295330
{
296331
name: "GCP",
297332
platformStatus: makeDefaultGCPPlatformStatus(configv1.GCPPlatformType),

0 commit comments

Comments
 (0)