provisioninglog

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package provisioninglog emits structured, tenant-scoped streams of condition-status transitions. It mirrors the identity audit-log pattern — the discriminator is the structured-log message, the payload is typed structs as key/values — but is cross-cutting: it is driven edge-triggered by the caller (emit only when a condition actually changes, never on every poll).

Each condition axis is its own stream with its own message discriminator so a pipeline can subscribe per axis (filter on msg == "provisioning" for the Available/provisioning axis, msg == "lifecycle" for the Active/lifecycle-power axis). The envelope is otherwise identical across streams, so every axis has parity: same component/resource/scope/observedGeneration and the same payload shape, keyed by the stream name.

Index

Constants

View Source
const (
	// StreamProvisioning carries Available-condition (provisioning) transitions.
	StreamProvisioning = "provisioning"
	// StreamLifecycle carries Active-condition (lifecycle/power) transitions.
	StreamLifecycle = "lifecycle"
)

A Stream is the structured-log message that marks a condition-transition event, in the same way identity's audit middleware uses the message "audit". A log pipeline filters a stream on msg == the chosen value. The stream name doubles as the payload key, so each axis carries its transition under its own key.

Variables

This section is empty.

Functions

func Emit

func Emit(ctx context.Context, scheme *runtime.Scheme, object client.Object, stream, status, reason, message string)

Emit writes a single condition-transition event to the named stream (use one of the Stream* discriminators). The caller is responsible for edge-triggering — only calling Emit when the (status, reason, message) tuple has actually changed — since the reconcile and monitor paths run on every poll. The stream name is both the message discriminator and the key its transition payload is logged under, so consumers of one axis are never confused by another's.

Types

type Component

type Component struct {
	Name string `json:"name"`
	// Version is unset today - service-version threading is a follow-up - and is
	// kept for parity with the audit log's Component.
	Version string `json:"version,omitempty"`
}

Component identifies the emitting service. Field names match the audit log's Component for parity.

type Resource

type Resource struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

Resource identifies the resource whose provisioning state changed. Field names match the audit log's Resource for parity.

type Transition

type Transition struct {
	Status  string `json:"status"`
	Reason  string `json:"reason"`
	Message string `json:"message,omitempty"`
}

Transition carries the condition change itself: the condition's status, its reason, and the user-safe message (the "why"). It is shared across streams so every axis has the same payload shape (parity).

Jump to

Keyboard shortcuts

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