Skip to content

Commit 1b20021

Browse files
Merge pull request #5241 from umohnani8/fg-2
OCPBUGS-60287: Remove OnClusterBuild FG
2 parents 9fe5860 + e167c3a commit 1b20021

File tree

89 files changed

+1393
-3664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1393
-3664
lines changed

cmd/machine-config-controller/start.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ func runStartCmd(_ *cobra.Command, _ []string) {
105105
ctrlctx.ConfigInformerFactory.Start(ctrlctx.Stop)
106106
ctrlctx.KubeNamespacedInformerFactory.Start(ctrlctx.Stop)
107107
ctrlctx.KubeMAOSharedInformer.Start(ctrlctx.Stop)
108+
ctrlctx.OCLInformerFactory.Start(ctrlctx.Stop)
108109

109110
close(ctrlctx.InformersStarted)
110111

@@ -146,10 +147,6 @@ func runStartCmd(_ *cobra.Command, _ []string) {
146147
ctrlctx.OperatorInformerFactory.Start(ctrlctx.Stop)
147148
}
148149

149-
if ctrlctx.FeatureGatesHandler.Enabled(features.FeatureGateOnClusterBuild) {
150-
ctrlctx.OCLInformerFactory.Start(ctrlctx.Stop)
151-
}
152-
153150
for _, c := range controllers {
154151
go c.Run(2, ctrlctx.Stop)
155152
}

cmd/machine-config-operator/start.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ func runStartCmd(_ *cobra.Command, _ []string) {
105105
ctrlctx.InformerFactory.Machineconfiguration().V1().ContainerRuntimeConfigs(),
106106
ctrlctx.ConfigInformerFactory.Config().V1().Nodes(),
107107
ctrlctx.ConfigInformerFactory.Config().V1().APIServers(),
108+
ctrlctx.NamespacedInformerFactory.Machineconfiguration().V1().MachineOSConfigs(),
108109
ctrlctx,
109110
)
110111

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package rollout
22

33
import (
4-
mcfgv1 "github.com/openshift/api/machineconfiguration/v1alpha1"
4+
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
55
daemonconsts "github.com/openshift/machine-config-operator/pkg/daemon/constants"
66
corev1 "k8s.io/api/core/v1"
77
)
@@ -11,5 +11,5 @@ func isNodeImageEqualToMachineOSConfig(node corev1.Node, mosc *mcfgv1.MachineOSC
1111
current := node.Annotations[daemonconsts.CurrentImageAnnotationKey]
1212
mcdState := node.Annotations[daemonconsts.MachineConfigDaemonStateAnnotationKey]
1313

14-
return desired == current && mcdState == daemonconsts.MachineConfigDaemonStateDone && current == mosc.Status.CurrentImagePullspec
14+
return desired == current && mcdState == daemonconsts.MachineConfigDaemonStateDone && current == string(mosc.Status.CurrentImagePullSpec)
1515
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ require (
3333
github.com/onsi/gomega v1.36.2
3434
github.com/opencontainers/go-digest v1.0.0
3535
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250722101414-8083129ab8f9
36-
github.com/openshift/api v0.0.0-20250729005210-6d3c4e25a8d3
37-
github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee
36+
github.com/openshift/api v0.0.0-20250808142411-c974eeafe3f1
37+
github.com/openshift/client-go v0.0.0-20250811113315-c2dfb51e2d06
3838
github.com/openshift/library-go v0.0.0-20250729191057-91376e1b394e
3939
github.com/openshift/runtime-utils v0.0.0-20230921210328-7bdb5b9c177b
4040
github.com/prometheus/client_golang v1.22.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,10 @@ github.com/opencontainers/selinux v1.12.0 h1:6n5JV4Cf+4y0KNXW48TLj5DwfXpvWlxXplU
589589
github.com/opencontainers/selinux v1.12.0/go.mod h1:BTPX+bjVbWGXw7ZZWUbdENt8w0htPSrlgOOysQaU62U=
590590
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250722101414-8083129ab8f9 h1:4ZeSM80DVCb5WWB3Q/fyCI9jYXAl9bfrGnFvFONqzN4=
591591
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250722101414-8083129ab8f9/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M=
592-
github.com/openshift/api v0.0.0-20250729005210-6d3c4e25a8d3 h1:znf+iTwtLKxDQRwZIgjmevBRXZpWwpLhJe/AtYIPiLE=
593-
github.com/openshift/api v0.0.0-20250729005210-6d3c4e25a8d3/go.mod h1:SPLf21TYPipzCO67BURkCfK6dcIIxx0oNRVWaOyRcXM=
594-
github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee h1:tOtrrxfDEW8hK3eEsHqxsXurq/D6LcINGfprkQC3hqY=
595-
github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee/go.mod h1:zhRiYyNMk89llof2qEuGPWPD+joQPhCRUc2IK0SB510=
592+
github.com/openshift/api v0.0.0-20250808142411-c974eeafe3f1 h1:VElrUno5AG2Zl6M+2pYPiXXPfNGpeb+0v95sl8AAczw=
593+
github.com/openshift/api v0.0.0-20250808142411-c974eeafe3f1/go.mod h1:SPLf21TYPipzCO67BURkCfK6dcIIxx0oNRVWaOyRcXM=
594+
github.com/openshift/client-go v0.0.0-20250811113315-c2dfb51e2d06 h1:YZypdxXWxQJ2RZ6k81WG8L8YLuCb4DfKTRobsWOwJ3c=
595+
github.com/openshift/client-go v0.0.0-20250811113315-c2dfb51e2d06/go.mod h1:cfPRVHYr1OaL3MDJsq06boe4ekUDbAkyAvhNwNPruS4=
596596
github.com/openshift/kubernetes v1.30.1-0.20250716113245-b94367cabf3e h1:M5BrUTglTltZjcRz5ouJBqSw0a60p760Bl520ndOGS0=
597597
github.com/openshift/kubernetes v1.30.1-0.20250716113245-b94367cabf3e/go.mod h1:GwUMe2E0Dqe2YN/Nkg9QWNBktqiTR7y+HFxcIWKshXI=
598598
github.com/openshift/kubernetes/staging/src/k8s.io/api v0.0.0-20250716113245-b94367cabf3e h1:Y70IDoOnCCKQT4lIJxx2KkTifLuqD/vjRrzo1DxZ/iw=

pkg/controller/node/node_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ func getErrorString(err error) string {
15091509
}
15101510

15111511
func (ctrl *Controller) isLayeredPool(mosc *mcfgv1.MachineOSConfig, mosb *mcfgv1.MachineOSBuild) bool {
1512-
return ctrl.isConfigOrBuildPresent(mosc, mosb) && ctrl.fgHandler.Enabled(features.FeatureGateOnClusterBuild)
1512+
return ctrl.isConfigOrBuildPresent(mosc, mosb)
15131513
}
15141514

15151515
func (ctrl *Controller) isConfigOrBuildPresent(mosc *mcfgv1.MachineOSConfig, mosb *mcfgv1.MachineOSBuild) bool {

pkg/controller/node/node_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func newFixtureWithFeatureGates(t *testing.T, enabled, disabled []configv1.Featu
9595
}
9696

9797
func newFixture(t *testing.T) *fixture {
98-
return newFixtureWithFeatureGates(t, []configv1.FeatureGateName{features.FeatureGatePinnedImages, features.FeatureGateOnClusterBuild}, []configv1.FeatureGateName{})
98+
return newFixtureWithFeatureGates(t, []configv1.FeatureGateName{features.FeatureGatePinnedImages}, []configv1.FeatureGateName{})
9999
}
100100

101101
func (f *fixture) newControllerWithStopChan(stopCh <-chan struct{}) *Controller {

pkg/operator/operator.go

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ func New(
188188
crcInformer mcfginformersv1.ContainerRuntimeConfigInformer,
189189
nodeClusterInformer configinformersv1.NodeInformer,
190190
apiserverInformer configinformersv1.APIServerInformer,
191+
moscInformer mcfginformersv1.MachineOSConfigInformer,
191192
ctrlctx *ctrlcommon.ControllerContext,
192193
) *Operator {
193194
eventBroadcaster := record.NewBroadcaster()
@@ -256,6 +257,7 @@ func New(
256257
nodeClusterInformer.Informer(),
257258
clusterOperatorInformer.Informer(),
258259
apiserverInformer.Informer(),
260+
moscInformer.Informer(),
259261
}
260262
for _, i := range informers {
261263
i.AddEventHandler(optr.eventHandler())
@@ -318,6 +320,8 @@ func New(
318320
optr.crcListerSynced = crcInformer.Informer().HasSynced
319321
optr.apiserverLister = apiserverInformer.Lister()
320322
optr.apiserverListerSynced = apiserverInformer.Informer().HasSynced
323+
optr.moscLister = moscInformer.Lister()
324+
optr.moscListerSynced = moscInformer.Informer().HasSynced
321325

322326
optr.vStore.Set("operator", version.ReleaseVersion)
323327
optr.vStore.Set("operator-image", version.OperatorImage)
@@ -369,18 +373,7 @@ func (optr *Operator) Run(workers int, stopCh <-chan struct{}) {
369373
optr.mckListerSynced,
370374
optr.crcListerSynced,
371375
optr.nodeClusterListerSynced,
372-
}
373-
374-
if optr.isOnClusterBuildFeatureGateEnabled() {
375-
klog.Infof("On-cluster layering featuregate enabled, starting MachineOSConfig informer")
376-
moscInformer := optr.ctrlctx.InformerFactory.Machineconfiguration().V1().MachineOSConfigs()
377-
optr.moscLister = moscInformer.Lister()
378-
optr.moscListerSynced = moscInformer.Informer().HasSynced
379-
cacheSynced = append(cacheSynced, optr.moscListerSynced)
380-
moscInformer.Informer().AddEventHandler(optr.eventHandler())
381-
// We have to start this inofrmer ourselves because the caller has started
382-
// all of the other informers before calling Run().
383-
go moscInformer.Informer().Run(optr.ctrlctx.Stop)
376+
optr.moscListerSynced,
384377
}
385378

386379
if !cache.WaitForCacheSync(stopCh,

pkg/operator/sync.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,11 +1206,6 @@ func (optr *Operator) syncMachineOSBuilder(config *renderConfig, _ *configv1.Clu
12061206
// Determines if the Machine OS Builder deployment is in the correct state
12071207
// based upon whether we have opted-in pools or not.
12081208
func (optr *Operator) reconcileMachineOSBuilder(mob *appsv1.Deployment) error {
1209-
// Check if OnClusterBuild feature gate is enabled
1210-
if !optr.fgHandler.Enabled(features.FeatureGateOnClusterBuild) {
1211-
return nil
1212-
}
1213-
12141209
// First, check if we have any MachineConfigPools opted in.
12151210
layeredMCPs, err := optr.getLayeredMachineConfigPools()
12161211
if err != nil {
@@ -2303,11 +2298,6 @@ func (optr *Operator) syncMachineConfiguration(_ *renderConfig, _ *configv1.Clus
23032298
return nil
23042299
}
23052300

2306-
// Determines if the OnclusterBuild FeatureGate is enabled.
2307-
func (optr *Operator) isOnClusterBuildFeatureGateEnabled() bool {
2308-
return optr.fgHandler.Enabled(features.FeatureGateOnClusterBuild)
2309-
}
2310-
23112301
// Determines if this cluster is on a platform that opts in for boot images by default
23122302
func (optr *Operator) isDefaultOnBootImageUpdatePlatform() (bool, error) {
23132303
infra, err := optr.infraLister.Get("cluster")

test/extended/mco_ocb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
logger "github.com/openshift/machine-config-operator/test/extended/util/logext"
1010
)
1111

12-
var _ = g.Describe("[sig-mco][Suite:openshift/machine-config-operator/disruptive][OCPFeatureGate:OnClusterBuild][Serial][Disruptive] MCO ocb", func() {
12+
var _ = g.Describe("[sig-mco][Suite:openshift/machine-config-operator/disruptive][Serial][Disruptive] MCO ocb", func() {
1313
defer g.GinkgoRecover()
1414

1515
var (

0 commit comments

Comments
 (0)