Skip to content

Commit

Permalink
Augment renderConfig with the External and Internal API LB IPs
Browse files Browse the repository at this point in the history
When installing on cloud plaforms with `userConfiguredDNS` enabled,
the Installer will provide the MCO instance running on the bootstrap
node with a ConfigMap containing the Internal and External LB IPs.
These IPs are added to renderConfig.
  • Loading branch information
sadasu committed Nov 15, 2023
1 parent 586d9ae commit 2ee615c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions pkg/operator/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type renderConfig struct {
Infra configv1.Infrastructure
Constants map[string]string
PointerConfig string
CloudIntLBIPs []string
CloudExtLBIPs []string
}

type assetRenderer struct {
Expand Down Expand Up @@ -351,3 +353,15 @@ func onPremPlatformAPIServerInternalIPs(cfg mcfgv1.ControllerConfigSpec) (interf
}
return nil, fmt.Errorf("")
}

func cloudPlatformShortName(cfg mcfgv1.ControllerConfigSpec) interface{} {
if cfg.Infra.Status.PlatformStatus != nil {
switch cfg.Infra.Status.PlatformStatus.Type {
case configv1.GCPPlatformType:
return "gcp"
default:
return ""
}
}
return ""
}
6 changes: 4 additions & 2 deletions pkg/operator/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ func (optr *Operator) syncRenderConfig(_ *renderConfig) error {
}

// create renderConfig
optr.renderConfig = getRenderConfig(optr.namespace, string(kubeAPIServerServingCABytes), spec, &imgs.RenderConfigImages, infra.Status.APIServerInternalURL, pointerConfigData)
optr.renderConfig = getRenderConfig(optr.namespace, string(kubeAPIServerServingCABytes), spec, &imgs.RenderConfigImages, infra.Status.APIServerInternalURL, pointerConfigData, nil, nil)
return nil
}

Expand Down Expand Up @@ -1492,7 +1492,7 @@ func setGVK(obj runtime.Object, scheme *runtime.Scheme) error {
return nil
}

func getRenderConfig(tnamespace, kubeAPIServerServingCA string, ccSpec *mcfgv1.ControllerConfigSpec, imgs *RenderConfigImages, apiServerURL string, pointerConfigData []byte) *renderConfig {
func getRenderConfig(tnamespace, kubeAPIServerServingCA string, ccSpec *mcfgv1.ControllerConfigSpec, imgs *RenderConfigImages, apiServerURL string, pointerConfigData []byte, cloudIntLBIPs []string, cloudExtLBIPs []string) *renderConfig {
return &renderConfig{
TargetNamespace: tnamespace,
Version: version.Raw,
Expand All @@ -1502,6 +1502,8 @@ func getRenderConfig(tnamespace, kubeAPIServerServingCA string, ccSpec *mcfgv1.C
KubeAPIServerServingCA: kubeAPIServerServingCA,
APIServerURL: apiServerURL,
PointerConfig: string(pointerConfigData),
CloudIntLBIPs: cloudIntLBIPs,
CloudExtLBIPs: cloudExtLBIPs,
}
}

Expand Down

0 comments on commit 2ee615c

Please sign in to comment.