Skip to content

Commit

Permalink
Merge pull request #14 from xrd/with-multus-name-change
Browse files Browse the repository at this point in the history
Add NAD name to CNI config.
  • Loading branch information
ebeaty-cisco authored and GitHub Enterprise committed Jun 6, 2024
2 parents 706643c + c94f8d8 commit a8d9fb9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion charts/xrd-common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ keywords:
- xrd
sources:
- https://github.com/ios-xr/xrd-helm
version: 1.1.0-beta.0
version: 1.1.0-beta.1
1 change: 1 addition & 0 deletions charts/xrd-common/templates/_network-attachments.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
config: |-
{
"cniVersion": "0.3.1",
"name": "{{ include "xrd.fullname" $ }}-{{ $cniIndex }}",
"plugins": [
{{- $intf.config | toPrettyJson | nindent 8 }}
]
Expand Down
4 changes: 2 additions & 2 deletions charts/xrd-control-plane/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ keywords:
- xrd
sources:
- https://github.com/ios-xr/xrd-helm
version: 1.1.0-beta.0
version: 1.1.0-beta.1
dependencies:
- name: xrd-common
version: 1.1.0-beta.0
version: 1.1.0-beta.1
repository: "file://../xrd-common"
4 changes: 2 additions & 2 deletions charts/xrd-vrouter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ keywords:
- xrd
sources:
- https://github.com/ios-xr/xrd-helm
version: 1.1.0-beta.0
version: 1.1.0-beta.1
dependencies:
- name: xrd-common
version: 1.1.0-beta.0
version: 1.1.0-beta.1
repository: "file://../xrd-common"
6 changes: 3 additions & 3 deletions tests/ut/xrd-control-plane/network-attachments.bats
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ setup_file () {
@test "Control Plane NetworkAttachmentDefinition: Check default config" {
template --set-json 'interfaces=[{"type": "multus"}]'
assert_query_equal '.spec.config' \
"{\n \"cniVersion\": \"0.3.1\",\n \"plugins\": [\n null\n ]\n}"
"{\n \"cniVersion\": \"0.3.1\",\n \"name\": \"release-name-xrd-control-plane-0\",\n \"plugins\": [\n null\n ]\n}"
}

@test "Control Plane NetworkAttachmentDefinition: Config can be set for MGMT interfaces" {
template --set-json 'mgmtInterfaces=[{"type": "multus", "config": {"foo": "bar"}}]'
assert_query_equal '.spec.config'\
"{\n \"cniVersion\": \"0.3.1\",\n \"plugins\": [\n {\n \"foo\": \"bar\"\n }\n ]\n}"
"{\n \"cniVersion\": \"0.3.1\",\n \"name\": \"release-name-xrd-control-plane-0\",\n \"plugins\": [\n {\n \"foo\": \"bar\"\n }\n ]\n}"
}

@test "Control Plane NetworkAttachmentDefinition: Config can be set for interfaces" {
template --set-json 'interfaces=[{"type": "multus", "config": {"foo": "bar"}}]'
assert_query_equal '.spec.config' \
"{\n \"cniVersion\": \"0.3.1\",\n \"plugins\": [\n {\n \"foo\": \"bar\"\n }\n ]\n}"
"{\n \"cniVersion\": \"0.3.1\",\n \"name\": \"release-name-xrd-control-plane-0\",\n \"plugins\": [\n {\n \"foo\": \"bar\"\n }\n ]\n}"
}

@test "Control Plane NetworkAttachmentDefinition: No interfaces" {
Expand Down
6 changes: 3 additions & 3 deletions tests/ut/xrd-vrouter/network-attachments.bats
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ setup_file () {
@test "vRouter NetworkAttachmentDefinition (multus): Check default config" {
template --set-json 'mgmtInterfaces=[{"type": "multus"}]'
assert_query_equal '.spec.config' \
"{\n \"cniVersion\": \"0.3.1\",\n \"plugins\": [\n null\n ]\n}"
"{\n \"cniVersion\": \"0.3.1\",\n \"name\": \"release-name-xrd-vrouter-0\",\n \"plugins\": [\n null\n ]\n}"
}

@test "vRouter NetworkAttachmentDefinition (multus): Config can be set" {
template --set-json 'mgmtInterfaces=[{"type": "multus", "config": {"foo": "bar"}}]'
assert_query_equal '.spec.config' \
"{\n \"cniVersion\": \"0.3.1\",\n \"plugins\": [\n {\n \"foo\": \"bar\"\n }\n ]\n}"
"{\n \"cniVersion\": \"0.3.1\",\n \"name\": \"release-name-xrd-vrouter-0\",\n \"plugins\": [\n {\n \"foo\": \"bar\"\n }\n ]\n}"
}

@test "vRouter NetworkAttachmentDefinition (sriov): Name consists of the release name, template name and index" {
Expand Down Expand Up @@ -133,7 +133,7 @@ setup_file () {
@test "vRouter NetworkAttachmentDefinition (sriov): Config can be set" {
template --set-json 'interfaces=[{"type": "sriov", "resource": "foo", "config": {"type": "sriov"}}]'
assert_query_equal '.spec.config' \
"{\n \"cniVersion\": \"0.3.1\",\n \"plugins\": [\n {\n \"type\": \"sriov\"\n }\n ]\n}"
"{\n \"cniVersion\": \"0.3.1\",\n \"name\": \"release-name-xrd-vrouter-0\",\n \"plugins\": [\n {\n \"type\": \"sriov\"\n }\n ]\n}"
}

@test "vRouter NetworkAttachmentDefinition: multiple sriov interfaces can be created together" {
Expand Down

0 comments on commit a8d9fb9

Please sign in to comment.