Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultRetriable(info *resource.Info, err error) error
- func FindAllCanonicalResources(d discovery.ServerResourcesInterface, m meta.RESTMapper) ([]schema.GroupResource, error)
- func NewCommandMigrate(name, fullName string, f cmdutil.Factory, streams genericclioptions.IOStreams, ...) *cobra.Command
- type Builder
- type ErrNotRetriable
- type ErrRetriable
- type MigrateActionFunc
- type MigrateError
- type MigrateFilterFunc
- type MigrateVisitFunc
- type Reporter
- type ReporterBool
- type ResourceOptions
- func (o *ResourceOptions) Bind(c *cobra.Command)
- func (o *ResourceOptions) Complete(f kcmdutil.Factory, c *cobra.Command) error
- func (o *ResourceOptions) Validate() error
- func (o *ResourceOptions) Visitor() *ResourceVisitor
- func (o *ResourceOptions) WithAllNamespaces() *ResourceOptions
- func (o *ResourceOptions) WithExcludes(defaultExcludes []schema.GroupResource) *ResourceOptions
- func (o *ResourceOptions) WithIncludes(include []string) *ResourceOptions
- func (o *ResourceOptions) WithOverlappingResources(resources []sets.String) *ResourceOptions
- func (o *ResourceOptions) WithUnstructured() *ResourceOptions
- type ResourceVisitor
- type TemporaryError
Constants ¶
const MigrateRecommendedName = "migrate"
Variables ¶
var ErrRecalculate = fmt.Errorf("recalculate migration")
ErrRecalculate may be returned by MigrateActionFunc to indicate that the object has changed and needs to have its information recalculated prior to being saved. Use when a resource requires multiple API operations to persist (for instance, both status and spec must be changed).
var ErrUnchanged = fmt.Errorf("migration was not necessary")
ErrUnchanged may be returned by MigrateActionFunc to indicate that the object did not need migration (but that could only be determined when the action was taken).
Functions ¶
func DefaultRetriable ¶
DefaultRetriable adds retry information to the provided error, and will refresh the info if the client info is stale. If the refresh fails the error is made fatal. All other errors are left in their natural state - they will not be retried unless they define a Temporary() method that returns true.
func FindAllCanonicalResources ¶
func FindAllCanonicalResources(d discovery.ServerResourcesInterface, m meta.RESTMapper) ([]schema.GroupResource, error)
FindAllCanonicalResources returns all resources that: 1. map directly to their kind (Kind -> Resource -> Kind) 2. are not subresources 3. can be listed and updated Note that this may return some virtual resources (like imagestreamtags) that can be otherwise represented. TODO: add a field to APIResources for "virtual" (or that points to the canonical resource).
Types ¶
type Builder ¶
type Builder interface {
// Visitor returns a resource.Visitor that ignores errors that match the given resource.ErrMatchFuncs
Visitor(fns ...resource.ErrMatchFunc) (resource.Visitor, error)
}
Builder allows for mocking of resource.Builder
type ErrNotRetriable ¶
type ErrNotRetriable struct {
MigrateError
}
ErrNotRetriable is a wrapper for an error that a migrator may use to indicate the specific error cannot be retried.
func (ErrNotRetriable) Temporary ¶
func (ErrNotRetriable) Temporary() bool
type ErrRetriable ¶
type ErrRetriable struct {
MigrateError
}
ErrRetriable is a wrapper for an error that a migrator may use to indicate the specific error can be retried.
func (ErrRetriable) Temporary ¶
func (ErrRetriable) Temporary() bool
type MigrateActionFunc ¶
MigrateActionFunc is expected to persist the altered info.Object. The Reporter returned from Visit is passed to this function and may be used to carry additional information about what to save on an object.
type MigrateError ¶
type MigrateError error
MigrateError is an exported alias to error to allow external packages to use ErrRetriable and ErrNotRetriable
type MigrateFilterFunc ¶
type MigrateFilterFunc func(info *