constants

package
v0.10.13 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 0 Imported by: 12

Documentation

Overview

Package constants defines ConfigHub values shared across the server, bots, functions, and config kits: the metadata keys below, and API constants such as ServerVersionHeader. It imports nothing, so the server can use it without depending on the API client.

Index

Constants

View Source
const (
	// Identifying Metadata
	SpaceIDKeySuffix                = "SpaceID"
	UnitSlugKeySuffix               = "UnitSlug"
	RevisionNumKeySuffix            = "RevisionNum"
	ResourceNameStableCoreKeySuffix = "ResourceNameStableCore"

	// Other Metadata
	ConfigMapFormatKeySuffix = "ConfigMapFormat"
	HashKeySuffix            = "Hash"

	// Options
	MutationOptionsKeySuffix = "MutationOptions"
	RenderRevisionKeySuffix  = "RenderRevision"
	VisitorOptionsKeySuffix  = "VisitorOptions"
)

Key suffixes for ConfigHub context metadata to inject into managed resources in bridges. Paths and Prefixes will depend on the ResourceProvider.

View Source
const (
	RenderRevisionLatest     = "Latest"
	RenderRevisionSuperseded = "Superseded"
)

RenderRevision annotation values. render-configmap marks every ConfigMap it renders Latest; prune-configmaps marks the older renderings it retains Superseded rather than removing the annotation, so that its presence still says the ConfigMap was rendered.

View Source
const (
	VisitorOptionIgnoreNeeded   = "IgnoreNeeded"
	VisitorOptionIgnoreProvided = "IgnoreProvided"
)
View Source
const (
	ConfigMapFormatFile     = "File"
	ConfigMapFormatKeyValue = "KeyValue"
)

ConfigMapFormat annotation values for the ConfigMap bridge.

View Source
const (
	// TriggerPriorityAnnotation is how urgent the policy is: TriggerPriorityHigh, Medium or Low.
	// A Trigger without it has no priority.
	TriggerPriorityAnnotation = "Priority"
	// TriggerEnforcedByAnnotation is when the policy is due to be enforced, in RFC 3339, as
	// every time in the API is written.
	TriggerEnforcedByAnnotation = "EnforcedBy"
	// TriggerEnforcedAtAnnotation is when the Trigger was last changed to enforce, in RFC 3339.
	TriggerEnforcedAtAnnotation = "EnforcedAt"
)

Annotations on a validating Trigger that track the enforcement of the policy it checks. A policy starts in audit (Warn true), is fixed or excepted until few or no ValidationWarnings are left, and is then enforced (Warn false). Where it stands is computed, not stored: a Trigger no Space or Target selects has not been rolled out, and one that is selected is in audit or enforced by its Warn. These record only what cannot be computed.

View Source
const (
	TriggerPriorityHigh   = "High"
	TriggerPriorityMedium = "Medium"
	TriggerPriorityLow    = "Low"
)

TriggerPriorityAnnotation values.

View Source
const ContinueHeader = "ConfigHub-Continue"

ContinueHeader is the response header a List or Search returns the continue token in when there may be more entities after the page it returned. Pass the token as the next request's "continue" query parameter, with the request's other parameters unchanged, and keep reading until a response has no ContinueHeader: a page can be shorter than the limit, or empty, and still be followed by more.

View Source
const PackLabel = "Pack"

PackLabel is the label naming the pack a Trigger belongs to: a group of Triggers defined once in a policy Space, which a Space or Target opts into by listing the group in its WhereTrigger, as in "Space.Slug = 'confighub-system' AND Labels.Pack IN ('basic', 'rbac')".

View Source
const ServerVersionHeader = "ConfigHub-Version"

ServerVersionHeader is the response header the ConfigHub server stamps its own version onto, on every /api response. A client that reads it learns the server version from a call it was already making, rather than spending a round trip on /api/info. The value is what /api/info reports in Version: a release version such as "v0.2.34", or "v0.2-dev" for a build from a working tree.

It lives here, and not in cubapi, so that the server can stamp the header without importing the API client. The server does not call its own API, and that import would pull the generated client into the server binary and into the OpenAPI spec generator, which links internal/views -> cubapi -> goclient-new: a broken client then blocks regenerating that same client.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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