Skip to content

Commit 877cbdd

Browse files
committed
added iri controller
1 parent 0bf9347 commit 877cbdd

File tree

4 files changed

+384
-9
lines changed

4 files changed

+384
-9
lines changed

cmd/machine-config-controller/start.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
1414
containerruntimeconfig "github.com/openshift/machine-config-operator/pkg/controller/container-runtime-config"
1515
"github.com/openshift/machine-config-operator/pkg/controller/drain"
16+
"github.com/openshift/machine-config-operator/pkg/controller/internalreleaseimage"
1617
kubeletconfig "github.com/openshift/machine-config-operator/pkg/controller/kubelet-config"
1718
machinesetbootimage "github.com/openshift/machine-config-operator/pkg/controller/machine-set-boot-image"
1819
"github.com/openshift/machine-config-operator/pkg/controller/node"
@@ -128,6 +129,18 @@ func runStartCmd(_ *cobra.Command, _ []string) {
128129
ctrlctx.InformerFactory.Start(ctrlctx.Stop)
129130
}
130131

132+
if ctrlctx.FeatureGatesHandler.Enabled(features.FeatureGateNoRegistryClusterInstall) {
133+
iriController := internalreleaseimage.New(
134+
ctrlctx.InformerFactory.Machineconfiguration().V1alpha1().InternalReleaseImages(),
135+
ctrlctx.ClientBuilder.KubeClientOrDie("internalreleaseimage-controller"),
136+
ctrlctx.ClientBuilder.MachineConfigClientOrDie("internalreleaseimage-controller"))
137+
138+
go iriController.Run(2, ctrlctx.Stop)
139+
// start the informers again to enable feature gated types.
140+
// see comments in SharedInformerFactory interface.
141+
ctrlctx.InformerFactory.Start(ctrlctx.Stop)
142+
}
143+
131144
if ctrlcommon.IsBootImageControllerRequired(ctrlctx) {
132145
machineSetBootImage := machinesetbootimage.New(
133146
ctrlctx.ClientBuilder.KubeClientOrDie("machine-set-boot-image-controller"),

pkg/controller/bootstrap/bootstrap.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,13 @@ func (b *Bootstrap) Run(destDir string) error {
253253

254254
if fgHandler != nil && fgHandler.Enabled(features.FeatureGateNoRegistryClusterInstall) {
255255
if iri != nil {
256-
iriConfigs, err := internalreleaseimage.RunInternalReleaseImageBootstrap(cconfig)
256+
iriConfig, err := internalreleaseimage.RunInternalReleaseImageBootstrap(iri)
257257
if err != nil {
258258
return err
259259
}
260-
configs = append(configs, iriConfigs...)
260+
configs = append(configs, iriConfig)
261261
}
262-
klog.Infof("Successfully generated MachineConfigs from InternalReleaseImage.")
262+
klog.Infof("Successfully generated MachineConfig from InternalReleaseImage.")
263263
}
264264

265265
// Create component MachineConfigs for pre-built images for hybrid OCL

pkg/controller/internalreleaseimage/internalreleaseimage_bootstrap.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package internalreleaseimage
22

33
import (
44
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
5+
mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1"
56
)
67

78
// RunInternalReleaseImageBootstrap generates a MachineConfig object for InternalReleaseImage that would have been generated by syncInternalReleaseImage
8-
func RunInternalReleaseImageBootstrap(controllerConfig *mcfgv1.ControllerConfig) ([]*mcfgv1.MachineConfig, error) {
9-
return generateInternalReleaseImageMachineConfig(controllerConfig)
9+
func RunInternalReleaseImageBootstrap(iri *mcfgv1alpha1.InternalReleaseImage) (*mcfgv1.MachineConfig, error) {
10+
return generateInternalReleaseImageMachineConfig(iri)
1011
}

0 commit comments

Comments
 (0)