From 352b4e590a50048f9e24978ff8ab6c30b48063dd Mon Sep 17 00:00:00 2001 From: Miguel Duarte Barroso Date: Tue, 22 Mar 2022 11:50:06 +0100 Subject: [PATCH] api, network: provide interface binding types descriptions Signed-off-by: Miguel Duarte Barroso --- api/openapi-spec/swagger.json | 5 ++ .../components/validations_generated.go | 73 +++++++++++++++++++ staging/src/kubevirt.io/api/core/v1/schema.go | 5 ++ .../api/core/v1/schema_swagger_generated.go | 20 +++-- .../client-go/api/openapi_generated.go | 15 ++-- 5 files changed, 108 insertions(+), 10 deletions(-) diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index 29b5726ac577..211b49112757 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -13658,18 +13658,23 @@ } }, "v1.InterfaceBridge": { + "description": "InterfaceBridge connects to a given network via a linux bridge.", "type": "object" }, "v1.InterfaceMacvtap": { + "description": "InterfaceMacvtap connects to a given network by extending the Kubernetes node's L2 networks via a macvtap interface.", "type": "object" }, "v1.InterfaceMasquerade": { + "description": "InterfaceMasquerade connects to a given network using netfilter rules to nat the traffic.", "type": "object" }, "v1.InterfaceSRIOV": { + "description": "InterfaceSRIOV connects to a given network by passing-through an SR-IOV PCI device via vfio.", "type": "object" }, "v1.InterfaceSlirp": { + "description": "InterfaceSlirp connects to a given network using QEMU user networking mode.", "type": "object" }, "v1.KVMTimer": { diff --git a/pkg/virt-operator/resource/generate/components/validations_generated.go b/pkg/virt-operator/resource/generate/components/validations_generated.go index 52c4c7014f66..1438833ba958 100644 --- a/pkg/virt-operator/resource/generate/components/validations_generated.go +++ b/pkg/virt-operator/resource/generate/components/validations_generated.go @@ -5138,6 +5138,8 @@ var CRDsValidation map[string]string = map[string]string{ without a boot order are not tried. type: integer bridge: + description: InterfaceBridge connects to a given network + via a linux bridge. type: object dhcpOptions: description: If specified the network interface will @@ -5183,8 +5185,13 @@ var CRDsValidation map[string]string = map[string]string{ de:ad:00:00:be:af or DE-AD-00-00-BE-AF.' type: string macvtap: + description: InterfaceMacvtap connects to a given + network by extending the Kubernetes node's L2 networks + via a macvtap interface. type: object masquerade: + description: InterfaceMasquerade connects to a given + network using netfilter rules to nat the traffic. type: object model: description: 'Interface model. One of: e1000, e1000e, @@ -5231,8 +5238,12 @@ var CRDsValidation map[string]string = map[string]string{ type: object type: array slirp: + description: InterfaceSlirp connects to a given network + using QEMU user networking mode. type: object sriov: + description: InterfaceSRIOV connects to a given network + by passing-through an SR-IOV PCI device via vfio. type: object tag: description: If specified, the virtual network interface @@ -8369,6 +8380,8 @@ var CRDsValidation map[string]string = map[string]string{ unique value. Interfaces without a boot order are not tried. type: integer bridge: + description: InterfaceBridge connects to a given network via + a linux bridge. type: object dhcpOptions: description: If specified the network interface will pass @@ -8414,8 +8427,13 @@ var CRDsValidation map[string]string = map[string]string{ or DE-AD-00-00-BE-AF.' type: string macvtap: + description: InterfaceMacvtap connects to a given network + by extending the Kubernetes node's L2 networks via a macvtap + interface. type: object masquerade: + description: InterfaceMasquerade connects to a given network + using netfilter rules to nat the traffic. type: object model: description: 'Interface model. One of: e1000, e1000e, ne2k_pci, @@ -8459,8 +8477,12 @@ var CRDsValidation map[string]string = map[string]string{ type: object type: array slirp: + description: InterfaceSlirp connects to a given network using + QEMU user networking mode. type: object sriov: + description: InterfaceSRIOV connects to a given network by + passing-through an SR-IOV PCI device via vfio. type: object tag: description: If specified, the virtual network interface address @@ -10479,6 +10501,8 @@ var CRDsValidation map[string]string = map[string]string{ unique value. Interfaces without a boot order are not tried. type: integer bridge: + description: InterfaceBridge connects to a given network via + a linux bridge. type: object dhcpOptions: description: If specified the network interface will pass @@ -10524,8 +10548,13 @@ var CRDsValidation map[string]string = map[string]string{ or DE-AD-00-00-BE-AF.' type: string macvtap: + description: InterfaceMacvtap connects to a given network + by extending the Kubernetes node's L2 networks via a macvtap + interface. type: object masquerade: + description: InterfaceMasquerade connects to a given network + using netfilter rules to nat the traffic. type: object model: description: 'Interface model. One of: e1000, e1000e, ne2k_pci, @@ -10569,8 +10598,12 @@ var CRDsValidation map[string]string = map[string]string{ type: object type: array slirp: + description: InterfaceSlirp connects to a given network using + QEMU user networking mode. type: object sriov: + description: InterfaceSRIOV connects to a given network by + passing-through an SR-IOV PCI device via vfio. type: object tag: description: If specified, the virtual network interface address @@ -12546,6 +12579,8 @@ var CRDsValidation map[string]string = map[string]string{ without a boot order are not tried. type: integer bridge: + description: InterfaceBridge connects to a given network + via a linux bridge. type: object dhcpOptions: description: If specified the network interface will @@ -12591,8 +12626,13 @@ var CRDsValidation map[string]string = map[string]string{ de:ad:00:00:be:af or DE-AD-00-00-BE-AF.' type: string macvtap: + description: InterfaceMacvtap connects to a given + network by extending the Kubernetes node's L2 networks + via a macvtap interface. type: object masquerade: + description: InterfaceMasquerade connects to a given + network using netfilter rules to nat the traffic. type: object model: description: 'Interface model. One of: e1000, e1000e, @@ -12639,8 +12679,12 @@ var CRDsValidation map[string]string = map[string]string{ type: object type: array slirp: + description: InterfaceSlirp connects to a given network + using QEMU user networking mode. type: object sriov: + description: InterfaceSRIOV connects to a given network + by passing-through an SR-IOV PCI device via vfio. type: object tag: description: If specified, the virtual network interface @@ -16151,6 +16195,8 @@ var CRDsValidation map[string]string = map[string]string{ a boot order are not tried. type: integer bridge: + description: InterfaceBridge connects to a + given network via a linux bridge. type: object dhcpOptions: description: If specified the network interface @@ -16199,8 +16245,14 @@ var CRDsValidation map[string]string = map[string]string{ de:ad:00:00:be:af or DE-AD-00-00-BE-AF.' type: string macvtap: + description: InterfaceMacvtap connects to + a given network by extending the Kubernetes + node's L2 networks via a macvtap interface. type: object masquerade: + description: InterfaceMasquerade connects + to a given network using netfilter rules + to nat the traffic. type: object model: description: 'Interface model. One of: e1000, @@ -16251,8 +16303,14 @@ var CRDsValidation map[string]string = map[string]string{ type: object type: array slirp: + description: InterfaceSlirp connects to a + given network using QEMU user networking + mode. type: object sriov: + description: InterfaceSRIOV connects to a + given network by passing-through an SR-IOV + PCI device via vfio. type: object tag: description: If specified, the virtual network @@ -20130,6 +20188,8 @@ var CRDsValidation map[string]string = map[string]string{ without a boot order are not tried. type: integer bridge: + description: InterfaceBridge connects + to a given network via a linux bridge. type: object dhcpOptions: description: If specified the network @@ -20179,8 +20239,15 @@ var CRDsValidation map[string]string = map[string]string{ example: de:ad:00:00:be:af or DE-AD-00-00-BE-AF.' type: string macvtap: + description: InterfaceMacvtap connects + to a given network by extending the + Kubernetes node's L2 networks via a + macvtap interface. type: object masquerade: + description: InterfaceMasquerade connects + to a given network using netfilter rules + to nat the traffic. type: object model: description: 'Interface model. One of: @@ -20234,8 +20301,14 @@ var CRDsValidation map[string]string = map[string]string{ type: object type: array slirp: + description: InterfaceSlirp connects to + a given network using QEMU user networking + mode. type: object sriov: + description: InterfaceSRIOV connects to + a given network by passing-through an + SR-IOV PCI device via vfio. type: object tag: description: If specified, the virtual diff --git a/staging/src/kubevirt.io/api/core/v1/schema.go b/staging/src/kubevirt.io/api/core/v1/schema.go index 764d2d4ab380..0724688249bd 100644 --- a/staging/src/kubevirt.io/api/core/v1/schema.go +++ b/staging/src/kubevirt.io/api/core/v1/schema.go @@ -1185,14 +1185,19 @@ type InterfaceBindingMethod struct { Macvtap *InterfaceMacvtap `json:"macvtap,omitempty"` } +// InterfaceBridge connects to a given network via a linux bridge. type InterfaceBridge struct{} +// InterfaceSlirp connects to a given network using QEMU user networking mode. type InterfaceSlirp struct{} +// InterfaceMasquerade connects to a given network using netfilter rules to nat the traffic. type InterfaceMasquerade struct{} +// InterfaceSRIOV connects to a given network by passing-through an SR-IOV PCI device via vfio. type InterfaceSRIOV struct{} +// InterfaceMacvtap connects to a given network by extending the Kubernetes node's L2 networks via a macvtap interface. type InterfaceMacvtap struct{} // Port represents a port to expose from the virtual machine. diff --git a/staging/src/kubevirt.io/api/core/v1/schema_swagger_generated.go b/staging/src/kubevirt.io/api/core/v1/schema_swagger_generated.go index a1729538e309..faa5c1db30ba 100644 --- a/staging/src/kubevirt.io/api/core/v1/schema_swagger_generated.go +++ b/staging/src/kubevirt.io/api/core/v1/schema_swagger_generated.go @@ -641,23 +641,33 @@ func (InterfaceBindingMethod) SwaggerDoc() map[string]string { } func (InterfaceBridge) SwaggerDoc() map[string]string { - return map[string]string{} + return map[string]string{ + "": "InterfaceBridge connects to a given network via a linux bridge.", + } } func (InterfaceSlirp) SwaggerDoc() map[string]string { - return map[string]string{} + return map[string]string{ + "": "InterfaceSlirp connects to a given network using QEMU user networking mode.", + } } func (InterfaceMasquerade) SwaggerDoc() map[string]string { - return map[string]string{} + return map[string]string{ + "": "InterfaceMasquerade connects to a given network using netfilter rules to nat the traffic.", + } } func (InterfaceSRIOV) SwaggerDoc() map[string]string { - return map[string]string{} + return map[string]string{ + "": "InterfaceSRIOV connects to a given network by passing-through an SR-IOV PCI device via vfio.", + } } func (InterfaceMacvtap) SwaggerDoc() map[string]string { - return map[string]string{} + return map[string]string{ + "": "InterfaceMacvtap connects to a given network by extending the Kubernetes node's L2 networks via a macvtap interface.", + } } func (Port) SwaggerDoc() map[string]string { diff --git a/staging/src/kubevirt.io/client-go/api/openapi_generated.go b/staging/src/kubevirt.io/client-go/api/openapi_generated.go index e8b2a09b56cd..604f4ea7f66e 100644 --- a/staging/src/kubevirt.io/client-go/api/openapi_generated.go +++ b/staging/src/kubevirt.io/client-go/api/openapi_generated.go @@ -16859,7 +16859,8 @@ func schema_kubevirtio_api_core_v1_InterfaceBridge(ref common.ReferenceCallback) return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "InterfaceBridge connects to a given network via a linux bridge.", + Type: []string{"object"}, }, }, } @@ -16869,7 +16870,8 @@ func schema_kubevirtio_api_core_v1_InterfaceMacvtap(ref common.ReferenceCallback return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "InterfaceMacvtap connects to a given network by extending the Kubernetes node's L2 networks via a macvtap interface.", + Type: []string{"object"}, }, }, } @@ -16879,7 +16881,8 @@ func schema_kubevirtio_api_core_v1_InterfaceMasquerade(ref common.ReferenceCallb return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "InterfaceMasquerade connects to a given network using netfilter rules to nat the traffic.", + Type: []string{"object"}, }, }, } @@ -16889,7 +16892,8 @@ func schema_kubevirtio_api_core_v1_InterfaceSRIOV(ref common.ReferenceCallback) return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "InterfaceSRIOV connects to a given network by passing-through an SR-IOV PCI device via vfio.", + Type: []string{"object"}, }, }, } @@ -16899,7 +16903,8 @@ func schema_kubevirtio_api_core_v1_InterfaceSlirp(ref common.ReferenceCallback) return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "InterfaceSlirp connects to a given network using QEMU user networking mode.", + Type: []string{"object"}, }, }, }