@@ -27,6 +27,7 @@ import (
2727 "k8s.io/client-go/util/flowcontrol"
2828 "k8s.io/klog"
2929
30+ configv1 "github.com/openshift/api/config/v1"
3031 clientset "github.com/openshift/client-go/config/clientset/versioned"
3132 externalversions "github.com/openshift/client-go/config/informers/externalversions"
3233 "github.com/openshift/cluster-version-operator/pkg/autoupdate"
@@ -178,12 +179,13 @@ func (o *Options) run(ctx context.Context, controllerCtx *Context, lock *resourc
178179 OnStartedLeading : func (localCtx context.Context ) {
179180
180181 availableUpdatesTrigger := make (chan struct {}, 1 )
182+ availableUpdatesStatus := make (chan configv1.ClusterVersionStatus , 1 )
181183 errorChannelCount ++
182184 go func () {
183- errorChannel <- cvo .RunAvailableUpdates (runContext , shutdownContext , availableUpdatesTrigger )
185+ errorChannel <- cvo .RunAvailableUpdates (runContext , shutdownContext , availableUpdatesTrigger , availableUpdatesStatus )
184186 }()
185187
186- controllerCtx .Start (runContext , availableUpdatesTrigger )
188+ controllerCtx .Start (runContext , availableUpdatesTrigger , availableUpdatesStatus )
187189 select {
188190 case <- runContext .Done ():
189191 // WARNING: this is not completely safe until we have Kube 1.14 and ReleaseOnCancel
@@ -401,10 +403,10 @@ func (o *Options) NewControllerContext(cb *ClientBuilder) *Context {
401403
402404// Start launches the controllers in the provided context and any supporting
403405// infrastructure. When ch is closed the controllers will be shut down.
404- func (c * Context ) Start (ctx context.Context , availableUpdatesTrigger <- chan struct {}, availableUpdatesStatus - > .. ) {
406+ func (c * Context ) Start (ctx context.Context , availableUpdatesTrigger <- chan struct {}, availableUpdatesStatus chan - > configv1. ClusterVersionStatus ) {
405407 ch := ctx .Done ()
406408
407- go c .CVO .Run (ctx , 2 )
409+ go c .CVO .Run (ctx , availableUpdatesTrigger , availableUpdatesStatus )
408410 if c .AutoUpdate != nil {
409411 go c .AutoUpdate .Run (2 , ch )
410412 }
0 commit comments