Skip to content

Commit

Permalink
fix: pci driver rebind config validation
Browse files Browse the repository at this point in the history
We need a field named `name` to distinguish between named documents, as
decoder expects a `name` yaml key.

Fixes: #10025

Fixes by using standard `name` field instead of `pciID`.

Signed-off-by: Noel Georgi <[email protected]>
  • Loading branch information
frezbo committed Dec 25, 2024
1 parent 4b97bbc commit 7e5d36d
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 52 deletions.
6 changes: 3 additions & 3 deletions pkg/machinery/config/schemas/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@
"markdownDescription": "kind is the kind of the resource.",
"x-intellij-html-description": "\u003cp\u003ekind is the kind of the resource.\u003c/p\u003e\n"
},
"pciID": {
"name": {
"type": "string",
"title": "pciID",
"title": "name",
"description": "PCI device id\n",
"markdownDescription": "PCI device id",
"x-intellij-html-description": "\u003cp\u003ePCI device id\u003c/p\u003e\n"
Expand All @@ -207,7 +207,7 @@
"required": [
"apiVersion",
"kind",
"pciID",
"name",
"targetDriver"
]
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/machinery/config/types/hardware/hardware_doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type PCIDriverRebindConfigV1Alpha1 struct {
// description: |
// PCI device id
// schemaRequired: true
MetaName string `yaml:"pciID"`
MetaName string `yaml:"name"`
// description: |
// Target driver to rebind the PCI device to.
// schemaRequired: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1alpha1
kind: PCIDriverRebindConfig
pciID: "0000:04:00.00"
name: "0000:04:00.00"
targetDriver: vfio-pci
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ title: PCIDriverRebindConfig
{{< highlight yaml >}}
apiVersion: v1alpha1
kind: PCIDriverRebindConfig
pciID: 0000:04:00.00 # PCI device id
name: 0000:04:00.00 # PCI device id
targetDriver: vfio-pci # Target driver to rebind the PCI device to.
{{< /highlight >}}


| Field | Type | Description | Value(s) |
|-------|------|-------------|----------|
|`pciID` |string |PCI device id | |
|`name` |string |PCI device id | |
|`targetDriver` |string |Target driver to rebind the PCI device to. | |


Expand Down
6 changes: 3 additions & 3 deletions website/content/v1.10/schemas/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@
"markdownDescription": "kind is the kind of the resource.",
"x-intellij-html-description": "\u003cp\u003ekind is the kind of the resource.\u003c/p\u003e\n"
},
"pciID": {
"name": {
"type": "string",
"title": "pciID",
"title": "name",
"description": "PCI device id\n",
"markdownDescription": "PCI device id",
"x-intellij-html-description": "\u003cp\u003ePCI device id\u003c/p\u003e\n"
Expand All @@ -207,7 +207,7 @@
"required": [
"apiVersion",
"kind",
"pciID",
"name",
"targetDriver"
]
},
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 7e5d36d

Please sign in to comment.