migrate

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 6 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

Index

Constants

View Source
const CurrentSchemaVersion = 4

CurrentSchemaVersion is the schema_version this build reads and writes. Bump in lockstep with any change to the kcp-state.json shape, and add the matching upcaster to steps (see internal/state/migrate/steps.go).

v2 added the additive, omitempty connector_metrics field to each MSK cluster's aws_client_information — no upcaster needed, since an older file is already a structurally-valid v2 file. v3 is NOT additive: it restructures self-managed Connect's kafka_admin_client_information.self_managed_connectors into connect_clusters, so every file below v3 runs the real "nest self_managed_connectors under connect_clusters" upcaster (self-gating: a no-op for files without it). v4 added the additive, omitempty consumer_groups field to kafka_admin_client_information (consumer-group discovery) — again no real transform needed, since an existing v3 file is already a structurally-valid v4 file; see the "-> v4" no-op step in steps.go.

Variables

View Source
var ErrNewerSchema = errors.New("state file schema is newer than this KCP build supports")

ErrNewerSchema means the file was written by a newer (released) KCP than this build can model.

View Source
var ErrNewerSchemaDev = errors.New("state file schema is newer than this KCP build supports and was written by a development build")

ErrNewerSchemaDev is ErrNewerSchema's variant for a file STAMPED by a dev build (its declared schema_version may correspond to an unreleased/local shape — see spec §6.9).

View Source
var ErrUnsupportedLegacy = errors.New("state file is from an unsupported legacy format")

ErrUnsupportedLegacy means the file is an old shape for which no upcaster exists yet.

Functions

func Upgrade

func Upgrade(data []byte) (migrated []byte, fromLabel string, err error)

Upgrade transforms raw kcp-state.json bytes of any prior shape into bytes conforming to CurrentSchemaVersion. It never decodes into types.State. fromLabel is a human-readable description of the detected source shape.

Types

This section is empty.

Jump to

Keyboard shortcuts

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