upgrader

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPatchData

func GetPatchData(oldObj, newObj interface{}) ([]byte, error)

GetPatchData returns patch data by marshalling and taking diff of two objects

Types

type CSPCPatch

type CSPCPatch struct {
	*ResourcePatch
	Namespace string
	CSPC      *patch.CSPC
	*Client
}

CSPCPatch is the patch required to upgrade CSPC

func NewCSPCPatch

func NewCSPCPatch(opts ...CSPCPatchOptions) *CSPCPatch

NewCSPCPatch ...

func (*CSPCPatch) CSPCUpgrade

func (obj *CSPCPatch) CSPCUpgrade() error

CSPCUpgrade ...

func (*CSPCPatch) Init

func (obj *CSPCPatch) Init() error

Init initializes all the fields of the CSPCPatch

func (*CSPCPatch) PreUpgrade

func (obj *CSPCPatch) PreUpgrade() error

PreUpgrade ...

func (*CSPCPatch) Upgrade

func (obj *CSPCPatch) Upgrade() error

Upgrade execute the steps to upgrade CSPC

type CSPCPatchOptions

type CSPCPatchOptions func(*CSPCPatch)

CSPCPatchOptions ...

func WithCSPCClient

func WithCSPCClient(c *Client) CSPCPatchOptions

WithCSPCClient ...

func WithCSPCResorcePatch

func WithCSPCResorcePatch(r *ResourcePatch) CSPCPatchOptions

WithCSPCResorcePatch ...

type CSPIPatch

type CSPIPatch struct {
	*ResourcePatch
	Namespace string
	Deploy    *patch.Deployment
	CSPI      *patch.CSPI
	Utask     *v1Alpha1API.UpgradeTask
	*Client
}

CSPIPatch is the patch required to upgrade cspi

func NewCSPIPatch

func NewCSPIPatch(opts ...CSPIPatchOptions) *CSPIPatch

NewCSPIPatch ...

func (*CSPIPatch) CSPIUpgrade

func (obj *CSPIPatch) CSPIUpgrade() (string, error)

CSPIUpgrade ...

func (*CSPIPatch) DeployUpgrade

func (obj *CSPIPatch) DeployUpgrade() (string, error)

DeployUpgrade ...

func (*CSPIPatch) Init

func (obj *CSPIPatch) Init() (string, error)

Init initializes all the fields of the CSPIPatch

func (*CSPIPatch) PreUpgrade

func (obj *CSPIPatch) PreUpgrade() (string, error)

PreUpgrade ...

func (*CSPIPatch) Upgrade

func (obj *CSPIPatch) Upgrade() error

Upgrade execute the steps to upgrade cspi

type CSPIPatchOptions

type CSPIPatchOptions func(*CSPIPatch)

CSPIPatchOptions ...

func WithCSPIClient

func WithCSPIClient(c *Client) CSPIPatchOptions

WithCSPIClient ...

func WithCSPIDeploy

func WithCSPIDeploy(t *patch.Deployment) CSPIPatchOptions

WithCSPIDeploy ...

func WithCSPIResorcePatch

func WithCSPIResorcePatch(r *ResourcePatch) CSPIPatchOptions

WithCSPIResorcePatch ...

type CStorVolumePatch

type CStorVolumePatch struct {
	*ResourcePatch
	Namespace string
	CVC       *patch.CVC
	CV        *patch.CV
	Deploy    *patch.Deployment
	Service   *patch.Service
	Utask     *v1Alpha1API.UpgradeTask
	*Client
}

CStorVolumePatch is the patch required to upgrade CStorVolume

func NewCStorVolumePatch

func NewCStorVolumePatch(opts ...CStorVolumePatchOptions) *CStorVolumePatch

NewCStorVolumePatch ...

func (*CStorVolumePatch) CStorVolumeUpgrade

func (obj *CStorVolumePatch) CStorVolumeUpgrade() (string, error)

CStorVolumeUpgrade ...

func (*CStorVolumePatch) Init

func (obj *CStorVolumePatch) Init() (string, error)

Init initializes all the fields of the CStorVolumePatch

func (*CStorVolumePatch) PreUpgrade

func (obj *CStorVolumePatch) PreUpgrade() (string, error)

PreUpgrade ...

func (*CStorVolumePatch) Upgrade

func (obj *CStorVolumePatch) Upgrade() error

Upgrade execute the steps to upgrade CStorVolume

type CStorVolumePatchOptions

type CStorVolumePatchOptions func(*CStorVolumePatch)

CStorVolumePatchOptions ...

func WithCStorVolumeClient

func WithCStorVolumeClient(c *Client) CStorVolumePatchOptions

WithCStorVolumeClient ...

func WithCStorVolumeResorcePatch

func WithCStorVolumeResorcePatch(r *ResourcePatch) CStorVolumePatchOptions

WithCStorVolumeResorcePatch ...

type CVRPatch

type CVRPatch struct {
	*ResourcePatch
	Namespace string
	CVR       *patch.CVR
	*Client
}

CVRPatch is the patch required to upgrade cvr

func NewCVRPatch

func NewCVRPatch(opts ...CVRPatchOptions) *CVRPatch

NewCVRPatch ...

func (*CVRPatch) CVRUpgrade

func (obj *CVRPatch) CVRUpgrade() error

CVRUpgrade ...

func (*CVRPatch) Init

func (obj *CVRPatch) Init() error

Init initializes all the fields of the CVRPatch

func (*CVRPatch) PreUpgrade

func (obj *CVRPatch) PreUpgrade() error

PreUpgrade ...

func (*CVRPatch) Upgrade

func (obj *CVRPatch) Upgrade() error

Upgrade execute the steps to upgrade cvr

type CVRPatchOptions

type CVRPatchOptions func(*CVRPatch)

CVRPatchOptions ...

func WithCVRClient

func WithCVRClient(c *Client) CVRPatchOptions

WithCVRClient ...

func WithCVRResorcePatch

func WithCVRResorcePatch(r *ResourcePatch) CVRPatchOptions

WithCVRResorcePatch ...

type Client

type Client struct {
	// kubeclientset is a standard kubernetes clientset
	KubeClientset kubernetes.Interface
	// openebsclientset is a openebs custom resource package generated for custom API group.
	OpenebsClientset openebsclientset.Interface
}

Client ...

type ResourcePatch

type ResourcePatch struct {
	Name              string
	OpenebsNamespace  string
	From, To          string
	ImageTag, BaseURL string
}

ResourcePatch has all the patches required to upgrade a resource

func NewResourcePatch

func NewResourcePatch(opts ...ResourcePatchOptions) *ResourcePatch

NewResourcePatch returns a new instance of ResourcePatch

type ResourcePatchOptions

type ResourcePatchOptions func(*ResourcePatch)

ResourcePatchOptions ...

func FromVersion

func FromVersion(from string) ResourcePatchOptions

FromVersion ...

func ToVersion

func ToVersion(to string) ResourcePatchOptions

ToVersion ...

func WithBaseURL

func WithBaseURL(url string) ResourcePatchOptions

WithBaseURL ...

func WithImageTag

func WithImageTag(imagetag string) ResourcePatchOptions

WithImageTag ...

func WithName

func WithName(name string) ResourcePatchOptions

WithName ...

func WithOpenebsNamespace

func WithOpenebsNamespace(namespace string) ResourcePatchOptions

WithOpenebsNamespace ...

type Upgrade

type Upgrade struct {
	UpgradeMap map[string]UpgradeOptions
	*Client
}

Upgrade ...

func NewUpgrade

func NewUpgrade() *Upgrade

NewUpgrade ...

func (*Upgrade) RegisterAll

func (u *Upgrade) RegisterAll() *Upgrade

RegisterAll ...

type UpgradeOptions

type UpgradeOptions func(*ResourcePatch, *Client) Upgrader

UpgradeOptions ...

type Upgrader

type Upgrader interface {
	Upgrade() error
}

Upgrader abstracts the upgrade of a resource

func RegisterCstorPoolCluster

func RegisterCstorPoolCluster(r *ResourcePatch, c *Client) Upgrader

RegisterCstorPoolCluster ...

func RegisterCstorPoolInstance

func RegisterCstorPoolInstance(r *ResourcePatch, c *Client) Upgrader

RegisterCstorPoolInstance ....

func RegisterCstorVolume

func RegisterCstorVolume(r *ResourcePatch, c *Client) Upgrader

RegisterCstorVolume ....

Jump to

Keyboard shortcuts

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