mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-09-09 12:51:39 +00:00
clean code (#952)
Signed-off-by: yanggang <gang.yang@daocloud.io> Signed-off-by: yanggang <gang.yang@daocloud.io>
This commit is contained in:
@@ -190,7 +190,7 @@ func parsePodNetworkAnnotation(podNetworks, defaultNamespace string) ([]*types.N
|
||||
return nil, logging.Errorf("parsePodNetworkAnnotation: pod annotation does not have \"network\" as key")
|
||||
}
|
||||
|
||||
if strings.IndexAny(podNetworks, "[{\"") >= 0 {
|
||||
if strings.ContainsAny(podNetworks, "[{\"") {
|
||||
if err := json.Unmarshal([]byte(podNetworks), &networks); err != nil {
|
||||
return nil, logging.Errorf("parsePodNetworkAnnotation: failed to parse pod Network Attachment Selection Annotation JSON format: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user