From 02f67181a281a4d6ae6bc9b21970d3cd66718b11 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 5 Nov 2021 19:18:42 +0100 Subject: Fix swagger definition for the new mac address type The new mac address type broke the api docs. While we could successfully generate the swagger file it could not be viewed in a browser. The problem is that the swagger generation create two type definitions with the name `HardwareAddr` and this pointed back to itself. Thus the render process was stucked in an endless loop. To fix this manually rename the new type to MacAddress and overwrite the types to string because the json unmarshaller accepts the mac as string. Signed-off-by: Paul Holzinger --- pkg/specgen/podspecgen.go | 1 + pkg/specgen/specgen.go | 1 + 2 files changed, 2 insertions(+) (limited to 'pkg/specgen') diff --git a/pkg/specgen/podspecgen.go b/pkg/specgen/podspecgen.go index 32d5be79a..948fb990c 100644 --- a/pkg/specgen/podspecgen.go +++ b/pkg/specgen/podspecgen.go @@ -99,6 +99,7 @@ type PodNetworkConfig struct { // Only available if NetNS is set to Bridge (the default for root). // As such, conflicts with NoInfra=true by proxy. // Optional. + // swagger:strfmt string StaticMAC *types.HardwareAddr `json:"static_mac,omitempty"` // PortMappings is a set of ports to map into the infra container. // As, by default, containers share their network with the infra diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go index 593d91c64..8a4497130 100644 --- a/pkg/specgen/specgen.go +++ b/pkg/specgen/specgen.go @@ -401,6 +401,7 @@ type ContainerNetworkConfig struct { // StaticMAC is a static MAC address to set in the container. // Only available if NetNS is set to bridge. // Optional. + // swagger:strfmt string StaticMAC *nettypes.HardwareAddr `json:"static_mac,omitempty"` // PortBindings is a set of ports to map into the container. // Only available if NetNS is set to bridge or slirp. -- cgit v1.2.3-54-g00ecf