Skip to content

Commit f463bd6

Browse files
committed
cvo: Add config-file flag
1 parent c410434 commit f463bd6

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

cmd/cluster-version-operator/start.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func init() {
3131

3232
cmd.PersistentFlags().StringVar(&opts.ListenAddr, "listen", opts.ListenAddr, "Address to listen on for metrics")
3333
cmd.PersistentFlags().StringVar(&opts.Kubeconfig, "kubeconfig", opts.Kubeconfig, "Kubeconfig file to access a remote cluster (testing only)")
34+
cmd.PersistentFlags().StringVar(&opts.ConfigFile, "config-file", opts.ConfigFile, "Configuration file for the CVO (represented by a clusterversionoperators.operator.openshift.io manifest file). DevPreview functionality.")
3435
cmd.PersistentFlags().StringVar(&opts.NodeName, "node-name", opts.NodeName, "kubernetes node name CVO is scheduled on.")
3536
cmd.PersistentFlags().BoolVar(&opts.EnableAutoUpdate, "enable-auto-update", opts.EnableAutoUpdate, "Enables the autoupdate controller.")
3637
cmd.PersistentFlags().StringVar(&opts.ReleaseImage, "release-image", opts.ReleaseImage, "The Openshift release image url.")

pkg/cvo/cvo.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ type Operator struct {
183183
// always be implicitly enabled.
184184
alwaysEnableCapabilities []configv1.ClusterVersionCapability
185185

186+
// configFile is a path to a ClusterVersionOperator configuration file
187+
configFile string
188+
186189
// configuration, if enabled, reconciles the ClusterVersionOperator configuration.
187190
configuration *configuration.ClusterVersionOperatorConfiguration
188191
}
@@ -209,6 +212,7 @@ func New(
209212
promqlTarget clusterconditions.PromQLTarget,
210213
injectClusterIdIntoPromQL bool,
211214
updateService string,
215+
configFile string,
212216
alwaysEnableCapabilities []configv1.ClusterVersionCapability,
213217
) (*Operator, error) {
214218
eventBroadcaster := record.NewBroadcaster()
@@ -237,6 +241,7 @@ func New(
237241
availableUpdatesQueue: workqueue.NewTypedRateLimitingQueueWithConfig[any](workqueue.DefaultTypedControllerRateLimiter[any](), workqueue.TypedRateLimitingQueueConfig[any]{Name: "availableupdates"}),
238242
upgradeableQueue: workqueue.NewTypedRateLimitingQueueWithConfig[any](workqueue.DefaultTypedControllerRateLimiter[any](), workqueue.TypedRateLimitingQueueConfig[any]{Name: "upgradeable"}),
239243

244+
configFile: configFile,
240245
hypershift: hypershift,
241246
exclude: exclude,
242247
clusterProfile: clusterProfile,

pkg/start/start.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ type Options struct {
6464
ServingKeyFile string
6565

6666
Kubeconfig string
67+
ConfigFile string
6768
NodeName string
6869
ListenAddr string
6970

@@ -517,6 +518,7 @@ func (o *Options) NewControllerContext(cb *ClientBuilder) (*Context, error) {
517518
o.PromQLTarget,
518519
o.InjectClusterIdIntoPromQL,
519520
o.UpdateService,
521+
o.ConfigFile,
520522
stringsToCapabilities(o.AlwaysEnableCapabilities),
521523
)
522524
if err != nil {

0 commit comments

Comments
 (0)