Documentation
¶
Overview ¶
Package app assembles the GitHub controller from its configuration: the policy's GitHub table, the console it reads with its own ServiceAccount token, the report it writes, and the credentials mounted beside it.
A package rather than the body of main, for the reason the service's equivalents are: this is where the decisions a deployment can get wrong are made, and main() cannot be tested.
Index ¶
- type App
- func (a *App) Close() error
- func (a *App) Pass(ctx context.Context, target string, unsafeLocal bool) (ran bool, err error)
- func (a *App) Readiness() health.Dependency
- func (a *App) Run(ctx context.Context) error
- func (a *App) RunLoop(ctx context.Context, ready func(context.Context)) error
- func (a *App) Tick(ctx context.Context, target string, unsafeLocal bool) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is an assembled controller.
func (*App) Close ¶
Close closes the audit emitter, which delivers what its queue holds within its timeout and drops the rest, saying so. Nothing survives the process.
func (*App) Pass ¶ added in v1.58.0
Pass is App.Tick that says whether the pass ran: false, with no error, when another runner holds the target's lease and the pass is left to it. It is what a Lambda invocation runs (cmd/sluis-lambda), which reports a contended invocation as such and not as a success.
func (*App) Readiness ¶ added in v1.63.0
func (a *App) Readiness() health.Dependency
Readiness is the controller's answer to "did it start": closed until App.RunLoop begins. The one process adds it to the readiness it serves.
func (*App) Run ¶
Run passes until the context is done, or the audit installation refuses the catalogue after the start, which ends the process the way a refusal at the start would have. It is the controller as a process of its own (`sluis controller`, deprecated): it serves its own probes, which in the one process are the service's.
func (*App) RunLoop ¶ added in v1.63.0
RunLoop is the controller's loop alone, for the one process that serves the probes. It opens readiness, waits for ready (when not nil) before the first pass, then passes until the context is done, or the audit installation refuses the catalogue after the start, which ends it with that error.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is what a deployment decides. It is built from the configuration file, which is what the chart renders.
func FromConfig ¶
func FromConfig(f *config.ControllerGitHub, p *config.PolicyDocument) (Config, error)
FromConfig builds the settings from a configuration already read. What a schema cannot say is checked here, before anything starts.
func FromService ¶ added in v1.63.0
FromService builds the settings of the GitHub controller that the one service document runs (`controllers.github`), from the document and the policy it names. The controller shares the process's release, policy, ports, adapters, audit installation and log level, and, with the `ssm` secrets source, its root.
func Load ¶
Load reads the configuration file, holds it to its schema, and builds the settings from it.
The file is either the controller's own document (`sluis controller github`, deprecated) or the one service document, whose `controllers.github` section is this controller: a deployment that still runs the controller apart reads the document the process it was folded into reads.
func (Config) ConsoleURL ¶ added in v1.63.0
ConsoleURL is the console's API the controller reads.