Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
feat: patch bgpsession spec to remove status enum (#178)
Browse files Browse the repository at this point in the history
While testing the new cluster API 1.5 changes in
kubernetes-sigs/cluster-api-provider-packet#674
We discovered the API was returning down,down for the bgpsessionstatus
after enabling BGP on a device. This didn't match any of the values in
the enum and would return an error.
@ctreatma  recommends we remove this enum and go back to just a string.

---------

Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
Co-authored-by: Charles Treatman <ctreatman@equinix.com>
  • Loading branch information
cprivitere and ctreatma authored Dec 6, 2023
1 parent df3a206 commit cd21e3a
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 170 deletions.
1 change: 0 additions & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ Class | Method | HTTP request | Description
- [BgpSessionAddressFamily](docs/BgpSessionAddressFamily.md)
- [BgpSessionList](docs/BgpSessionList.md)
- [BgpSessionNeighbors](docs/BgpSessionNeighbors.md)
- [BgpSessionStatus](docs/BgpSessionStatus.md)
- [BondPortData](docs/BondPortData.md)
- [CapacityCheckPerFacilityInfo](docs/CapacityCheckPerFacilityInfo.md)
- [CapacityCheckPerFacilityList](docs/CapacityCheckPerFacilityList.md)
Expand Down
28 changes: 11 additions & 17 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12692,7 +12692,7 @@ components:
learned_routes:
- 10.32.16.0/31
- 10.32.16.0/31
status: null
status: status
- address_family: null
updated_at: 2000-01-23T04:56:07.000+00:00
created_at: 2000-01-23T04:56:07.000+00:00
Expand All @@ -12704,7 +12704,7 @@ components:
learned_routes:
- 10.32.16.0/31
- 10.32.16.0/31
status: null
status: status
ranges:
- address_family: 6
project:
Expand Down Expand Up @@ -14990,7 +14990,7 @@ components:
learned_routes:
- 10.32.16.0/31
- 10.32.16.0/31
status: null
status: status
properties:
address_family:
$ref: '#/components/schemas/BgpSession_address_family'
Expand All @@ -15013,7 +15013,12 @@ components:
type: string
type: array
status:
$ref: '#/components/schemas/BgpSession_status'
description: " The status of the BGP Session. Multiple status values may\
\ be reported when the device is connected to multiple switches, one value\
\ per switch. Each status will start with \"unknown\" and progress to\
\ \"up\" or \"down\" depending on the connected device. Subsequent \"\
unknown\" values indicate a problem acquiring status from the switch. "
type: string
updated_at:
format: date-time
type: string
Expand All @@ -15034,7 +15039,7 @@ components:
learned_routes:
- 10.32.16.0/31
- 10.32.16.0/31
status: null
status: status
- address_family: null
updated_at: 2000-01-23T04:56:07.000+00:00
created_at: 2000-01-23T04:56:07.000+00:00
Expand All @@ -15046,7 +15051,7 @@ components:
learned_routes:
- 10.32.16.0/31
- 10.32.16.0/31
status: null
status: status
properties:
bgp_sessions:
items:
Expand Down Expand Up @@ -30464,17 +30469,6 @@ components:
- ipv4
- ipv6
type: string
BgpSession_status:
description: " The status of the BGP Session. Multiple status values may be\
\ reported when the device is connected to multiple switches, one value per\
\ switch. Each status will start with \"unknown\" and progress to \"up\" or\
\ \"down\" depending on the connected device. Subsequent \"unknown\" values\
\ indicate a problem acquiring status from the switch. "
enum:
- unknown
- up
- down
type: string
CreateSelfServiceReservationRequest_period_count:
enum:
- 12
Expand Down
8 changes: 4 additions & 4 deletions docs/BgpSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Name | Type | Description | Notes
**Href** | Pointer to **string** | | [optional]
**Id** | Pointer to **string** | | [optional]
**LearnedRoutes** | Pointer to **[]string** | | [optional]
**Status** | Pointer to [**BgpSessionStatus**](BgpSessionStatus.md) | | [optional]
**Status** | Pointer to **string** | The status of the BGP Session. Multiple status values may be reported when the device is connected to multiple switches, one value per switch. Each status will start with \&quot;unknown\&quot; and progress to \&quot;up\&quot; or \&quot;down\&quot; depending on the connected device. Subsequent \&quot;unknown\&quot; values indicate a problem acquiring status from the switch. | [optional]
**UpdatedAt** | Pointer to **time.Time** | | [optional]

## Methods
Expand Down Expand Up @@ -205,20 +205,20 @@ HasLearnedRoutes returns a boolean if a field has been set.

### GetStatus

`func (o *BgpSession) GetStatus() BgpSessionStatus`
`func (o *BgpSession) GetStatus() string`

GetStatus returns the Status field if non-nil, zero value otherwise.

### GetStatusOk

`func (o *BgpSession) GetStatusOk() (*BgpSessionStatus, bool)`
`func (o *BgpSession) GetStatusOk() (*string, bool)`

GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetStatus

`func (o *BgpSession) SetStatus(v BgpSessionStatus)`
`func (o *BgpSession) SetStatus(v string)`

SetStatus sets Status field to given value.

Expand Down
15 changes: 0 additions & 15 deletions docs/BgpSessionStatus.md

This file was deleted.

2 changes: 0 additions & 2 deletions metal/v1/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ docs/BgpSession.md
docs/BgpSessionAddressFamily.md
docs/BgpSessionList.md
docs/BgpSessionNeighbors.md
docs/BgpSessionStatus.md
docs/BondPortData.md
docs/CapacityApi.md
docs/CapacityCheckPerFacilityInfo.md
Expand Down Expand Up @@ -414,7 +413,6 @@ model_bgp_session_input.go
model_bgp_session_input_address_family.go
model_bgp_session_list.go
model_bgp_session_neighbors.go
model_bgp_session_status.go
model_bond_port_data.go
model_capacity_check_per_facility_info.go
model_capacity_check_per_facility_list.go
Expand Down
29 changes: 15 additions & 14 deletions metal/v1/model_bgp_session.go

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

113 changes: 0 additions & 113 deletions metal/v1/model_bgp_session_status.go

This file was deleted.

15 changes: 15 additions & 0 deletions patches/spec.fetched.json/20231206-remove-bgp-session.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/spec/oas3.patched/components/schemas/BgpSession.yaml b/spec/oas3.patched/components/schemas/BgpSession.yaml
index db8baf8..50bcc22 100644
--- a/spec/oas3.patched/components/schemas/BgpSession.yaml
+++ b/spec/oas3.patched/components/schemas/BgpSession.yaml
@@ -28,10 +28,6 @@ properties:
status will start with "unknown" and progress to "up" or "down" depending on
the connected device. Subsequent "unknown" values indicate a problem acquiring
status from the switch. '
- enum:
- - unknown
- - up
- - down
type: string
updated_at:
format: date-time
4 changes: 0 additions & 4 deletions spec/oas3.patched/components/schemas/BgpSession.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ properties:
status will start with "unknown" and progress to "up" or "down" depending on
the connected device. Subsequent "unknown" values indicate a problem acquiring
status from the switch. '
enum:
- unknown
- up
- down
type: string
updated_at:
format: date-time
Expand Down

0 comments on commit cd21e3a

Please sign in to comment.