Skip to content

Commit 0156f6c

Browse files
committed
Fix TestInstanceUpdate kind name conflicts in integration tests (#553)
This commit resolves a naming conflict in integration tests where the "TestUpdate" kind was being used in both the Update and CRD test suites, causing test failures due to conflicting CRD definitions. While fixing this, I noticed we should be more careful about resource ownership in general. kro should respect ownership labels not just for CRDs but for all managed resources. Before modifying any resource (CRD or managed resources), we should verify its actually "ours" by checking the ownership labels. This would prevent the exact type of conflict we saw here, where one RGD might accidentally modify resources that belong to other RGDs.
1 parent 34fdba2 commit 0156f6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/integration/suites/core/lifecycle_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var _ = Describe("Update", func() {
4949
// Create ResourceGraphDefinition for a simple deployment service
5050
rgd := generator.NewResourceGraphDefinition("test-update",
5151
generator.WithSchema(
52-
"TestUpdate", "v1alpha1",
52+
"TestInstanceUpdate", "v1alpha1",
5353
map[string]interface{}{
5454
"replicas": "integer | default=1",
5555
"image": "string | default=nginx:latest",
@@ -110,7 +110,7 @@ var _ = Describe("Update", func() {
110110
instance := &unstructured.Unstructured{
111111
Object: map[string]interface{}{
112112
"apiVersion": fmt.Sprintf("%s/%s", krov1alpha1.KRODomainName, "v1alpha1"),
113-
"kind": "TestUpdate",
113+
"kind": "TestInstanceUpdate",
114114
"metadata": map[string]interface{}{
115115
"name": "test-instance-for-updates",
116116
"namespace": namespace,

0 commit comments

Comments
 (0)