-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Module catalog improvements implementation #1748
feat: Module catalog improvements implementation #1748
Conversation
7894a11
to
4056f0b
Compare
3e62f0c
to
1cf8ae0
Compare
r.Metrics.RecordRequeueReason(metrics.StatusSyncToRemote, queue.UnexpectedRequeue) | ||
return newReconcileResult(r.requeueWithError(ctx, kyma, fmt.Errorf("could not synchronize remote kyma status: %w", sErr))) | ||
} | ||
return newReconcileResult(ctrl.Result{}, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you return ctrl.Result{}, nil
, then this kyma will not reconcile anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update: I don't think you need to change this existing logic #1748 (comment)
pkg/templatelookup/regular_test.go
Outdated
WithModuleStatus(v1beta2.ModuleStatus{ | ||
Name: moduleToInstall.Name, | ||
Channel: "regular", | ||
Version: "1.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you define those versions for testing 1.1.0
, 1.0.0
as a const value so that better for us to understand which field to test here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that just version numbers serve as a better "name" than the name itself - they're usually shorter and visually distinct. But If you think consts like "oldVersion" "newVersion" are better, I'll do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
besides those comment, please also cover this missing AC in this one or followup issue.
The Lifecycle-Manager must support both the old ModuleTemplates and a new ones (with extended attributes) - we must provide a smooth migration path
There's a unit test with over 10 scenarios in |
tests/moduletemplates/moduletemplate_template_operator_v2_direct_version.yaml
Show resolved
Hide resolved
return !a.Enabled && shared.NoneChannel.Equals(a.Channel) && a.Version != "" | ||
} | ||
|
||
func GetAvailableModules(kyma *v1beta2.Kyma) []AvailableModule { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you refactor this GetAvailableModules
not belong to kyma struct, I think it's better to rename it, not use GetXXX
, it's not aligned with the naming conversion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
return filteredTemplates[0], nil | ||
} | ||
|
||
func (t *TemplateLookup) getTemplateByVersion(ctx context.Context, name, version string) ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation is fine, but we should plan a follow-up refactor to optimize the get template
function. Instead of using List
, we should retrieve the template directly by its moduleTemplate
name. Since the moduleTemplate
names follow a strict naming convention of [module name] + [channel or version]
, it will be straightforward to implement a Get
request for direct fetching. This change will improve performance, especially when dealing with a large number of resources, as List
is not efficient in such scenarios.
Can you create a followup issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c2f8f54
into
kyma-project:feat/module-catalogue-improvements
Description
Fixes #1591
Changes proposed in this pull request:
Related issue(s)
#1589 , #1590
Compatibility
The following scenarios has been tested (pkg/templatelookup/regular_test.go):