Remove unused ptpConfCRD constant, rename the current one to ptpConfCRD.
@@ -45,8 +45,7 @@ import (
const (
postUrl = "/apis/k8s.cni.cncf.io/v1/namespaces/%s/network-attachment-definitions/%s"
linuxBridgeConfCRD = `{"apiVersion":"k8s.cni.cncf.io/v1","kind":"NetworkAttachmentDefinition","metadata":{"name":"%s","namespace":"%s"},"spec":{"config":"{ \"cniVersion\": \"0.3.1\", \"name\": \"mynet\", \"plugins\": [{\"type\": \"bridge\", \"bridge\": \"br10\", \"vlan\": 100, \"ipam\": {}},{\"type\": \"tuning\"}]}"}}`
- ptpConfCRD = `{"apiVersion":"k8s.cni.cncf.io/v1","kind":"NetworkAttachmentDefinition","metadata":{"name":"%s","namespace":"%s"},"spec":{"config":"{ \"name\": \"mynet\", \"type\": \"ptp\", \"ipam\": { \"type\": \"host-local\", \"subnet\": \"10.1.1.0/24\" } }"}}`
- ptpConfWithTuningCRD = `{"apiVersion":"k8s.cni.cncf.io/v1","kind":"NetworkAttachmentDefinition","metadata":{"name":"%s","namespace":"%s"},"spec":{"config":"{ \"cniVersion\": \"0.3.1\", \"name\": \"mynet\", \"plugins\": [{\"type\": \"ptp\", \"ipam\": { \"type\": \"host-local\", \"subnet\": \"10.1.1.0/24\" }},{\"type\": \"tuning\"}]}"}}`
+ ptpConfCRD = `{"apiVersion":"k8s.cni.cncf.io/v1","kind":"NetworkAttachmentDefinition","metadata":{"name":"%s","namespace":"%s"},"spec":{"config":"{ \"cniVersion\": \"0.3.1\", \"name\": \"mynet\", \"plugins\": [{\"type\": \"ptp\", \"ipam\": { \"type\": \"host-local\", \"subnet\": \"10.1.1.0/24\" }},{\"type\": \"tuning\"}]}"}}`
sriovConfCRD = `{"apiVersion":"k8s.cni.cncf.io/v1","kind":"NetworkAttachmentDefinition","metadata":{"name":"%s","namespace":"%s","annotations":{"k8s.v1.cni.cncf.io/resourceName":"%s"}},"spec":{"config":"{ \"name\": \"sriov\", \"type\": \"sriov\", \"ipam\": { \"type\": \"host-local\", \"subnet\": \"10.1.1.0/24\" } }"}}`
)
@@ -134,14 +133,14 @@ var _ = Describe("Multus", func() {
result = virtClient.RestClient().
Post().
RequestURI(fmt.Sprintf(postUrl, tests.NamespaceTestDefault, "ptp-conf-tuning-1")).
- Body([]byte(fmt.Sprintf(ptpConfWithTuningCRD, "ptp-conf-tuning-1", tests.NamespaceTestDefault))).
+ Body([]byte(fmt.Sprintf(ptpConfCRD, "ptp-conf-tuning-1", tests.NamespaceTestDefault))).
Do()
Expect(result.Error()).NotTo(HaveOccurred())
result = virtClient.RestClient().
Post().
RequestURI(fmt.Sprintf(postUrl, tests.NamespaceTestAlternative, "ptp-conf-tuning-2")).
- Body([]byte(fmt.Sprintf(ptpConfWithTuningCRD, "ptp-conf-tuning-2", tests.NamespaceTestAlternative))).
+ Body([]byte(fmt.Sprintf(ptpConfCRD, "ptp-conf-tuning-2", tests.NamespaceTestAlternative))).
Do()
Expect(result.Error()).NotTo(HaveOccurred())
})
