Last active
April 16, 2024 13:44
-
-
Save hexfusion/77df57751b24f4109030bdb922842405 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
featureGateAccessor := featuregates.NewFeatureGateAccess( | |
desiredVersion, missingVersion, | |
configSharedInformer.Config().V1().ClusterVersions(), configSharedInformer.Config().V1().FeatureGates(), | |
recorder, | |
) | |
go featureGateAccessor.Run(ctx) | |
// dep for feature gate | |
ctrlctx.ConfigInformerFactory.Start(ctrlctx.Stop) | |
// contains featuregated api's | |
ctrlctx.InformerFactory.Start(stopCh) | |
featureGates, err := ctrlctx.FeatureGateAccess.CurrentFeatureGates() | |
if err != nil { | |
klog.Fatalf("Could not get FG: %v", err) | |
} else { | |
klog.Infof("FeatureGates initialized: knownFeatureGates=%v", featureGates.KnownFeatures()) | |
if featureGates.Enabled(configv1.FeatureGatePinnedImages) { | |
ctlr := daemon.NewController( | |
ctrlctx.InformerFactory.Machineconfiguration().V1alpha1().PinnedImageSets(), | |
) | |
go ctrl.Run(2, stopCh) // Waits for imageSetInformer.Informer().HasSynced forever. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment