basemanager

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: Apache-2.0 Imports: 19 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound indicates the resource was not found.
	ErrNotFound = errors.New("Resource not found")

	// ErrOwnershipMismatch indicates that one of the subresources does
	// not have the right ownership.
	ErrOwnershipMismatch = errors.New("Ownership Mismatch")

	// ErrSync detected during SyncResource
	ErrSync = errors.New("Sync Error")

	// ErrInstall detected during InstallResource
	ErrInstall = errors.New("Install Error")

	// ErrUninstall detected during UninstallResource
	ErrUninstall = errors.New("Uninstall Error")

	// ErrUpdate detected during UpdateResource
	ErrUpdate = errors.New("Update Error")

	// ErrReconcile detected during ReconcileResource
	ErrReconcile = errors.New("Reconcile Error")
)

Functions

This section is empty.

Types

type DependentResourceWatchUpdater

type DependentResourceWatchUpdater func([]unstructured.Unstructured) error

DependentResourceWatchUpdater does xxx

func BuildDependentResourceWatchUpdater

func BuildDependentResourceWatchUpdater(mgr manager.Manager, owner *unstructured.Unstructured,
	c controller.Controller, dependentPredicate crtpredicate.Funcs) DependentResourceWatchUpdater

BuildDependentResourceWatchUpdater builds a function that adds watches for resources in released Helm charts.

type KubedgeBaseManager

type KubedgeBaseManager struct {
	KubeClient     client.Client
	Renderer       KubedgeResourceRenderer
	OwnerRefs      []metav1.OwnerReference
	PhaseName      string
	PhaseNamespace string
	Source         *av1.KubedgeSource

	IsInstalledFlag         bool
	IsUpdateRequiredFlag    bool
	DeployedSubResourceList *av1.SubResourceList
}

KubedgeBaseManager provides the default implementation.

func (KubedgeBaseManager) BaseInstallResource

func (m KubedgeBaseManager) BaseInstallResource(ctx context.Context) (*av1.SubResourceList, error)

BaseInstallResource creates K8s sub resources (Workflow, Job, ....) attached to this Phase CR

func (KubedgeBaseManager) BaseReconcileResource

func (m KubedgeBaseManager) BaseReconcileResource(ctx context.Context) (*av1.SubResourceList, error)

BaseReconcileResource creates or patches resources as necessary to match this Phase CR

func (*KubedgeBaseManager) BaseSync

func (m *KubedgeBaseManager) BaseSync(ctx context.Context) error

BaseSync retrieves from K8s the sub resources (Workflow, Job, ....) attached to this Oslc CR

func (KubedgeBaseManager) BaseUninstallResource

func (m KubedgeBaseManager) BaseUninstallResource(ctx context.Context) (*av1.SubResourceList, error)

BaseUninstallResource delete K8s sub resources (Workflow, Job, ....) attached to this Phase CR

func (KubedgeBaseManager) BaseUpdateResource

BaseUpdateResource updates K8s sub resources (Workflow, Job, ....) attached to this Phase CR

func (KubedgeBaseManager) IsInstalled

func (m KubedgeBaseManager) IsInstalled() bool

IsInstalled indicates with the resources have been installed.

func (KubedgeBaseManager) IsUpdateRequired

func (m KubedgeBaseManager) IsUpdateRequired() bool

IsUpdateRequired indicates with the resources have been installed.

func (KubedgeBaseManager) Render added in v0.1.5

Render a chart or just a file

func (KubedgeBaseManager) ResourceName

func (m KubedgeBaseManager) ResourceName() string

ResourceName returns the name of the release.

type KubedgeResourceManager

type KubedgeResourceManager interface {
	ResourceName() string
	IsInstalled() bool
	IsUpdateRequired() bool
	Render(ctx context.Context) (*av1.SubResourceList, error)
	Sync(context.Context) error
	InstallResource(context.Context) (*av1.SubResourceList, error)
	UpdateResource(context.Context) (*av1.SubResourceList, *av1.SubResourceList, error)
	ReconcileResource(context.Context) (*av1.SubResourceList, error)
	UninstallResource(context.Context) (*av1.SubResourceList, error)
}

KubedgeResourceManager provides the interface for base manaager.

type KubedgeResourceManagerFactory

type KubedgeResourceManagerFactory interface {
	NewArpscanManager(r *av1.Arpscan) KubedgeResourceManager
	NewECDSClusterManager(r *av1.ECDSCluster) KubedgeResourceManager
	NewMMESimManager(r *av1.MMESim) KubedgeResourceManager
	NewEMBBSliceManager(r *av1.EMBBSlice) KubedgeResourceManager
}

KubedgeResourceManagerFactory creates Managers that are specific to custom resources.

func NewManagerFactory

func NewManagerFactory(mgr manager.Manager) KubedgeResourceManagerFactory

NewManagerFactory returns a new factory.

Jump to

Keyboard shortcuts

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