deploymentconfig

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 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 deploymentconfig applies the Console's service configuration edits to an SDL without changing its resource or endpoint declarations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(sdl string, patch Patch) (string, error)

Apply changes only explicitly named mutable service fields. Deployment names and concurrency versions belong to Console metadata, not the SDL.

func HasReferences

func HasReferences(sdl string) (bool, error)

HasReferences detects Console references anywhere in the parsed SDL. It returns a parse error rather than allowing invalid data past a rail guard.

func Validate

func Validate(patch Patch) error

Validate checks the wire vocabulary and bounds. An empty patch is allowed here because a caller can supply a separate secret map for rotation.

Types

type ExposePatch

type ExposePatch struct {
	Port        *uint32           `json:"port,omitempty"`
	As          *uint32           `json:"as,omitempty"`
	Accept      *[]string         `json:"accept,omitempty"`
	HTTPOptions *HTTPOptionsPatch `json:"httpOptions,omitempty"`
}

ExposePatch addresses an existing container port.

type HTTPOptionsPatch

type HTTPOptionsPatch struct {
	MaxBodySize *uint32   `json:"maxBodySize,omitempty"`
	ReadTimeout *uint32   `json:"readTimeout,omitempty"`
	SendTimeout *uint32   `json:"sendTimeout,omitempty"`
	NextTries   *uint32   `json:"nextTries,omitempty"`
	NextTimeout *uint32   `json:"nextTimeout,omitempty"`
	NextCases   *[]string `json:"nextCases,omitempty"`
}

HTTPOptionsPatch uses Console JSON names; Apply maps them to SDL names.

type Patch

type Patch struct {
	Services          map[string]ServicePatch `json:"services,omitempty"`
	Name              *string                 `json:"name,omitempty"`
	IfManifestVersion string                  `json:"ifManifestVersion,omitempty"`
}

Patch matches the editable fields of a Console deployment. Ciphertext is added by the Console client, never accepted from a patch document.

func Diff

func Diff(currentSDL, requestedSDL string) (Patch, error)

Diff derives only supported configuration edits, then proves the result by applying them and comparing the entire requested document. Resource, routing, and other unrepresentable changes therefore cannot disappear silently.

func ParsePatch

func ParsePatch(data []byte) (Patch, error)

ParsePatch accepts one strict YAML or JSON object. Errors omit user values.

func (Patch) HasChanges

func (patch Patch) HasChanges() bool

HasChanges reports whether a patch writes configuration or a deployment name. A secret-only rotation has no changes here; its secrets are a separate input.

type ServicePatch

type ServicePatch struct {
	Image       *string                 `json:"image,omitempty"`
	Command     json.RawMessage         `json:"command,omitempty"`
	Args        json.RawMessage         `json:"args,omitempty"`
	Env         map[string]*string      `json:"env,omitempty"`
	Credentials json.RawMessage         `json:"credentials,omitempty"`
	Expose      map[string]ExposePatch  `json:"expose,omitempty"`
	Storage     map[string]StoragePatch `json:"storage,omitempty"`
}

ServicePatch preserves absent, null, and empty arrays for clearable fields.

type StoragePatch

type StoragePatch struct {
	Mount    *string `json:"mount,omitempty"`
	ReadOnly *bool   `json:"readOnly,omitempty"`
}

StoragePatch edits a declared volume's mount options, never its size.

Jump to

Keyboard shortcuts

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