mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-10-22 07:52:12 +00:00
Update kubernetes.cni.cncf.io -> k8s.cni.cncf.io
This commit is contained in:
committed by
Kuralamudhan Ramakrishnan
parent
6e440b4fa8
commit
a4567df76a
@@ -52,7 +52,7 @@ func (f *FakeKubeClient) GetRawWithPath(path string) ([]byte, error) {
|
||||
|
||||
func (f *FakeKubeClient) AddNetConfig(namespace, name, data string) {
|
||||
cr := fmt.Sprintf(`{
|
||||
"apiVersion": "kubernetes.cni.cncf.io/v1",
|
||||
"apiVersion": "k8s.cni.cncf.io/v1",
|
||||
"kind": "Network",
|
||||
"metadata": {
|
||||
"namespace": "%s",
|
||||
@@ -64,19 +64,19 @@ func (f *FakeKubeClient) AddNetConfig(namespace, name, data string) {
|
||||
}`, namespace, name, strings.Replace(data, "\"", "\\\"", -1))
|
||||
cr = strings.Replace(cr, "\n", "", -1)
|
||||
cr = strings.Replace(cr, "\t", "", -1)
|
||||
f.nets[fmt.Sprintf("/apis/kubernetes.cni.cncf.io/v1/namespaces/%s/network-attachment-definitions/%s", namespace, name)] = cr
|
||||
f.nets[fmt.Sprintf("/apis/k8s.cni.cncf.io/v1/namespaces/%s/network-attachment-definitions/%s", namespace, name)] = cr
|
||||
}
|
||||
|
||||
func (f *FakeKubeClient) AddNetFile(namespace, name, filePath, fileData string) {
|
||||
cr := fmt.Sprintf(`{
|
||||
"apiVersion": "kubernetes.cni.cncf.io/v1",
|
||||
"apiVersion": "k8s.cni.cncf.io/v1",
|
||||
"kind": "Network",
|
||||
"metadata": {
|
||||
"namespace": "%s",
|
||||
"name": "%s"
|
||||
}
|
||||
}`, namespace, name)
|
||||
f.nets[fmt.Sprintf("/apis/kubernetes.cni.cncf.io/v1/namespaces/%s/network-attachment-definitions/%s", namespace, name)] = cr
|
||||
f.nets[fmt.Sprintf("/apis/k8s.cni.cncf.io/v1/namespaces/%s/network-attachment-definitions/%s", namespace, name)] = cr
|
||||
|
||||
err := ioutil.WriteFile(filePath, []byte(fileData), 0600)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
@@ -113,7 +113,7 @@ func NewFakePod(name string, netAnnotation string) *v1.Pod {
|
||||
netAnnotation = strings.Replace(netAnnotation, "\n", "", -1)
|
||||
netAnnotation = strings.Replace(netAnnotation, "\t", "", -1)
|
||||
pod.ObjectMeta.Annotations = map[string]string{
|
||||
"kubernetes.v1.cni.cncf.io/networks": netAnnotation,
|
||||
"k8s.v1.cni.cncf.io/networks": netAnnotation,
|
||||
}
|
||||
}
|
||||
return pod
|
||||
|
Reference in New Issue
Block a user