Skip to content

Commit

Permalink
run featuregateaccessor
Browse files Browse the repository at this point in the history
  • Loading branch information
vrutkovs committed Aug 8, 2024
1 parent 18d0325 commit a74b8aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion pkg/controller/servingcert/starter/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func StartServiceServingCertSigner(ctx context.Context, controllerContext *contr

configInformers := configexternalinformers.NewSharedInformerFactory(configClient, 10*time.Minute)

stopChan := ctx.Done()
klog.Infof("ShortCertRotation: fetching FeatureGates")
desiredVersion := status.VersionForOperatorFromEnv()
missingVersion := "0.0.1-snapshot"
Expand All @@ -61,6 +62,9 @@ func StartServiceServingCertSigner(ctx context.Context, controllerContext *contr
configInformers.Config().V1().ClusterVersions(), configInformers.Config().V1().FeatureGates(),
controllerContext.EventRecorder,
)
configInformers.Start(stopChan)
go featureGateAccessor.Run(ctx)

var featureGates featuregates.FeatureGate
select {
case <-featureGateAccessor.InitialFeatureGatesObserved():
Expand Down Expand Up @@ -104,7 +108,6 @@ func StartServiceServingCertSigner(ctx context.Context, controllerContext *contr
certificateLifetime,
)

stopChan := ctx.Done()
kubeInformers.Start(stopChan)

go servingCertController.Run(ctx, 5)
Expand Down
8 changes: 4 additions & 4 deletions pkg/operator/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func RunOperator(ctx context.Context, controllerContext *controllercmd.Controlle
controllerContext.EventRecorder,
)

stopChan := ctx.Done()
klog.Infof("ShortCertRotation: fetching FeatureGates")
desiredVersion := status.VersionForOperatorFromEnv()
missingVersion := "0.0.1-snapshot"
Expand All @@ -113,6 +114,9 @@ func RunOperator(ctx context.Context, controllerContext *controllercmd.Controlle
configInformers.Config().V1().ClusterVersions(), configInformers.Config().V1().FeatureGates(),
controllerContext.EventRecorder,
)
configInformers.Start(stopChan)
go featureGateAccessor.Run(ctx)

var featureGates featuregates.FeatureGate
select {
case <-featureGateAccessor.InitialFeatureGatesObserved():
Expand Down Expand Up @@ -144,11 +148,8 @@ func RunOperator(ctx context.Context, controllerContext *controllercmd.Controlle
signingCertificateLifetime,
)

stopChan := ctx.Done()

for _, informerStarter := range []func(<-chan struct{}){
operatorConfigInformers.Start,
configInformers.Start,
kubeInformersNamespaced.Start,
kubeInformersForNamespaces.Start,
} {
Expand All @@ -163,7 +164,6 @@ func RunOperator(ctx context.Context, controllerContext *controllercmd.Controlle
} {
go controllerRunner(ctx, 1)
}

<-stopChan
return nil
}

0 comments on commit a74b8aa

Please sign in to comment.