[Module catalogue improvements] Update ModuleTemplate API version to support fixed module versions #1590
Closed
7 tasks done
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
Description
Note: This issue is just about API change, the change in the controller logic is expected to be implemented here
As described here, ModuleTemplate CR must be extended.
What we essentially want follows the ideas from the community-modules repository.
In general, we want that:
In addition, to support Deletion modes we need a
managedResources
list describing the list of Group/Version/Kinds that are defined by the Module's Team as "managed" by the module.There is a decision record for that. Assuming that list is embedded, no further API changes are required on the ModuleTemplate CR.
The set of ModuleTemplate CRs in the control-plane defines the Module Catalog for the Lifecycle-Manager.
The above requirements can be implemented by releasing a new ModuleTemplate API version with the following changes:
channel
attributeversion
attribute. At the moment it is an annotation:"operator.kyma-project.io/module-version": "0.1.2"
. This attribute will be required in the futurename
attribute. At the moment it is a label:"operator.kyma-project.io/module-name": "template-operator"
. It is not strictly required, it's just to make the API more robust. It will be required in the future.Reasons
We need that to support features described in #1472
The Data Model
Example: Consider a module:
foo
.It will be released in two versions available for user to install:
1.0.0
,2.0.0
.Additionally there is a
2.2.0
version that is only available in theexperimental
channel.The
1.0.0
is released in theregular
channel, the2.0.0
version is released in thefast
channelWe need five ModuleTemplate CRs to model that:
regular
channelfast
channelexperimental
channelAfter some time, the team decides to upgrade the module in the
regular
channel and also make the version2.2.0
explicitly available for users. In order to do that the module team must:regular
channel:2.2.0
version:In this model, the channel is just another "version" to choose from. The channel doesn't refer to any other ModuleTemplate CR, it only references an OCM artifact - like any other version. It is responsibility of the Team that manages the module to take care that the ModuleTemplate with a channel as a version refers to a proper OCM artifact. In other words the mapping of "channel" to "module version" is implicit here.
Yet, the desired feature of having a channel that is a "label" on a single module version is achieved. For example, a ModuleTemplate for some module that uses
regular
as a version may refer to the same OCM artifact as a ModuleTemplate for the same module that uses1.0.0
as a version. It may also refer to the OCM artifact for which there is no explicit "versioned" ModuleTemplate, yet it is still some version - because it exists as an OCM artifact so it was released.Single attribute vs two attributes
The same model can be expressed in two ways:
version
attribute that can take values like1.0.0
,2.0.0
,regular
,fast
etc.channel
attribute (regular
,fast
) and a separateversion
attribute (1.0.0
,2.0.0
) with additional validation that only one of these may be defined - the other one must be empty.A single attribute solution is simpler, but if this cannot be easily validated (a string that is either semantic version OR arbitrary token), the double-attribute solution is an option.
Summary
We have decided to go with the two-attribute solution described in this comment.
No validation is required for now.
Examples for valid Module Templates
Acceptance Criteria
version
attribute. The value must be a semantic version.channel
attribute should stay mandatory.moduleName
attribute (currently it is a label).version
attribute to become mandatorymoduleName
attribute to become mandatoryNotes:
In order to support existing ModuleTemplates, the version must be optional. Existing modules will have it empty.
New modules will have the version provided.
The same with the new moduleName attribute.
The implementation must deal with that correctly.
Feature Testing
e2e tests for validation on the new API version.
Testing approach
No response
Attachments
No response
Related issue(s)
#1472
The text was updated successfully, but these errors were encountered: