Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions pkg/operator/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import (
"github.com/openshift/library-go/pkg/operator/resourcesynccontroller"
"github.com/openshift/library-go/pkg/operator/revisioncontroller"
"github.com/openshift/library-go/pkg/operator/staleconditions"
"github.com/openshift/library-go/pkg/operator/staticpod/controller/guard"
"github.com/openshift/library-go/pkg/operator/staticpod/controller/revision"
"github.com/openshift/library-go/pkg/operator/staticresourcecontroller"
"github.com/openshift/library-go/pkg/operator/status"
Expand Down Expand Up @@ -528,6 +529,8 @@ func prepareOauthAPIServerOperator(ctx context.Context, controllerContext *contr

const apiServerConditionsPrefix = "APIServer"

infraLister := operatorCtx.operatorConfigInformer.Config().V1().Infrastructures().Lister()

apiServerControllers, err := apiservercontrollerset.NewAPIServerControllerSet(
operatorCtx.operatorClient,
eventRecorder,
Expand Down Expand Up @@ -556,10 +559,29 @@ func prepareOauthAPIServerOperator(ctx context.Context, controllerContext *contr
"oauth-apiserver/sa.yaml",
"oauth-apiserver/RBAC/useroauthaccesstokens_binding.yaml",
"oauth-apiserver/RBAC/useroauthaccesstokens_clusterrole.yaml",
},
},
{
Files: []string{
"oauth-apiserver/oauth-apiserver-pdb.yaml",
},
ShouldCreateFn: func() bool {
isSno, err := guard.IsSNOCheckFnc(infraLister)()
if err != nil {
return false
}
return !isSno
},
ShouldDeleteFn: func() bool {
isSno, err := guard.IsSNOCheckFnc(infraLister)()
if err != nil {
Copy link
Contributor

@deads2k deads2k Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll have a nicer time if you make the IsSNOCheckFnc only return a bool. I won't quibble though. I bet if you make it, they will come :)

return false
}
return isSno
},
},
},

operatorCtx.kubeInformersForNamespaces,
operatorCtx.kubeClient,
).WithRevisionController(
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading