Skip to content

Alpha module list#2884

Open
anoipm wants to merge 29 commits intokyma-project:mainfrom
anoipm:alpha-module-list
Open

Alpha module list#2884
anoipm wants to merge 29 commits intokyma-project:mainfrom
anoipm:alpha-module-list

Conversation

@anoipm
Copy link
Copy Markdown
Contributor

@anoipm anoipm commented Apr 15, 2026

Description

Changes proposed in this pull request:

  • add (alpha/v2) module list command

Related issue(s)
See also:

@anoipm anoipm added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 15, 2026
@anoipm anoipm requested a review from a team as a code owner April 15, 2026 18:49
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

✅ Proposed changes verification passed

This pull request comes with up-to-date documentation and no illegal standard output usages.

Find more detailed information in the verify / standards (pull_request_target) action.

@anoipm anoipm requested a review from a team as a code owner April 15, 2026 19:07
return &installedModulesRepository{kymaClient: kymaClient}
}

func (r *installedModulesRepository) ListInstalledModules(ctx context.Context) ([]kyma.KymaModuleInfo, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here we leak the raw/low-level type kyma.KymaModuleInfo while we should return some entity related to the repository. It's InstalledModulesRepository so it suggest that it should return some kind of a module. Currently we don't have any Module entity in our domain. Also I wouldn't necessarily like the Module name as it's very general name in our case, the whole package is called Module. I was thinking about something like ModuleInstallation, we could have the ModuleInstallation entity + ModuleInstallationRepository

Comment on lines +26 to +40
if spec.CustomResourcePolicy == "CreateAndDelete" {
return status.State, nil
}

if spec.Managed != nil && !*spec.Managed {
return status.State, nil
}

moduleTemplate, err := r.kubeClient.Kyma().GetModuleTemplate(ctx, status.Template.GetNamespace(), status.Template.GetName())
if err != nil {
if apierrors.IsNotFound(err) {
return "", nil
}
return "", errors.Wrapf(err, "failed to get ModuleTemplate %s/%s", status.Template.GetNamespace(), status.Template.GetName())
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Repositories should be responsible for mapping between the outside world (k8s cluster/database/some external rest service) and the inside world (our domain layer) and this code is some business logic responsible for the state calculation. This kind of code should be a part of service

Comment thread internal/modulesv2/list.go Outdated
Version: module.Status.Version,
Channel: module.Status.Channel,
ModuleState: module.Status.State,
Managed: module.Spec.Managed == nil || *module.Spec.Managed,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we are lacking the proper Entities here and we are explicitly describing here some internal behavior or some internal business rule, I would imagine we should be able to have something like moduleInstallation.IsManaged()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants