api

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migrator

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

Migrator will read custom resource definitions and upgrade the associated resources to the latest storage version

func NewStorageVersionMigrator

func NewStorageVersionMigrator(d dynamic.Interface, a apixclient.Interface, logger *zap.SugaredLogger) *Migrator

NewStorageVersionMigrator returns a new Migrator

func (*Migrator) MigrateCrdGroup

func (m *Migrator) MigrateCrdGroup(ctx context.Context, gr schema.GroupResource, skipResources bool) error

Migrate takes a group resource (ie. resource.some.group.dev) and updates instances of the resource to the latest storage version

This is done by listing all the resources and performing an empty patch which triggers a migration on the K8s API server

Finally the migrator will update the CRD's status and drop older storage versions

func (*Migrator) MigrateCrdGroups

func (m *Migrator) MigrateCrdGroups(ctx context.Context, crdGroups []string, skipResources bool)

performs crd storage version upgrade lists all the resources and, keeps only one storage version on the crd continues the execution, even though exception happens

Jump to

Keyboard shortcuts

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