Skip to content

Commit

Permalink
operator: start externaloidc controller behind a featuregates accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
liouk committed Nov 19, 2024
1 parent 5f4ea32 commit 36820a6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/operator/replacement_starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ import (
operatorinformer "github.com/openshift/client-go/operator/informers/externalversions"
routeclient "github.com/openshift/client-go/route/clientset/versioned"
routeinformer "github.com/openshift/client-go/route/informers/externalversions"
"github.com/openshift/cluster-authentication-operator/pkg/controllers/externaloidc"
"github.com/openshift/library-go/pkg/controller/controllercmd"
libgoetcd "github.com/openshift/library-go/pkg/operator/configobserver/etcd"
"github.com/openshift/library-go/pkg/operator/configobserver/featuregates"
"github.com/openshift/library-go/pkg/operator/events"
"github.com/openshift/library-go/pkg/operator/genericoperatorclient"
"github.com/openshift/library-go/pkg/operator/loglevel"
Expand Down Expand Up @@ -318,5 +320,24 @@ func CreateOperatorStarter(ctx context.Context, authOperatorInput *authenticatio
ret.ControllerRunFns = append(ret.ControllerRunFns, oauthAPIServerRunFns...)
ret.ControllerNamedRunOnceFns = append(ret.ControllerNamedRunOnceFns, oauthAPIServerRunOnceFns...)

// OIDC
featureGateAccessor := featuregates.NewFeatureGateAccess(
status.VersionForOperatorFromEnv(), "0.0.1-snapshot",
informerFactories.operatorConfigInformer.Config().V1().ClusterVersions(),
informerFactories.operatorConfigInformer.Config().V1().FeatureGates(),
authOperatorInput.eventRecorder,
)
go featureGateAccessor.Run(ctx)
externalOIDCController := externaloidc.NewExternalOIDCController(
featureGateAccessor,
informerFactories.kubeInformersForNamespaces,
informerFactories.operatorConfigInformer,
authOperatorInput.authenticationOperatorClient,
authOperatorInput.kubeClient.CoreV1(),
authOperatorInput.eventRecorder,
)
ret.ControllerRunFns = append(ret.ControllerRunFns, libraryapplyconfiguration.AdaptRunFn(externalOIDCController.Run))
ret.ControllerNamedRunOnceFns = append(ret.ControllerNamedRunOnceFns, libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-other-externalOIDCController", externalOIDCController.Sync))

return ret, nil
}

0 comments on commit 36820a6

Please sign in to comment.