Skip to content

Architecture

System Overview

Repo Guard runs as a Kubernetes operator — a collection of controllers that each watch specific CRD types and reconcile desired state against GitHub's API.

Resource Relationships

How Reconciliation Works

Controller Overview

ControllerCRDs WatchedResponsibility
GithubGithubValidates GitHub App connectivity and surfaces status.
GithubOrganizationGithubOrganization, GithubTeamRepositoryManages org owners, team creation/deletion, default repo team permissions.
GithubTeamGithubTeamResolves member list from a provider and syncs team membership on GitHub.
GithubAccountLinkGithubAccountLinkMaps internal user IDs to GitHub user IDs and performs email domain verification.
LDAP ProviderLDAPGroupProvider, ClusterLDAPGroupProviderPeriodically fetches group membership from LDAP/AD.
Generic HTTP ProviderGenericExternalMemberProvider, ClusterGenericExternalMemberProviderFetches member lists from a JSON HTTP API.
Static ProviderStaticMemberProvider, ClusterStaticMemberProviderServes an in-CRD static list; no external calls needed.

Rate Limiting & Backoff

When GitHub returns a rate-limit error the controller extracts the reset timestamp from the error message and requeues the resource with a RequeueAfter duration set to the reset time. This avoids busy-looping while still converging as soon as possible.

Dry Run

Every mutable CRD supports the repo-guard.cloudoperators.dev/dryRun: "true" label. When set, the controller logs all intended operations and writes them to .status but makes no API calls to GitHub. This is useful for previewing the impact of a new policy before activating it.

Released under the Apache 2.0 License.