mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-28 12:51:01 +00:00
Change pod annotation name to 'v1.multus-cni.io/default-network'
This commit is contained in:
parent
c3be74d7d6
commit
96217dd16e
@ -38,6 +38,7 @@ import (
|
||||
|
||||
const (
|
||||
resourceNameAnnot = "k8s.v1.cni.cncf.io/resourceName"
|
||||
defaultNetAnnot = "v1.multus-cni.io/default-network"
|
||||
)
|
||||
|
||||
// NoK8sNetworkError indicates error, no network in kubernetes
|
||||
@ -643,7 +644,7 @@ func getPodDefaultNetworkAnnotation(client KubeClient, k8sArgs *types.K8sArgs) (
|
||||
return "", logging.Errorf("getPodDefaultNetworkAnnotation: failed to query the pod %v in out of cluster comm: %v", string(k8sArgs.K8S_POD_NAME), err)
|
||||
}
|
||||
|
||||
if v, ok := pod.Annotations["multus-cni.io/default-network"]; ok {
|
||||
if v, ok := pod.Annotations[defaultNetAnnot]; ok {
|
||||
return v, nil
|
||||
}
|
||||
return "", nil
|
||||
|
@ -124,7 +124,7 @@ func NewFakePod(name string, netAnnotation string, defaultNetAnnotation string)
|
||||
}
|
||||
|
||||
if defaultNetAnnotation != "" {
|
||||
annotations["multus-cni.io/default-network"] = defaultNetAnnotation
|
||||
annotations["v1.multus-cni.io/default-network"] = defaultNetAnnotation
|
||||
}
|
||||
|
||||
pod.ObjectMeta.Annotations = annotations
|
||||
|
Loading…
Reference in New Issue
Block a user