fix: TestExistingResourceConflict testcase

pull/13350/head
Krunal Hingu 1 year ago
parent 3fcc8bfd0e
commit c17f7d3e56

@ -149,17 +149,18 @@ func TestExistingResourceConflict(t *testing.T) {
existing = newDeploymentWithOwner("existing", "ns-a", labels, annotations) existing = newDeploymentWithOwner("existing", "ns-a", labels, annotations)
conflict = newDeploymentWithOwner("conflict", "ns-a", nil, nil) conflict = newDeploymentWithOwner("conflict", "ns-a", nil, nil)
resources = kube.ResourceList{missing, existing} resources = kube.ResourceList{missing, existing}
takeOwnership = false
) )
// Verify only existing resources are returned // Verify only existing resources are returned
found, err := existingResourceConflict(resources, releaseName, releaseNamespace) found, err := existingResourceConflict(resources, releaseName, releaseNamespace, takeOwnership)
assert.NoError(t, err) assert.NoError(t, err)
assert.Len(t, found, 1) assert.Len(t, found, 1)
assert.Equal(t, found[0], existing) assert.Equal(t, found[0], existing)
// Verify that an existing resource that lacks labels/annotations results in an error // Verify that an existing resource that lacks labels/annotations results in an error
resources = append(resources, conflict) resources = append(resources, conflict)
_, err = existingResourceConflict(resources, releaseName, releaseNamespace) _, err = existingResourceConflict(resources, releaseName, releaseNamespace, takeOwnership)
assert.Error(t, err) assert.Error(t, err)
} }

Loading…
Cancel
Save