deploymentintent

package
v0.140.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package deploymentintent defines and validates the versioned deployment intent exchanged by fleet deployment control-plane components.

Index

Constants

View Source
const (
	SchemaVersion = "v1"
	MaxBodyBytes  = 1 << 20
	MaxLifetime   = time.Hour
)

Variables

This section is empty.

Functions

func DigestV1

func DigestV1(intent V1) (string, error)

DigestV1 fingerprints the typed intent with stable field ordering and UTC timestamps. Call ValidateV1 before using a digest to make an authorization decision.

func ValidActor

func ValidActor(value string) bool

func ValidApprovalReference

func ValidApprovalReference(value string) bool

func ValidCommit

func ValidCommit(value string) bool

func ValidDigest

func ValidDigest(value string) bool

func ValidPool

func ValidPool(value string) bool

func ValidServiceID

func ValidServiceID(value string) bool

func ValidUUID

func ValidUUID(value string) bool

func ValidateV1

func ValidateV1(intent V1, now time.Time) error

Types

type Rollout

type Rollout struct {
	Strategy       string `json:"strategy"`
	Replicas       int    `json:"replicas"`
	MaxUnavailable int    `json:"max_unavailable"`
	MaxSurge       int    `json:"max_surge"`
	TimeoutSeconds int    `json:"timeout_seconds"`
	HealthySeconds int    `json:"healthy_seconds"`
}

type V1

type V1 struct {
	SchemaVersion  string    `json:"schema_version"`
	IntentID       string    `json:"intent_id"`
	ServiceID      string    `json:"service_id"`
	Environment    string    `json:"environment"`
	ArtifactDigest string    `json:"artifact_digest"`
	SourceCommit   string    `json:"source_commit"`
	TargetPool     string    `json:"target_pool"`
	Rollout        Rollout   `json:"rollout"`
	RollbackDigest string    `json:"rollback_digest"`
	RequestedBy    string    `json:"requested_by"`
	ApprovalRef    string    `json:"approval_ref,omitempty"`
	CreatedAt      time.Time `json:"created_at"`
	ExpiresAt      time.Time `json:"expires_at"`
}

V1 is an immutable deployment request. It carries logical identifiers and digests only; it must never grow host addresses, credentials, shell commands, or arbitrary runtime configuration.

func DecodeV1

func DecodeV1(body []byte, now time.Time) (V1, error)

DecodeV1 parses one bounded JSON intent, rejecting duplicate keys and unknown fields before applying the schema's time-dependent validation.

Jump to

Keyboard shortcuts

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