Skip to content

Commit

Permalink
tests: eliminate public constant subresourceTestLabel
Browse files Browse the repository at this point in the history
The constant is placed in the only function that uses it, which makes
the function easier to read, and makes test/utils a bit shorter

Signed-off-by: <[email protected]>
  • Loading branch information
dankenigsberg committed Jul 10, 2022
1 parent fcdeeb9 commit de7191a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/subresource_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,16 @@ var _ = Describe("[sig-compute]Subresource Api", func() {
})

func testClientJob(virtCli kubecli.KubevirtClient, withServiceAccount bool, resource string) {
const subresourceTestLabel = "subresource-access-test-pod"

namespace := util.NamespaceTestDefault
expectedPhase := k8sv1.PodFailed
name := "subresource-access-tester"
job := &k8sv1.Pod{
ObjectMeta: metav1.ObjectMeta{
GenerateName: name,
Labels: map[string]string{
v1.AppLabel: tests.SubresourceTestLabel,
v1.AppLabel: subresourceTestLabel,
},
},
Spec: k8sv1.PodSpec{
Expand Down
2 changes: 0 additions & 2 deletions tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ const (
EchoLastReturnValue = "echo $?\n"
)

const SubresourceTestLabel = "subresource-access-test-pod"

const (
OSWindows = "windows"
OSWindowsSysprep = "windows-sysprep" // This is for sysprep tests, they run on a syspreped image of windows of a different version.
Expand Down

0 comments on commit de7191a

Please sign in to comment.