api

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

This file owns the Provider interface for the GitHubEvent domain — the contract that all event ingress backends must satisfy.

A Provider is responsible for ensuring the observability infrastructure required to receive and forward GitHub webhook deliveries exists and is healthy. The concrete implementation (GitHubProvider in github.go) provisions the Argo Events stack (EventBus, EventSource, Sensor).

Ensure is idempotent — calling it multiple times for the same GitHubEvent CR must produce the same result with no unintended side effects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubProvider

type GitHubProvider struct {
	Client   client.Client
	Scheme   *runtime.Scheme
	Log      logr.Logger
	Recorder events.EventRecorder
}

GitHubProvider is the concrete Provider implementation for GitHubEvent. It provisions the Argo Events stack (EventBus, EventSource, Sensor) and the RBAC the Sensor needs to write GitHubEvent CRs.

func NewGitHubProvider

func NewGitHubProvider(c client.Client, scheme *runtime.Scheme, log logr.Logger, rec events.EventRecorder) *GitHubProvider

NewGitHubProvider constructs a GitHubProvider.

func (*GitHubProvider) Ensure

Ensure provisions or reconciles the Argo Events stack — plus the RBAC the Sensor needs — for the GitHubEvent CR.

Ensure does NOT wait for a webhook delivery. Infrastructure provisioning completing successfully is signaled via Triggered=true — the actual payload-received outcome is written later by the observer/reconcile path that detects the Sensor's patch on this CR's own spec.contract.

func (*GitHubProvider) Teardown

Teardown deletes the Sensor this GitHubEvent CR owns.

EventBus, EventSource, the Sensor ServiceAccount, and its RBAC are shared cluster singletons — provisioned once and reused across every GitHubEvent CR — so they are NOT deleted here. Only the Sensor is genuinely per-CR (named "github-sensor-" + crName); deleting the shared objects would break every other GitHubEvent still depending on them.

Idempotent — a missing Sensor is not an error.

type Provider

type Provider interface {
	// Ensure creates or reconciles the infrastructure required to receive
	// webhook deliveries for the given GitHubEvent. Returns Accepted on
	// success and Rejected on failure.
	Ensure(
		ctx context.Context,
		resolved *githubeventResolution.ResolvedGitHubEvent,
		event domain.GitHubEvent,
	) (domain.GitHubEventResult, error)
}

Provider provisions and maintains the event ingress infrastructure for a GitHubEvent CR. Implementations must be idempotent.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL