Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConversionError ¶
type ConversionError struct { Cause error KeyV1 model.Key ValueV1 interface{} KeyV3 model.Key ValueV3 converters.Resource }
ConversionError contains details about a specific error converting a v1 resource to a v3 resource.
type Interface ¶
type Interface interface { ValidateConversion() (*MigrationData, error) IsDestinationEmpty() (bool, error) ShouldMigrate() (bool, error) CanMigrate() error Migrate() (*MigrationData, error) IsMigrationInProgress() (bool, error) Abort() error Complete() error }
Interface is the migration interface used for migrating data from version v2.x to v3.x.
func New ¶
func New(clientv3 clientv3.Interface, clientv1 clients.V1ClientInterface, statusWriter StatusWriterInterface) Interface
New creates a new migration helper implementing Interface.
type MigrationData ¶
type MigrationData struct { // The converted resources Resources []converters.Resource // The converted resource names NameConversions []NameConversion // Errors hit attempting to convert the v1 data to v3 format. The // KeyV3 and ValueV3 will be nil for these conversion errors. ConversionErrors []ConversionError // Errors hit validating the converted v3 data. This suggests an error in the // conversion script which should be fixed before reattempting the conversion. ConvertedResourceValidationErrors []ConversionError // Name clashes in the converted resources. These need to be resolved through // reconfiguration before attempting the upgrade. NameClashes []NameClash // Entries that were skipped because they will be handled by the Kubernetes // Policy controller. HandledByPolicyCtrl []model.Key }
MigrationData includes details about data migrated using the migration helper.
func (*MigrationData) HasErrors ¶
func (c *MigrationData) HasErrors() bool
HasErrors returns whether there are any errors contained in the MigrationData.
type MigrationError ¶
func (MigrationError) Error ¶
func (m MigrationError) Error() string
type NameClash ¶
NameClash contains details about name/id clashes (i.e. when two converted resource names (for the same resource type) clash.
type NameConversion ¶
NameConversion contains details about name/id conversions.
type StatusWriterInterface ¶
StatusWriterInterface is an optional interface supplied by the consumer of the migration helper used to record status of the migration.