Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bindata/network/multus/multus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ metadata:
data:
daemon-config.json: |
{
"cniVersion": "0.3.1",
"cniVersion": "1.1.0",
"chrootDir": "/hostroot",
"logToStderr": true,
"logLevel": "verbose",
Expand Down
21 changes: 15 additions & 6 deletions bindata/network/ovn-kubernetes/common/error-cni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data:
#!/bin/bash
set -e

cniVersionStr="0.4.0"
cniVersionStr="1.1.0"
addErrorStr="Only host backed pods supported on DPU in Infra Cluster."
unknownErrorStr="Unknown cni command: $CNI_COMMAND"

Expand All @@ -25,7 +25,7 @@ data:
\"msg\": \"Not Supported\",
\"details\": \"${addErrorStr}\"
}"
exit 1
exit 1
;;

DEL)
Expand All @@ -34,10 +34,19 @@ data:
GET)
;;

STATUS)
echo "{
\"cniVersion\": \"${cniVersionStr}\"
}"
;;

GC)
;;

VERSION)
echo "{
\"cniVersion\": \"${cniVersionStr}\",
\"supportedVersions\": [ \"0.3.0\", \"0.3.1\", \"0.4.0\" ]
\"cniVersion\": \"${cniVersionStr}\",
\"supportedVersions\": [ \"0.3.0\", \"0.3.1\", \"0.4.0\", \"1.0.0\", \"1.1.0\" ]
}"
;;

Expand All @@ -48,7 +57,7 @@ data:
\"msg\": \"Invalid Configuration\",
\"details\": \"${unknownErrorStr}\"
}"
exit 1
exit 1
;;

esac
Expand All @@ -65,7 +74,7 @@ metadata:
release.openshift.io/version: "{{.ReleaseVersion}}"
data:
08-error-cni.conf: |-
{"cniVersion":"0.4.0","name":"error-cni","type":"error-cni"}
{"cniVersion":"1.1.0","name":"error-cni","type":"error-cni"}
Comment on lines 76 to +77
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n bindata/network/ovn-kubernetes/common/error-cni.yaml | sed -n '70,85p'

Repository: openshift/cluster-network-operator

Length of output: 641


🌐 Web query:

CNI specification v1.0.0 network configuration format list single plugin

💡 Result:

In CNI specification v1.0.0, the network configuration is always a “configuration list” (i.e., it has a top-level plugins array). The spec explicitly notes that non-list configurations were removed in v1.0.0. [1]

So, a “single plugin” network is represented as a list with exactly one plugin object in plugins:

{
  "cniVersion": "1.0.0",
  "name": "mynet",
  "plugins": [
    {
      "type": "bridge"
      // ... plugin-specific fields (e.g., "bridge", "ipam", etc.)
    }
  ]
}

Top-level fields include cniVersion, name, and plugins (a list of plugin configuration objects where each plugin object must at least contain type). [1]

Source: CNI SPEC.md at tag spec-v1.0.0. [1]

References:
[1] (raw.githubusercontent.com)

Citations:


Convert to CNI list format to comply with v1.0.0+ specifications.

Line 77 advertises cniVersion: "1.1.0" but uses a bare plugin object format. CNI specification v1.0.0 and later require all configurations to be lists with a top-level plugins array. The correct format should be:

{"cniVersion":"1.1.0","name":"error-cni","plugins":[{"type":"error-cni"}]}

Strict CNI runtimes will reject the current configuration due to the missing plugins wrapper.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bindata/network/ovn-kubernetes/common/error-cni.yaml` around lines 76 - 77,
The CNI config stored under the manifest key "08-error-cni.conf" uses a bare
plugin object with cniVersion "1.1.0" which violates v1.0.0+ spec; update the
JSON to the list format by replacing the top-level plugin object
({"cniVersion":"1.1.0","name":"error-cni","type":"error-cni"}) with a plugins
array containing the plugin object (e.g.,
{"cniVersion":"1.1.0","name":"error-cni","plugins":[{"type":"error-cni"}]}) so
the config is accepted by strict CNI runtimes.


---
kind: DaemonSet
Expand Down