Skip to content
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: Prevent unallowed internal/beta module installation #2111

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

c-pius
Copy link
Contributor

@c-pius c-pius commented Dec 11, 2024

Description

Changes proposed in this pull request:

  • Prevents the installation of beta or internal module for non-beta or non-internal Kymas
    • previously, installation was possible even though the metadata was not synced to the SKR
    • for old module templates we had this covered, but for new module templates this didn't work
  • covered by unit tests
  • covered by integration tests
  • covered by e2e tests

Related issue(s)

@c-pius c-pius requested a review from a team as a code owner December 11, 2024 14:56
@kyma-bot kyma-bot added cla: yes Indicates the PR's author has signed the CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 11, 2024
@@ -135,10 +136,21 @@ func (t *TemplateLookup) populateModuleTemplateInfoUsingModuleReleaseMeta(ctx co
return templateInfo
}

func ValidateTemplateMode(template ModuleTemplateInfo, kyma *v1beta2.Kyma) ModuleTemplateInfo {
func (t *TemplateLookup) ValidateTemplateMode(ctx context.Context, template ModuleTemplateInfo, kyma *v1beta2.Kyma) ModuleTemplateInfo {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

to reviewer: this file contains the "core" change from business logic perspective. The rest is mainly testing code and boilerplate.

The structure of the code follows the same pattern that we introduced for PopulateModuleTemplateInfo.

@c-pius c-pius force-pushed the feat/prevent-unallowed-module-installation branch from 5fa0608 to fb379c9 Compare December 12, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Module Catalog] Support internal and beta flags for updated module metadata
2 participants