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

Overview

Package migrate wires the manifest, source, target, and reconcile engine together for `kcp migration resources create`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSourceAdmin

func BuildSourceAdmin(conn types.KafkaSourceConn) (client.KafkaAdmin, error)

BuildSourceAdmin opens a Kafka admin connection to the source cluster for a one-off read (e.g. native ACL listing via acls.ReadNativeACLs) that lives outside the KafkaSourceReader lifecycle. The caller owns Close().

Types

type KafkaSourceReader

type KafkaSourceReader struct {
	// contains filtered or unexported fields
}

KafkaSourceReader reads a migration source via the Kafka admin protocol. The source may be Apache Kafka, MSK, or Confluent — auth is in the connection.

func NewKafkaSourceReader

func NewKafkaSourceReader(conn types.KafkaSourceConn) *KafkaSourceReader

func (*KafkaSourceReader) ClusterID

func (r *KafkaSourceReader) ClusterID(ctx context.Context) (string, error)

ClusterID returns the live source cluster id, opening an admin connection on the first call and memoizing the result for subsequent calls. Only a successful read is cached, so a failed probe still retries on the next call.

func (*KafkaSourceReader) DescribeTopics

func (r *KafkaSourceReader) DescribeTopics(ctx context.Context, names []string) ([]TopicSpec, error)

DescribeTopics opens an admin connection and returns the recreate-relevant shape of the requested topics, with only explicitly-set (non-default) configs. Topics in names that are absent from the source are silently skipped. Results are sorted by name.

func (*KafkaSourceReader) ListTopics

func (r *KafkaSourceReader) ListTopics(ctx context.Context) ([]string, error)

ListTopics opens an admin connection and returns the source topic names, sorted.

type Source

type Source interface {
	ClusterID(ctx context.Context) (string, error)
	ListTopics(ctx context.Context) ([]string, error)
	DescribeTopics(ctx context.Context, names []string) ([]TopicSpec, error)
}

Source is the live read of the migration source. The cluster id supports the desired-state read (§8.2); ListTopics/DescribeTopics support topic mirroring and recreation. Bootstrap servers and auth come from the parsed credentials, not a live read.

type TopicSpec

type TopicSpec struct {
	Name              string
	Partitions        int
	ReplicationFactor int
	Configs           map[string]string // explicitly-set (non-default) source topic configs
}

TopicSpec is a source topic's recreate-relevant shape.

Directories

Path Synopsis
Package acls implements the source-read stage of the native-ACL migration plane: flattening sarama's ACL listing into the canonical types.Acls tuple and reading the MSK "allow.everyone.if.no.acl.found" server property.
Package acls implements the source-read stage of the native-ACL migration plane: flattening sarama's ACL listing into the canonical types.Acls tuple and reading the MSK "allow.everyone.if.no.acl.found" server property.
Package clusterlink implements the cluster-link Reconciler: it reconciles the desired link (derived from the live source + manifest) against the actual link on the target, additively (§8.2, §8.6).
Package clusterlink implements the cluster-link Reconciler: it reconciles the desired link (derived from the live source + manifest) against the actual link on the target, additively (§8.2, §8.6).
Package mirrortopics reconciles spec.topics (mode: mirror): it creates a mirror topic on the cluster link for each selected source topic that is not already mirrored.
Package mirrortopics reconciles spec.topics (mode: mirror): it creates a mirror topic on the cluster link for each selected source topic that is not already mirrored.
Package newtopics reconciles spec.topics (mode: new): it creates a plain topic on the target for each selected source topic, reproducing partition count, RF, and all explicitly-set (non-default) configs.
Package newtopics reconciles spec.topics (mode: new): it creates a plain topic on the target for each selected source topic, reproducing partition count, RF, and all explicitly-set (non-default) configs.
Package serviceaccounts derives Confluent Cloud service-account display names from source Kafka principals.
Package serviceaccounts derives Confluent Cloud service-account display names from source Kafka principals.
Package topicselect resolves a desired topic set from a live source topic list using glob include/exclude patterns.
Package topicselect resolves a desired topic set from a live source topic list using glob include/exclude patterns.

Jump to

Keyboard shortcuts

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