Help us shape the future of Go! Take the 2026 Go Developer Survey

webhook

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Package webhook provides the validating admission webhook for agent-orca CRDs. The webhook is registered at /validate-agentorca-io-v1alpha1-agentrun and /validate-agentorca-io-v1alpha1-agent. It enforces:

  • Image registry allowlist: all ociRef fields must use an approved registry prefix.
  • Required field validation beyond what kubebuilder markers express.
  • OCI signature check hook point (actual Cosign verification deferred to the AgentRun controller to avoid blocking admission for long).

The webhook uses failurePolicy: Fail for AgentRun (if we can't validate, don't run) and failurePolicy: Ignore for other resources (avoid blocking unrelated workloads).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRegistryAllowlist added in v0.9.0

func CheckRegistryAllowlist(ociRef string, allowedRegistries []string) error

CheckRegistryAllowlist verifies an OCI image reference against an allowlist of registry prefixes; an empty allowlist allows everything. The workflow controller uses it for container steps, which no admission webhook sees.

func SetupAgentRunWebhook

func SetupAgentRunWebhook(mgr ctrl.Manager, allowedRegistries []string) error

SetupAgentRunWebhook registers the AgentRun validating webhook with the manager.

func SetupAgentWebhook

func SetupAgentWebhook(mgr ctrl.Manager, allowedRegistries []string) error

SetupAgentWebhook registers the Agent validating webhook with the manager.

func SetupToolWebhook

func SetupToolWebhook(mgr ctrl.Manager, allowedRegistries []string) error

SetupToolWebhook registers the Tool validating webhook with the manager.

Types

type AgentRunValidator

type AgentRunValidator struct {
	Client            client.Client
	Decoder           admission.Decoder
	AllowedRegistries []string // empty = allow all
}

AgentRunValidator validates AgentRun resources on admission.

func (*AgentRunValidator) Handle

Handle implements admission.Handler.

type AgentValidator

type AgentValidator struct {
	Client            client.Client
	Decoder           admission.Decoder
	AllowedRegistries []string // empty = allow all
}

AgentValidator validates Agent resources on admission.

func (*AgentValidator) Handle

Handle implements admission.Handler.

type ToolValidator

type ToolValidator struct {
	Client            client.Client
	Decoder           admission.Decoder
	AllowedRegistries []string
}

ToolValidator validates Tool resources on admission.

func (*ToolValidator) Handle

Handle implements admission.Handler.

Jump to

Keyboard shortcuts

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