migration

package
v0.0.0-...-89602ce Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

DB migration script to clean up old magmad config tables. Entries in the network table are migrated from the old network configuration type to the new network record by pulling the "magmad" entry from the old namespaced config. As a cleanup, this will also delete all magmad network configs from the new config service tables. All old gateway and mesh config tables are deleted as a cleanup if `shouldDropTables` is true.

Index

Constants

View Source
const GatewayConfigTable = "configs"
View Source
const MagmadNetworkType = "magmad_network"
View Source
const MeshConfigTable = "mesh_config"
View Source
const NetworkTable = "networks"

Redeclare table names

View Source
const NewConfigTable = "configurations"

Variables

View Source
var File_network_config_proto protoreflect.FileDescriptor

Functions

func DeleteMagmadNetworkConfigs

func DeleteMagmadNetworkConfigs(tx *sql.Tx) error

func DeleteOldGatewayConfigTables

func DeleteOldGatewayConfigTables(tx *sql.Tx) error

func DeleteOldMeshConfigTables

func DeleteOldMeshConfigTables(tx *sql.Tx) error

func Migrate

func Migrate(dbDriver string, dbSource string, shouldDropTables bool) error

func MigrateNetworkConfigsToRecords

func MigrateNetworkConfigsToRecords(tx *sql.Tx) error

Types

type Config

type Config struct {

	// Namespaced map of serialized configs
	ConfigsByKey map[string][]byte `` /* 187-byte string literal not displayed */
	// contains filtered or unexported fields
}

Container message type for namespaced network configs.

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetConfigsByKey

func (x *Config) GetConfigsByKey() map[string][]byte

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type Record

type Record struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Record) Descriptor deprecated

func (*Record) Descriptor() ([]byte, []int)

Deprecated: Use Record.ProtoReflect.Descriptor instead.

func (*Record) GetName

func (x *Record) GetName() string

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) ProtoReflect

func (x *Record) ProtoReflect() protoreflect.Message

func (*Record) Reset

func (x *Record) Reset()

func (*Record) String

func (x *Record) String() string

Jump to

Keyboard shortcuts

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