Skip to content

Commit

Permalink
Remove redundant DeepCopy() in some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvoncek committed Nov 22, 2024
1 parent f0c6a02 commit 7b3e21b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions controllers/reaper/reaper_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,9 @@ func testCreateReaperWithLocalStorageType(t *testing.T, ctx context.Context, k8s

// In this configuration, we expect Reaper to have a config volume mount, and a data volume mount
assert.Len(t, sts.Spec.Template.Spec.Containers[0].VolumeMounts, 2)
confVolumeMount := sts.Spec.Template.Spec.Containers[0].VolumeMounts[0].DeepCopy()
confVolumeMount := sts.Spec.Template.Spec.Containers[0].VolumeMounts[0]
assert.Equal(t, "conf", confVolumeMount.Name)
dataVolumeMount := sts.Spec.Template.Spec.Containers[0].VolumeMounts[1].DeepCopy()
dataVolumeMount := sts.Spec.Template.Spec.Containers[0].VolumeMounts[1]
assert.Equal(t, "reaper-data", dataVolumeMount.Name)
}

Expand Down Expand Up @@ -601,11 +601,11 @@ func testCreateReaperWithHttpAuthEnabled(t *testing.T, ctx context.Context, k8sC

// In this configuration, we expect Reaper to also have a mount for the http auth secrets
assert.Len(t, sts.Spec.Template.Spec.Containers[0].VolumeMounts, 3)
confVolumeMount := sts.Spec.Template.Spec.Containers[0].VolumeMounts[0].DeepCopy()
confVolumeMount := sts.Spec.Template.Spec.Containers[0].VolumeMounts[0]
assert.Equal(t, "conf", confVolumeMount.Name)
dataVolumeMount := sts.Spec.Template.Spec.Containers[0].VolumeMounts[2].DeepCopy()
dataVolumeMount := sts.Spec.Template.Spec.Containers[0].VolumeMounts[2]
assert.Equal(t, "reaper-data", dataVolumeMount.Name)
truststoresVolumeMount := sts.Spec.Template.Spec.Containers[0].VolumeMounts[1].DeepCopy()
truststoresVolumeMount := sts.Spec.Template.Spec.Containers[0].VolumeMounts[1]
assert.Equal(t, "management-api-keystores-per-cluster", truststoresVolumeMount.Name)

// when we delete reaper, the STS and the secret both go away due to the owner reference
Expand Down

0 comments on commit 7b3e21b

Please sign in to comment.