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
2 changes: 1 addition & 1 deletion pkg/asset/installconfig/gcp/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func validatePreexistingServiceAccount(client API, ic *types.InstallConfig) fiel
// checked for any public zone that can be used.
func ValidatePreExistingPublicDNS(client API, ic *types.InstallConfig) field.ErrorList {
// If this is an internal cluster, this check is not necessary
if ic.Publish == types.InternalPublishingStrategy {
if ic.Publish == types.InternalPublishingStrategy || ic.GCP.UserProvisionedDNS == dnstypes.UserProvisionedDNSEnabled {
return nil
}
allErrs := field.ErrorList{}
Expand Down
8 changes: 8 additions & 0 deletions pkg/asset/installconfig/gcp/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/openshift/installer/pkg/asset/installconfig/gcp/mock"
"github.com/openshift/installer/pkg/ipnet"
"github.com/openshift/installer/pkg/types"
customDNS "github.com/openshift/installer/pkg/types/dns"
"github.com/openshift/installer/pkg/types/gcp"
)

Expand Down Expand Up @@ -116,6 +117,7 @@ var (
validateXpnSA = func(ic *types.InstallConfig) { ic.ControlPlane.Platform.GCP.ServiceAccount = validXpnSA }
invalidateXpnSA = func(ic *types.InstallConfig) { ic.ControlPlane.Platform.GCP.ServiceAccount = invalidXpnSA }
invalidateBaseDomain = func(ic *types.InstallConfig) { ic.BaseDomain = invalidBaseDomain }
enableCustomDNS = func(ic *types.InstallConfig) { ic.GCP.UserProvisionedDNS = customDNS.UserProvisionedDNSEnabled }

validServiceEndpoint = func(ic *types.InstallConfig) {
ic.Publish = types.InternalPublishingStrategy
Expand Down Expand Up @@ -485,6 +487,12 @@ func TestGCPInstallConfigValidation(t *testing.T) {
expectedError: true,
expectedErrMsg: `baseDomain: Not found: "invalid.installer.domain."`,
},
{
name: "Custom DNS does not require existing base domain",
edits: editFunctions{enableCustomDNS, invalidateBaseDomain},
records: []*dns.ResourceRecordSet{},
expectedError: false,
},
}
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
Expand Down