From c17f7d3e56c33cf2232daa403e2a7b9568039472 Mon Sep 17 00:00:00 2001 From: Krunal Hingu Date: Mon, 16 Sep 2024 14:40:11 +0530 Subject: [PATCH] fix: TestExistingResourceConflict testcase --- pkg/action/validate_test.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/action/validate_test.go b/pkg/action/validate_test.go index e73594e86..2e0e3b57e 100644 --- a/pkg/action/validate_test.go +++ b/pkg/action/validate_test.go @@ -145,21 +145,22 @@ func TestExistingResourceConflict(t *testing.T) { helmReleaseNameAnnotation: releaseName, helmReleaseNamespaceAnnotation: releaseNamespace, } - missing = newMissingDeployment("missing", "ns-a") - existing = newDeploymentWithOwner("existing", "ns-a", labels, annotations) - conflict = newDeploymentWithOwner("conflict", "ns-a", nil, nil) - resources = kube.ResourceList{missing, existing} + missing = newMissingDeployment("missing", "ns-a") + existing = newDeploymentWithOwner("existing", "ns-a", labels, annotations) + conflict = newDeploymentWithOwner("conflict", "ns-a", nil, nil) + resources = kube.ResourceList{missing, existing} + takeOwnership = false ) // Verify only existing resources are returned - found, err := existingResourceConflict(resources, releaseName, releaseNamespace) + found, err := existingResourceConflict(resources, releaseName, releaseNamespace, takeOwnership) assert.NoError(t, err) assert.Len(t, found, 1) assert.Equal(t, found[0], existing) // Verify that an existing resource that lacks labels/annotations results in an error resources = append(resources, conflict) - _, err = existingResourceConflict(resources, releaseName, releaseNamespace) + _, err = existingResourceConflict(resources, releaseName, releaseNamespace, takeOwnership) assert.Error(t, err) }