manifest

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package manifest builds, transforms, and validates Podmin's typed Kubernetes manifest subset.

Index

Constants

View Source
const (

	// IdentityVolumeName is the reserved workload identity volume name.
	IdentityVolumeName = "podmin-identity"
	// IdentityMountPath is the standard workload identity mount path.
	IdentityMountPath = "/var/run/secrets/podmin.dev/tls"
	// IdentityHostRoot is the Podmin-owned tmpfs root containing workload identity files.
	IdentityHostRoot = "/run/podmin"
	// InstallAnnotation identifies a workload produced by a built-in install command.
	InstallAnnotation = "podmin.dev/install"
)

Variables

This section is empty.

Functions

func DeploymentIdentity

func DeploymentIdentity(key string) (string, string, bool)

DeploymentIdentity parses a cluster-wide deployment key.

func DeploymentKey

func DeploymentKey(nodeGroup, name string) string

DeploymentKey returns the unique cluster-wide key for a nodegroup deployment.

func Digest

func Digest(body []byte) string

Digest returns the lowercase SHA-512 digest of body.

func Init

func Init(options InitConfig) ([]byte, error)

Init creates a minimal DaemonSet and optional Service targeting one NodeGroup.

func MarshalIndex

func MarshalIndex(index Index) ([]byte, error)

MarshalIndex produces deterministic canonical JSON.

func MarshalPod

func MarshalPod(pod *corev1.Pod) ([]byte, error)

MarshalPod serializes a typed Pod as deterministic YAML.

func Name

func Name(input []byte) (string, error)

Name returns metadata.name from transformed YAML.

func ParsePod

func ParsePod(input []byte) (*corev1.Pod, error)

ParsePod strictly decodes one typed Pod manifest.

func ServiceIdentity

func ServiceIdentity(key string) (string, string, string, bool)

ServiceIdentity validates a content-addressed Service key and returns its namespace, name, and combined identity.

func Transform

func Transform(input []byte, images []string, revision string) ([]byte, error)

Transform strictly decodes, transforms, and serializes one typed Pod.

func TransformPod

func TransformPod(input []byte, images []string, revision string) (*corev1.Pod, error)

TransformPod strictly decodes and transforms one typed Pod.

func ValidID

func ValidID(value string) bool

ValidID reports whether value is a valid cluster, NodeGroup, workload, or container identifier.

func ValidNamespace

func ValidNamespace(value string) bool

ValidNamespace reports whether value is a Kubernetes DNS-label namespace.

Types

type Deployment

type Deployment struct {
	Pod         []byte
	ServiceYAML []byte
	Service     *Service
}

Deployment is one transformed Pod and its optional Service desired state.

func ParseDeployment

func ParseDeployment(input []byte, images []string, revision, expectedName, nodeGroup string) (Deployment, error)

ParseDeployment extracts exactly one DaemonSet and at most one constrained Service.

type Index

type Index map[string]IndexDeployment

Index is the single cluster-wide committed desired-state object.

func ParseIndex

func ParseIndex(body []byte) (Index, error)

ParseIndex strictly parses and validates an index.

type IndexDeployment

type IndexDeployment struct {
	Pod     IndexObject `json:"pod"`
	Service IndexObject `json:"service,omitempty"`
}

IndexDeployment references one Pod and its optional Service payload.

type IndexObject

type IndexObject string

IndexObject is the content-addressed path of an immutable payload.

func (IndexObject) Verify

func (o IndexObject) Verify(body []byte) error

Verify checks that body is the referenced immutable payload.

type InitConfig added in v0.4.0

type InitConfig struct {
	Name            string
	NodeGroup       string
	Namespace       string
	Images          []string
	Service         bool
	Env             map[string]string
	Ports           []ServicePort
	SecretKeys      []string
	SecretsProvider string
}

InitConfig describes a built-in manifest.

type Service

type Service struct {
	Name      string
	Namespace string
	Selector  map[string]string
	Ports     []ServicePort
}

Service is the supported, provider-neutral Service desired state.

func ParseService

func ParseService(input []byte) (Service, error)

ParseService validates one standalone Service document for agent consumption.

type ServicePort

type ServicePort struct {
	Name       string
	Protocol   string
	Port       int
	TargetPort int
}

ServicePort is one supported Service port mapping.

Jump to

Keyboard shortcuts

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