Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/operator/controller/ingress/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func dnsRecordChanged(current, expected *iov1.DNSRecord) (bool, *iov1.DNSRecord)
}

// manageDNSForDomain returns true if the given domain contains the baseDomain
// of the cluster DNS config. It is only used for AWS in the beginning, and will be expanded to other clouds
// of the cluster DNS config. It is only used for AWS and GCP in the beginning, and will be expanded to other clouds
// once we know there are no users depending on this.
// See https://bugzilla.redhat.com/show_bug.cgi?id=2041616
func manageDNSForDomain(domain string, status *configv1.PlatformStatus, dnsConfig *configv1.DNS) bool {
Expand All @@ -210,7 +210,7 @@ func manageDNSForDomain(domain string, status *configv1.PlatformStatus, dnsConfi

mustContain := "." + dnsConfig.Spec.BaseDomain
switch status.Type {
case configv1.AWSPlatformType:
case configv1.AWSPlatformType, configv1.GCPPlatformType:
return strings.HasSuffix(domain, mustContain)
default:
return true
Expand Down
27 changes: 24 additions & 3 deletions pkg/operator/controller/ingress/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ func TestManageDNSForDomain(t *testing.T) {
expected: false,
},
{
name: "domain matches the baseDomain",
name: "domain matches the baseDomain on AWS",
domain: "apps.openshift.example.com",
baseDomain: "openshift.example.com",
platformType: configv1.AWSPlatformType,
expected: true,
},
{
name: "domain matches single segment baseDomain",
name: "domain matches single segment baseDomain on AWS",
domain: "openshift.example.com",
baseDomain: "example.com",
platformType: configv1.AWSPlatformType,
Expand All @@ -189,12 +189,33 @@ func TestManageDNSForDomain(t *testing.T) {
expected: false,
},
{
name: "domain does not match prematurely",
name: "domain does not match prematurely on AWS",
domain: "testopenshift.example.com",
baseDomain: "openshift.example.com",
platformType: configv1.AWSPlatformType,
expected: false,
},
{
name: "domain matches the baseDomain on GCP",
domain: "apps.openshift.example.com",
baseDomain: "openshift.example.com",
platformType: configv1.GCPPlatformType,
expected: true,
},
{
name: "domain does not match the baseDomain on GCP",
domain: "test.local",
baseDomain: "openshift.example.com",
platformType: configv1.GCPPlatformType,
expected: false,
},
{
name: "domain does not match prematurely on GCP",
domain: "testopenshift.example.com",
baseDomain: "openshift.example.com",
platformType: configv1.GCPPlatformType,
expected: false,
},
{
name: "domain does not match the baseDomain on unsupported platform",
domain: "test.local",
Expand Down