Skip to content
Open
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
12 changes: 6 additions & 6 deletions pkg/asset/manifests/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,14 @@ func (i *Infrastructure) Generate(ctx context.Context, dependencies asset.Parent
config.Status.PlatformStatus.GCP.ResourceTags = resourceTags
}

// If the user has requested the use of a DNS provisioned by them, then OpenShift needs to
// start an in-cluster DNS for the installation to succeed. The user can then configure their
// DNS post-install.
// GCP defaults to ClusterHosted DNS, where the user provides their own DNS solution
// post-install. The installer starts an in-cluster DNS for the installation to succeed.
// If the user has explicitly disabled UserProvisionedDNS, use PlatformDefault instead.
config.Status.PlatformStatus.GCP.CloudLoadBalancerConfig = &configv1.CloudLoadBalancerConfig{
DNSType: configv1.PlatformDefaultDNSType,
DNSType: configv1.ClusterHostedDNSType,
}
if installConfig.Config.GCP.UserProvisionedDNS == dns.UserProvisionedDNSEnabled {
config.Status.PlatformStatus.GCP.CloudLoadBalancerConfig.DNSType = configv1.ClusterHostedDNSType
if installConfig.Config.GCP.UserProvisionedDNS == dns.UserProvisionedDNSDisabled {
config.Status.PlatformStatus.GCP.CloudLoadBalancerConfig.DNSType = configv1.PlatformDefaultDNSType
}
case ibmcloud.Name:
config.Spec.PlatformSpec.Type = configv1.IBMCloudPlatformType
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/manifests/infrastructure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestGenerateInfrastructure(t *testing.T) {
installConfig: icBuild.build(icBuild.forGCP()),
expectedInfrastructure: infraBuild.build(
infraBuild.forPlatform(configv1.GCPPlatformType),
infraBuild.withGCPClusterHostedDNS("Disabled"),
infraBuild.withGCPClusterHostedDNS("Enabled"),
),
expectedFilesGenerated: 2,
}, {
Expand Down
9 changes: 8 additions & 1 deletion pkg/types/gcp/defaults/platform.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
package defaults

import "github.com/openshift/installer/pkg/types/gcp"
import (
"github.com/openshift/installer/pkg/types/dns"
"github.com/openshift/installer/pkg/types/gcp"
)

// SetPlatformDefaults sets the defaults for the platform.
func SetPlatformDefaults(p *gcp.Platform) {
if p == nil {
return
}

if p.UserProvisionedDNS == "" {
p.UserProvisionedDNS = dns.UserProvisionedDNSEnabled
}

if gcpDmp := p.DefaultMachinePlatform; gcpDmp != nil {
if ek := gcpDmp.EncryptionKey; ek != nil {
if kms := ek.KMSKey; kms != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/types/gcp/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ type Platform struct {

// UserProvisionedDNS indicates if the customer is providing their own DNS solution in place of the default
// provisioned by the Installer.
// +kubebuilder:default:="Disabled"
// +default="Disabled"
// +kubebuilder:default:="Enabled"
// +default="Enabled"
// +kubebuilder:validation:Enum="Enabled";"Disabled"
UserProvisionedDNS dns.UserProvisionedDNS `json:"userProvisionedDNS,omitempty"`

Expand Down