Skip to content

Commit

Permalink
feat: Remove kyma.spec.modules[].version from api (#1837)
Browse files Browse the repository at this point in the history
* remove kyma.spec.modules[n].version from api

* Skip test

* disable test

* skip test

* Skip test

* Update api/v1beta2/kyma_types.go

Co-authored-by: Christoph Schwägerl <[email protected]>

---------

Co-authored-by: Christoph Schwägerl <[email protected]>
  • Loading branch information
Tomasz-Smelcerz-SAP and c-pius committed Sep 10, 2024
1 parent c2f8f54 commit 341b24f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 21 deletions.
6 changes: 3 additions & 3 deletions api/v1beta2/kyma_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ type Module struct {

// Channel is the desired channel of the Module. If this changes or is set, it will be used to resolve a new
// ModuleTemplate based on the new resolved resources.
// The Version and Channel are mutually exclusive options.
// +kubebuilder:validation:Pattern:=^[a-z]+$
// +kubebuilder:validation:MaxLength:=32
// +kubebuilder:validation:MinLength:=3
Expand All @@ -81,8 +80,9 @@ type Module struct {
// ModuleTemplate based on this specific version.
// The Version and Channel are mutually exclusive options.
// The regular expression come from here: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
// +kubebuilder:validation:Pattern:=`^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
Version string `json:"version,omitempty"`
// json:"-" to disable installation of specific versions until decided to roll this out
// see https://github.com/kyma-project/lifecycle-manager/issues/1847
Version string `json:"-"`

// RemoteModuleTemplateRef is deprecated and will no longer have any functionality.
// It will be removed in the upcoming API version.
Expand Down
18 changes: 0 additions & 18 deletions config/crd/bases/operator.kyma-project.io_kymas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ spec:
description: |-
Channel is the desired channel of the Module. If this changes or is set, it will be used to resolve a new
ModuleTemplate based on the new resolved resources.
The Version and Channel are mutually exclusive options.
maxLength: 32
minLength: 3
pattern: ^[a-z]+$
Expand Down Expand Up @@ -98,14 +97,6 @@ spec:
RemoteModuleTemplateRef is deprecated and will no longer have any functionality.
It will be removed in the upcoming API version.
type: string
version:
description: |-
Version is the desired version of the Module. If this changes or is set, it will be used to resolve a new
ModuleTemplate based on this specific version.
The Version and Channel are mutually exclusive options.
The regular expression come from here: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
type: string
required:
- name
type: object
Expand Down Expand Up @@ -506,7 +497,6 @@ spec:
description: |-
Channel is the desired channel of the Module. If this changes or is set, it will be used to resolve a new
ModuleTemplate based on the new resolved resources.
The Version and Channel are mutually exclusive options.
maxLength: 32
minLength: 3
pattern: ^[a-z]+$
Expand Down Expand Up @@ -540,14 +530,6 @@ spec:
RemoteModuleTemplateRef is deprecated and will no longer have any functionality.
It will be removed in the upcoming API version.
type: string
version:
description: |-
Version is the desired version of the Module. If this changes or is set, it will be used to resolve a new
ModuleTemplate based on this specific version.
The Version and Channel are mutually exclusive options.
The regular expression come from here: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
type: string
required:
- name
type: object
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/module_install_by_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ var _ = Describe("Module Install By Version", Ordered, func() {

Context("Given SKR Cluster", func() {
It("When Template-Operator Module is enabled on SKR Kyma CR in a specific version", func() {
Skip("Version attribute is disabled for now on the CRD level")
Eventually(EnableModule).
WithContext(ctx).
WithArguments(runtimeClient, defaultRemoteKymaName, RemoteNamespace, templateOperatorModule).
Should(Succeed())
})

It("Then Module CR exists", func() {
Skip("Version attribute is disabled for now on the CRD level")
Eventually(ModuleCRExists).
WithContext(ctx).
WithArguments(runtimeClient, moduleCR).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var _ = Describe("Given kyma CR with invalid module enabled", Ordered, func() {
})

It("When enable module with channel and version, expect module status in Error state", func() {
Skip("Version attribute is disabled for now on the CRD level")
module := NewTestModuleWithChannelVersion("test", v1beta2.DefaultChannel, "1.0.0")
Eventually(givenKymaWithModule, Timeout, Interval).
WithArguments(kyma, module).Should(Succeed())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
var _ = Describe("Given invalid module version which is rejected by CRD validation rules", func() {
DescribeTable(
"Test enable module", func(givenCondition func() error) {
Skip("Version attribute is disabled for now on the CRD level")
Eventually(givenCondition, Timeout, Interval).Should(Succeed())
},

Expand Down

0 comments on commit 341b24f

Please sign in to comment.