Skip to content

Commit

Permalink
chore: Deprecate .spec.channel field in ModuleTemplate API (#1932)
Browse files Browse the repository at this point in the history
* chore: deprecate .spec.channel field in ModuleTemplate API

* chore: update manifests

* fix: match moduletemplate api versions

* fix: match moduletemplate api versions

---------

Co-authored-by: Jeremy Harisch <[email protected]>
  • Loading branch information
LeelaChacha and jeremyharisch authored Oct 11, 2024
1 parent e508ff7 commit 01eb24e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions api/v1beta1/moduletemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ type ModuleTemplate struct {
type ModuleTemplateSpec struct {
// Channel is the targeted channel of the ModuleTemplate. It will be used to directly assign a Template
// to a target channel. It has to be provided at any given time.
// Deprecated: This field is deprecated and will be removed in a future release.
// +optional
// +kubebuilder:deprecatedversion
// +kubebuilder:validation:Pattern:=^[a-z]+$
// +kubebuilder:validation:MaxLength:=32
// +kubebuilder:validation:MinLength:=3
Expand Down
3 changes: 3 additions & 0 deletions api/v1beta2/moduletemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ func (d *Descriptor) DeepCopyObject() machineryruntime.Object {
type ModuleTemplateSpec struct {
// Channel is the targeted channel of the ModuleTemplate. It will be used to directly assign a Template
// to a target channel. It has to be provided at any given time.
// Deprecated: This field is deprecated and will be removed in a future release.
// +optional
// +kubebuilder:deprecatedversion
// +kubebuilder:validation:Pattern:=^[a-z]+$
// +kubebuilder:validation:MaxLength:=32
// +kubebuilder:validation:MinLength:=3
Expand Down
14 changes: 7 additions & 7 deletions config/crd/bases/operator.kyma-project.io_moduletemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ spec:
description: |-
Channel is the targeted channel of the ModuleTemplate. It will be used to directly assign a Template
to a target channel. It has to be provided at any given time.
Deprecated: This field is deprecated and will be removed in a future release.
maxLength: 32
minLength: 3
pattern: ^[a-z]+$
Expand Down Expand Up @@ -119,7 +120,6 @@ spec:
- remote
type: string
required:
- channel
- descriptor
- target
type: object
Expand Down Expand Up @@ -180,6 +180,7 @@ spec:
description: |-
Channel is the targeted channel of the ModuleTemplate. It will be used to directly assign a Template
to a target channel. It has to be provided at any given time.
Deprecated: This field is deprecated and will be removed in a future release.
maxLength: 32
minLength: 3
pattern: ^[a-z]+$
Expand Down Expand Up @@ -259,19 +260,19 @@ spec:
description: Name is the name of the icon.
type: string
required:
- link
- name
- link
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
- name
x-kubernetes-list-type: map
repository:
description: Repository is the link to the repository of the module.
type: string
required:
- documentation
- repository
- documentation
- repository
type: object
mandatory:
description: |-
Expand Down Expand Up @@ -310,7 +311,6 @@ spec:
pattern: ^((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-[a-zA-Z-][0-9a-zA-Z-]*)?)?$
type: string
required:
- channel
- descriptor
type: object
type: object
Expand Down
8 changes: 5 additions & 3 deletions docs/contributor/resources/03-moduletemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ kubectl get crd moduletemplates.operator.kyma-project.io -o yaml

## Configuration

### **.spec.channel**
### **.spec.channel** (Deprecated)

The channel that a ModuleTemplate CR is registered in. It is used alongside the channel attributes of the Kyma CR to match up a module and a channel.
The `channel` field previously indicated the channel in which a ModuleTemplate CR was registered. It was used alongside the channel attributes of the Kyma CR to match a module with a specific channel.

**Note:** This field is now deprecated and will be removed in a future release. It has been decided that ModuleTemplates are now tied directly to versions, rather than being associated with channels.

For the following ModuleTemplate CR:

Expand All @@ -27,7 +29,7 @@ spec:
channel: regular
```
the module will be referenced by any Kyma CR asking for it in the `regular` channel.
the module was referenced by any Kyma CR asking for it in the `regular` channel.

### **.spec.data**

Expand Down

0 comments on commit 01eb24e

Please sign in to comment.