Skip to content

Conversation

LeelaChacha
Copy link
Contributor

Description

Changes proposed in this pull request:

  • Introduce Deletion Service with its use cases

Related issue(s)

#2631

@LeelaChacha LeelaChacha requested a review from a team as a code owner October 15, 2025 13:28
@LeelaChacha LeelaChacha linked an issue Oct 15, 2025 that may be closed by this pull request
9 tasks
@LeelaChacha LeelaChacha changed the title feat: Introduce Deletion Service feat: Introduce Mandatory Module Deletion Service Oct 15, 2025
Copy link
Member

@lindnerby lindnerby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Some comments left :)

"github.com/kyma-project/lifecycle-manager/api/v1beta2"
)

type UseCase interface {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like it!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But not so sure if the ShouldExecute is needed.
You could just Execute the usecase and return the same errors or nil as Should Execute. Feels like a unnecessary indirection.
Usecases are anyways not very complex and mostly pass through to repos.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can talk about it in detail tomorrow in the office. @LeelaChacha is coming as well.

But the basic idea was that per invocation of the reconciliation loop, only one use case is executed. E.g., if ensureFinalizer should execute, we will apply the finalizer and return to the controller. Only in the next invocation of the reconciliation loop another use case may execute consecutively.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:) No need, I got the idea. 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then just as a small improvement suggestion, let's rename to the following:

 // IsApplicable checks if this deletion step use-case should be executed now
 IsApplicable(ctx context.Context, mrm *v1beta2.ModuleReleaseMeta) (bool, error)

"github.com/kyma-project/lifecycle-manager/api/v1beta2"
)

type UseCase interface {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then just as a small improvement suggestion, let's rename to the following:

 // IsApplicable checks if this deletion step use-case should be executed now
 IsApplicable(ctx context.Context, mrm *v1beta2.ModuleReleaseMeta) (bool, error)

@LeelaChacha LeelaChacha enabled auto-merge (squash) October 16, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ModuleReleaseMeta for Mandatory Modules

3 participants