migration

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package migration analyzes how an application adopted on a Docker host would run on a Kubernetes cluster: every service on every axis, as supported, operator_choice_required or blocked, with a code from a closed vocabulary and a parameter. It is pure: it reads store and protocol types, never the store's SQL, a runtime or a Kubernetes library.

Index

Constants

View Source
const (
	Supported      = "supported"
	ChoiceRequired = "operator_choice_required"
	Blocked        = "blocked"
)

Classes, in increasing severity.

View Source
const (
	AxisStorage    = "storage"
	AxisNetworking = "networking"
	AxisPorts      = "ports"
	AxisSecrets    = "secrets"
	AxisProbes     = "probes"
	AxisResources  = "resources"
	AxisScheduling = "scheduling"
	AxisFlags      = "flags"
)

Axes, in report order.

View Source
const Version = 1

Version is the report format.

Variables

View Source
var AssumptionCodes = []string{"volume_size_unknown"}

AssumptionCodes are the report's fixed assumptions.

View Source
var ChecklistCodes = []string{"grant_namespace", "create_destination", "update_references", "copy_volume", "validate_destination", "switch_traffic", "confirm_cutover"}

ChecklistCodes are the operator's steps, in order; the web has a sentence for each. The checklist is display only: the migration's status moves by the operator's confirmations.

View Source
var Codes = []string{
	"volume_named", "volume_named_shared", "volume_bind", "volume_external", "volume_unverified", "storage_supported",
	"network_host", "networks_multiple", "network_references", "networking_supported",
	"port_published", "port_host_ip", "port_unpublished",
	"secrets_supported",
	"healthcheck_dropped", "probes_supported",
	"resource_limits_dropped", "resources_supported",
	"scheduling_blocked", "scheduling_supported",
	"flag_blocked", "restart_policy", "read_only_rootfs", "flags_supported",
	"inspection_unavailable",
}

Codes is the closed finding vocabulary; the web has a sentence for each (web/src/migration-codes.json).

Functions

This section is empty.

Types

type Destination

type Destination struct {
	Namespace      string
	Project        string
	StorageClasses []protocol.StorageClass
}

Destination is the cluster side: the namespace, the destination application's project and the StorageClasses the cluster reports.

type Finding

type Finding struct {
	Axis   string `json:"axis"`
	Class  string `json:"class"`
	Code   string `json:"code"`
	Detail string `json:"detail,omitempty"`
}

Finding's Detail is its code's parameter: a volume name, a mount target, a port as <published>/<protocol>, a restart policy, a code from protocol.UnsupportedCodes, a service's destination name, "acknowledged" on an acknowledged drop that has no parameter, or "agent" on an inspection_unavailable caused by an agent that reports no health.

type Input

type Input struct {
	// Spec is the source's latest revision, Project its Compose project.
	Spec    store.ApplicationSpec
	Project string
	// Containers and Inspections are keyed by service: the mapped container from the endpoint's
	// inventory and, when the plan-time inspection ran, what it observed.
	Containers  map[string]protocol.Container
	Inspections map[string]protocol.ContainerInspection
	// Volumes are the source endpoint's volumes.
	Volumes     []protocol.Volume
	Destination Destination
	Choices     store.MigrationChoices
}

Input is one source analyzed against one destination.

type Report

type Report struct {
	Version int `json:"version"`
	// Ready is true when no finding is blocked or operator_choice_required.
	Ready       bool            `json:"ready"`
	Services    []ServiceReport `json:"services"`
	Checklist   []Step          `json:"checklist"`
	Assumptions []string        `json:"assumptions"`
}

func Analyze

func Analyze(in Input) Report

Analyze classifies every service of in.Spec, sorted by name, and lists the checklist.

type ServiceReport

type ServiceReport struct {
	Name     string    `json:"name"`
	Class    string    `json:"class"`
	Findings []Finding `json:"findings"`
}

ServiceReport's Class is its most severe finding's.

type Step

type Step struct {
	Code     string   `json:"code"`
	Commands []string `json:"commands,omitempty"`
}

Step is one checklist step with its lines, the real names filled in: shell commands, or for update_references the pairs "<service> → <destination name>".

Jump to

Keyboard shortcuts

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