Documentation ¶
Index ¶
- Constants
- func Add(ctx context.Context, logger kitlog.Logger, mgr manager.Manager, ...) (controller.Controller, error)
- func NewCachedDirectory(logger kitlog.Logger, directory Directory, ttl time.Duration) *cachedDirectory
- func NewFakeDirectory(groups map[string][]string) *fakeDirectory
- func NewGoogleDirectory(service *directoryv1.MembersService) *googleDirectory
- type Directory
- type DirectoryProvider
- type Reconciler
Constants ¶
const ( EventRoleBindingCreated = "Created" EventError = "Error" EventSubjectAdd = "SubjectAdd" EventSubjectRemove = "SubjectRemove" EventSubjectsModified = "SubjectsModified" )
const ( // GooglePerPage states how many members we retrive in each pagination call when talking // to the Google directory service GooglePerPage = 500 // GoogleMaxPages limits the number of pages we iterate through when talking to the // Google directory service. In combination with the GooglePerPage constant, this // effectively limits the size of the group we can process. GoogleMaxPages = 10 )
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(ctx context.Context, logger kitlog.Logger, mgr manager.Manager, provider DirectoryProvider, refreshInterval time.Duration, opts ...func(*controller.Options)) (controller.Controller, error)
Add instantiates a DirectoryRoleBinding controller and adds it to the manager. To ensure we respond to changes in the directory source, we provide a refreshInterval duration that tells the controller to re-enqueue a reconcile after each successful process. Setting this to 0 will disable the re-enqueue.
func NewCachedDirectory ¶
func NewCachedDirectory(logger kitlog.Logger, directory Directory, ttl time.Duration) *cachedDirectory
NewCachedDirectory wraps the given directory so that we cache member lists for the given TTL. This is useful when we want to reason about the maximum number of calls to a directory API our controllers might make, which helps us avoid API rate limits.
func NewFakeDirectory ¶
NewFakeDirectory provides the directory service from a map of members
func NewGoogleDirectory ¶
func NewGoogleDirectory(service *directoryv1.MembersService) *googleDirectory
NewGoogleDirectory wraps a Google admin directory service to match our interface
Types ¶
type DirectoryProvider ¶
DirectoryProvider understands what directory service to use for different subject kinds
func (DirectoryProvider) Get ¶
func (p DirectoryProvider) Get(kind string) Directory
func (DirectoryProvider) Register ¶
func (p DirectoryProvider) Register(kind string, directory Directory)
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
func (*Reconciler) ReconcileObject ¶
func (r *Reconciler) ReconcileObject(logger kitlog.Logger, request reconcile.Request, drb *rbacv1alpha1.DirectoryRoleBinding) (res reconcile.Result, err error)