-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3369227
commit 3eb1049
Showing
5 changed files
with
57 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,50 @@ | ||
package controller | ||
|
||
import "github.com/openshift/openshift-controller-manager/pkg/authorization/defaultrolebindings" | ||
import ( | ||
"github.com/openshift/openshift-controller-manager/pkg/authorization/defaultrolebindings" | ||
"k8s.io/client-go/kubernetes" | ||
) | ||
|
||
func RunDefaultRoleBindingController(ctx *ControllerContext) (bool, error) { | ||
kubeClient, err := ctx.ClientBuilder.Client(infraDefaultRoleBindingsControllerServiceAccountName) | ||
if err != nil { | ||
return true, err | ||
} | ||
|
||
go defaultrolebindings.NewDefaultRoleBindingsController( | ||
ctx.KubernetesInformers.Rbac().V1().RoleBindings(), | ||
ctx.KubernetesInformers.Core().V1().Namespaces(), | ||
return runRoleBindingController(ctx, kubeClient, "DefaultRoleBindingController") | ||
} | ||
|
||
func RunBuilderRoleBindingController(ctx *ControllerContext) (bool, error) { | ||
// Role binding controllers currently share the same service account, | ||
// as these are created by "boostrap" logic located elsewhere in Openshift. | ||
// TODO: Refactor the controller service accounts to be managed by openshift-controller-manager-operator. | ||
kubeClient, err := ctx.ClientBuilder.Client(infraDefaultRoleBindingsControllerServiceAccountName) | ||
if err != nil { | ||
return true, err | ||
} | ||
|
||
return runRoleBindingController(ctx, kubeClient, "BuilderRoleBindingController") | ||
} | ||
|
||
func RunDeployerRoleBindingController(ctx *ControllerContext) (bool, error) { | ||
// Role binding controllers currently share the same service account, | ||
// as these are created by "boostrap" logic located elsewhere in Openshift. | ||
// TODO: Refactor the controller service accounts to be managed by openshift-controller-manager-operator. | ||
kubeClient, err := ctx.ClientBuilder.Client(infraDefaultRoleBindingsControllerServiceAccountName) | ||
if err != nil { | ||
return true, err | ||
} | ||
|
||
return runRoleBindingController(ctx, kubeClient, "DeployerRoleBindingController") | ||
} | ||
|
||
func runRoleBindingController(cctx *ControllerContext, kubeClient kubernetes.Interface, controllerName string) (bool, error) { | ||
go defaultrolebindings.NewRoleBindingsController( | ||
cctx.KubernetesInformers.Rbac().V1().RoleBindings(), | ||
cctx.KubernetesInformers.Core().V1().Namespaces(), | ||
kubeClient.RbacV1(), | ||
).Run(5, ctx.Stop) | ||
controllerName, | ||
).Run(5, cctx.Stop, controllerName) | ||
|
||
return true, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
vendor/github.com/openshift/api/openshiftcontrolplane/v1/types.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.