usecases

package
v0.0.0-...-d48cc7f Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DeletingManifestErrorEvent event.Reason = "DeletingMandatoryModuleManifestError"
View Source
const SettingFinalizerErrorEvent event.Reason = "SettingMandatoryModuleTemplateFinalizerError"

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteManifests

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

DeleteManifests is responsible for deleting all manifests associated with a ModuleReleaseMeta.

func NewDeleteManifests

func NewDeleteManifests(repo ManifestRepo, eventHandler EventHandler) *DeleteManifests

func (*DeleteManifests) Execute

func (*DeleteManifests) IsApplicable

func (d *DeleteManifests) IsApplicable(ctx context.Context, mrm *v1beta2.ModuleReleaseMeta) (bool, error)

IsApplicable returns true if the ModuleReleaseMeta has associated manifests, so they should be deleted.

type EnsureFinalizer

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

EnsureFinalizer is responsible for ensuring that the mandatory finalizer is present on the ModuleReleaseMeta.

func NewEnsureFinalizer

func NewEnsureFinalizer(repo MrmEnsureFinalizerRepo, eventHandler EventHandler) *EnsureFinalizer

func (*EnsureFinalizer) Execute

func (*EnsureFinalizer) IsApplicable

func (e *EnsureFinalizer) IsApplicable(_ context.Context, mrm *v1beta2.ModuleReleaseMeta) (bool, error)

IsApplicable returns true if the ModuleReleaseMeta does not contain the mandatory finalizer, so it should be added.

type EventHandler

type EventHandler interface {
	Warning(object machineryruntime.Object, reason event.Reason, err error)
}

type ManifestRepo

type ManifestRepo interface {
	ListAllForModule(ctx context.Context, moduleName string) ([]apimetav1.PartialObjectMetadata, error)
	DeleteAllForModule(ctx context.Context, moduleName string) error
}

type MrmEnsureFinalizerRepo

type MrmEnsureFinalizerRepo interface {
	EnsureFinalizer(ctx context.Context, moduleName string, finalizer string) error
}

type MrmRemoFinalizerRepo

type MrmRemoFinalizerRepo interface {
	RemoveFinalizer(ctx context.Context, moduleName string, finalizer string) error
}

type RemoveFinalizer

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

RemoveFinalizer is responsible for removing the mandatory finalizer from the ModuleReleaseMeta.

func NewRemoveFinalizer

func NewRemoveFinalizer(repo MrmRemoFinalizerRepo) *RemoveFinalizer

func (*RemoveFinalizer) Execute

func (*RemoveFinalizer) IsApplicable

func (e *RemoveFinalizer) IsApplicable(_ context.Context, mrm *v1beta2.ModuleReleaseMeta) (bool, error)

IsApplicable returns true if the ModuleReleaseMeta contains the mandatory finalizer, so it should be removed. This should be the last step in the deletion process.

type SkipNonDeleting

type SkipNonDeleting struct{}

SkipNonDeleting is a use case that skips ModuleReleaseMetas that are not in deleting state.

func NewSkipNonDeleting

func NewSkipNonDeleting() *SkipNonDeleting

func (*SkipNonDeleting) Execute

func (*SkipNonDeleting) IsApplicable

func (s *SkipNonDeleting) IsApplicable(_ context.Context, mrm *v1beta2.ModuleReleaseMeta) (bool, error)

IsApplicable returns true if the ModuleReleaseMeta is not in deleting state, it should be skipped.

Jump to

Keyboard shortcuts

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