migrateapiversion

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdMigrate

func NewCmdMigrate(ctx context.Context, ioStreams genericclioptions.IOStreams) *cobra.Command

NewCmdMigrate returns a cobra command for updating resources in an apiserver to force a new storage version to be used.

Types

type Migrator

type Migrator struct {
	// Client used for API interactions
	Client client.Client

	// If true, skip checking the 'status.storedVersion' before running the migration.
	// By default, migration will only be run if the CRD contains storedVersions other
	// than the desired target version.
	SkipStoredVersionCheck bool

	// Writers to write informational & error messages to
	Out, ErrOut io.Writer
}

func NewMigrator

func NewMigrator(client client.Client, skipStoredVersionCheck bool, out, errOut io.Writer) *Migrator

NewMigrator creates a new migrator with the given API client. If either of out or errOut are nil, log messages will be discarded.

func (*Migrator) Run

func (m *Migrator) Run(ctx context.Context, targetVersion string, names []string) (bool, error)

Run begins the migration of all the named CRDs. It will attempt to migrate all resources defined as part of these CRDs to the given 'targetVersion', and after completion will update the `status.storedVersions` field on the corresponding CRD version to only contain the given targetVersion. Returns 'true' if a migration was actually performed, and false if migration was not required.

type Options

type Options struct {
	genericclioptions.IOStreams
	*factory.Factory
	// contains filtered or unexported fields
}

Options is a struct to support renew command

func NewOptions

func NewOptions(ioStreams genericclioptions.IOStreams) *Options

NewOptions returns initialized Options

func (*Options) Complete

func (o *Options) Complete() error

Complete takes the command arguments and factory and infers any remaining options.

func (*Options) Run

func (o *Options) Run(ctx context.Context, args []string) error

Run executes renew command

func (*Options) Validate

func (o *Options) Validate(_ []string) error

Validate validates the provided options

Jump to

Keyboard shortcuts

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