Use constants instead of hard-coded values
@@ -188,6 +188,11 @@ const (
NamespaceTestOperator = "kubevirt-test-operator"
)
+const (
+ NFSTargetName = "test-nfs-target"
+ ISCSITargetName = "test-isci-target"
+)
+
var testNamespaces = []string{NamespaceTestDefault, NamespaceTestAlternative, NamespaceTestOperator}
var schedulableNode = ""
@@ -3226,16 +3231,16 @@ func CreateISCSITargetPOD(containerDiskName ContainerDisk) (iscsiTargetIP string
resources.Limits[k8sv1.ResourceMemory] = resource.MustParse("256M")
pod := &k8sv1.Pod{
ObjectMeta: metav1.ObjectMeta{
- GenerateName: "test-iscsi-target",
+ GenerateName: ISCSITargetName,
Labels: map[string]string{
- v1.AppLabel: "test-iscsi-target",
+ v1.AppLabel: ISCSITargetName,
},
},
Spec: k8sv1.PodSpec{
RestartPolicy: k8sv1.RestartPolicyNever,
Containers: []k8sv1.Container{
{
- Name: "test-iscsi-target",
+ Name: ISCSITargetName,
Image: image,
Resources: resources,
},
@@ -3352,9 +3357,9 @@ func CreateNFSTargetPOD(os string) (nfsTargetIP string) {
hostPathType := k8sv1.HostPathDirectory
pod := &k8sv1.Pod{
ObjectMeta: metav1.ObjectMeta{
- Name: "test-nfs-target",
+ Name: NFSTargetName,
Labels: map[string]string{
- v1.AppLabel: "test-nfs-target",
+ v1.AppLabel: NFSTargetName,
},
},
Spec: k8sv1.PodSpec{
@@ -3372,7 +3377,7 @@ func CreateNFSTargetPOD(os string) (nfsTargetIP string) {
},
Containers: []k8sv1.Container{
{
- Name: "test-nfs-target",
+ Name: NFSTargetName,
Image: image,
ImagePullPolicy: k8sv1.PullAlways,
Resources: resources,
