Skip to content

Commit

Permalink
Set correct policy after module unmanage (#2317)
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipRudy authored Jan 16, 2025
1 parent a9ca132 commit 50e5878
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions internal/kube/kyma/kyma.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ func unmanageModule(kymaCR *Kyma, moduleName string) (*Kyma, error) {
if m.Name == moduleName {
// module exists, update managed
kymaCR.Spec.Modules[i].Managed = ptr.To(false)
kymaCR.Spec.Modules[i].CustomResourcePolicy = "Ignore"

return kymaCR, nil
}
Expand Down
20 changes: 12 additions & 8 deletions internal/kube/kyma/kyma_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,9 @@ func Test_unmanageModule(t *testing.T) {
Spec: KymaSpec{
Modules: []Module{
{
Name: "module",
Managed: ptr.To(false),
Name: "module",
Managed: ptr.To(false),
CustomResourcePolicy: "Ignore",
},
},
},
Expand All @@ -770,8 +771,9 @@ func Test_unmanageModule(t *testing.T) {
Spec: KymaSpec{
Modules: []Module{
{
Name: "module",
Managed: ptr.To(false),
Name: "module",
Managed: ptr.To(false),
CustomResourcePolicy: "Ignore",
},
},
},
Expand All @@ -784,8 +786,9 @@ func Test_unmanageModule(t *testing.T) {
Spec: KymaSpec{
Modules: []Module{
{
Name: "module",
Managed: ptr.To(true),
Name: "module",
Managed: ptr.To(true),
CustomResourcePolicy: "CreateAndDelete",
},
},
},
Expand All @@ -794,8 +797,9 @@ func Test_unmanageModule(t *testing.T) {
Spec: KymaSpec{
Modules: []Module{
{
Name: "module",
Managed: ptr.To(false),
Name: "module",
Managed: ptr.To(false),
CustomResourcePolicy: "Ignore",
},
},
},
Expand Down

0 comments on commit 50e5878

Please sign in to comment.