githubevents

package
v0.6.5 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2026 The BlanketOps Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package githubevents implements the GitHubEvent prerequisite mediator. The mediator owns the cross-cutting prerequisite a GitHubEvent requires before the application layer may act: the GitHub webhook HMAC secret used by the Argo Events sensor to verify payload signatures. It is invoked by the GitHubEvent domain during command handling — after resolution, before execution — and again during teardown. Prerequisite provisioning is gated on the Environment: the Environment CR must pre-exist as the root of the delivery chain, and it is the sole authority for the ClusterSecretStore binding used by every store-dependent secret this mediator reconciles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mediator

type Mediator struct {
	// Client is the Kubernetes client used for all prerequisite operations.
	Client client.Client
	// Scheme is the runtime scheme used for owner reference wiring.
	Scheme *runtime.Scheme
	// Log is the logger instance for this mediator.
	Log logr.Logger
	// Recorder handles logging of Kubernetes events.
	Recorder events.EventRecorder
}

Mediator manages the prerequisite resources a GitHubEvent depends on.

func New

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

New returns a new Mediator instance configured with the necessary dependencies.

func (*Mediator) CleanupPrerequisites

func (m *Mediator) CleanupPrerequisites(ctx context.Context, resolved *githubeventResolution.ResolvedGitHubEvent) error

CleanupPrerequisites reverses EnsurePrerequisites — deletes the GitHub webhook HMAC secret this mediator provisioned. Called from the domain's CmdDelete branch, gated by the finalizer at the controller level. Teardown runs in reverse provisioning order. All teardown steps are attempted regardless of individual failures, and errors are aggregated. Any returned error keeps the finalizer in place for retry on next reconcile.

func (*Mediator) EnsurePrerequisites

func (m *Mediator) EnsurePrerequisites(ctx context.Context, resolved *githubeventResolution.ResolvedGitHubEvent) error

EnsurePrerequisites provisions the prerequisite a GitHubEvent requires before execution: the GitHub webhook HMAC secret. Called from the domain's CmdCreate/CmdUpdate branch after resolution succeeds. Provisioning is fail-fast — the first failing step returns its error and the domain records GitHubEventPrerequisitesCreateFailed.

Jump to

Keyboard shortcuts

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