-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Modules should be in error state when SKR cluster is deleted (#2093
) * adjust for linux * set all modules to error when SKR doesn't exist * Add e2e test * Add e2e test * Add e2e test * remove local changes * review fix
- Loading branch information
1 parent
2adf01d
commit aedda36
Showing
7 changed files
with
104 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package e2e_test | ||
|
||
import ( | ||
"os/exec" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
|
||
. "github.com/kyma-project/lifecycle-manager/pkg/testutils" | ||
|
||
"github.com/kyma-project/lifecycle-manager/api/shared" | ||
"github.com/kyma-project/lifecycle-manager/api/v1beta2" | ||
) | ||
|
||
var _ = Describe("KCP Kyma Module status on SKR connection lost", Ordered, func() { | ||
kyma := NewKymaWithSyncLabel("kyma-sample", ControlPlaneNamespace, v1beta2.DefaultChannel) | ||
module := NewTemplateOperator(v1beta2.DefaultChannel) | ||
moduleCR := NewTestModuleCR(RemoteNamespace) | ||
|
||
InitEmptyKymaBeforeAll(kyma) | ||
|
||
Context("Given SKR Cluster", func() { | ||
It("When Kyma Module is enabled on SKR Cluster", func() { | ||
Eventually(EnableModule). | ||
WithContext(ctx). | ||
WithArguments(skrClient, defaultRemoteKymaName, RemoteNamespace, module). | ||
Should(Succeed()) | ||
Eventually(ModuleCRExists). | ||
WithContext(ctx). | ||
WithArguments(skrClient, moduleCR). | ||
Should(Succeed()) | ||
}) | ||
|
||
It("Then KCP Kyma CR is in \"Ready\" State", func() { | ||
Eventually(KymaIsInState). | ||
WithContext(ctx). | ||
WithArguments(kyma.GetName(), kyma.GetNamespace(), kcpClient, shared.StateReady). | ||
Should(Succeed()) | ||
}) | ||
|
||
It("And KCP Kyma CR status.modules are in \"Ready\" State", func() { | ||
Eventually(CheckModuleState). | ||
WithContext(ctx). | ||
WithArguments(kcpClient, kyma.GetName(), kyma.GetNamespace(), module.Name, shared.StateReady). | ||
Should(Succeed()) | ||
}) | ||
|
||
It("When SKR Cluster is removed", func() { | ||
cmd := exec.Command("k3d", "cluster", "stop", "skr") | ||
out, err := cmd.CombinedOutput() | ||
Expect(err).NotTo(HaveOccurred()) | ||
GinkgoWriter.Printf(string(out)) | ||
}) | ||
|
||
It("Then KCP Kyma CR is in \"Error\" State", func() { | ||
Eventually(KymaIsInState). | ||
WithContext(ctx). | ||
WithArguments(kyma.GetName(), kyma.GetNamespace(), kcpClient, shared.StateError). | ||
Should(Succeed()) | ||
}) | ||
|
||
It("And KCP Kyma CR status.modules are in \"Error\" State", func() { | ||
Eventually(CheckModuleState). | ||
WithContext(ctx). | ||
WithArguments(kcpClient, kyma.GetName(), kyma.GetNamespace(), module.Name, shared.StateError). | ||
Should(Succeed()) | ||
}) | ||
}) | ||
}) |