Skip to content

Commit

Permalink
Add json tags to api-gateway types (#3550)
Browse files Browse the repository at this point in the history
  • Loading branch information
NiniOak authored Feb 5, 2024
1 parent 13caead commit 59d524d
Show file tree
Hide file tree
Showing 5 changed files with 276 additions and 124 deletions.
124 changes: 98 additions & 26 deletions charts/consul/templates/crd-apigateways.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,41 +196,113 @@ spec:
type: object
status:
properties:
conditions:
description: Conditions indicate the latest available observations
of a resource's current state.
addresses:
items:
description: 'Conditions define a readiness condition for a Consul
resource. See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties'
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the condition
transitioned from one status to another.
format: date-time
type:
default: IPAddress
type: string
message:
description: A human readable message indicating details about
the transition.
value:
type: string
reason:
description: The reason for the condition's last transition.
required:
- type
- value
type: object
type: array
listeners:
items:
properties:
attachedRoutes:
format: int32
type: integer
name:
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of condition.
type: string
properties:
conditions:
description: Conditions indicate the latest available observations
of a resource's current state.
items:
description: 'Conditions define a readiness condition
for a Consul resource. See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties'
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the
condition transitioned from one status to another.
format: date-time
type: string
message:
description: A human readable message indicating details
about the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True,
False, Unknown.
type: string
type:
description: Type of condition.
type: string
required:
- status
- type
type: object
type: array
lastSyncedTime:
description: LastSyncedTime is the last time the resource
successfully synced with Consul.
format: date-time
type: string
type: object
required:
- status
- type
- attachedRoutes
- name
type: object
type: array
lastSyncedTime:
description: LastSyncedTime is the last time the resource successfully
synced with Consul.
format: date-time
type: string
status:
properties:
conditions:
description: Conditions indicate the latest available observations
of a resource's current state.
items:
description: 'Conditions define a readiness condition for a
Consul resource. See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties'
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A human readable message indicating details
about the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True, False,
Unknown.
type: string
type:
description: Type of condition.
type: string
required:
- status
- type
type: object
type: array
lastSyncedTime:
description: LastSyncedTime is the last time the resource successfully
synced with Consul.
format: date-time
type: string
type: object
required:
- addresses
- listeners
type: object
type: object
served: true
Expand Down
72 changes: 38 additions & 34 deletions charts/consul/templates/crd-trafficpermissions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,25 @@ spec:
when evaluating rules for the incoming connection.
items:
properties:
header:
properties:
exact:
type: string
invert:
type: boolean
name:
type: string
prefix:
type: string
present:
type: boolean
regex:
type: string
suffix:
type: string
type: object
headers:
items:
properties:
exact:
type: string
invert:
type: boolean
name:
type: string
prefix:
type: string
present:
type: boolean
regex:
type: string
suffix:
type: string
type: object
type: array
methods:
description: Methods is the list of HTTP methods.
items:
Expand All @@ -138,23 +140,25 @@ spec:
type: array
type: object
type: array
header:
properties:
exact:
type: string
invert:
type: boolean
name:
type: string
prefix:
type: string
present:
type: boolean
regex:
type: string
suffix:
type: string
type: object
headers:
items:
properties:
exact:
type: string
invert:
type: boolean
name:
type: string
prefix:
type: string
present:
type: boolean
regex:
type: string
suffix:
type: string
type: object
type: array
methods:
description: Methods is the list of HTTP methods. If no
methods are specified, this rule will apply to all methods.
Expand Down
8 changes: 4 additions & 4 deletions control-plane/api/mesh/v2beta1/api_gateway_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ type APIGateway struct {
}

type APIGatewayStatus struct {
Status
Addresses []GatewayAddress
Listeners []ListenerStatus
Status `json:"status,omitempty"`
Addresses []GatewayAddress `json:"addresses"`
Listeners []ListenerStatus `json:"listeners"`
}

type ListenerStatus struct {
Status
Status `json:"status,omitempty"`
Name string `json:"name"`
AttachedRoutes int32 `json:"attachedRoutes"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,25 @@ spec:
when evaluating rules for the incoming connection.
items:
properties:
header:
properties:
exact:
type: string
invert:
type: boolean
name:
type: string
prefix:
type: string
present:
type: boolean
regex:
type: string
suffix:
type: string
type: object
headers:
items:
properties:
exact:
type: string
invert:
type: boolean
name:
type: string
prefix:
type: string
present:
type: boolean
regex:
type: string
suffix:
type: string
type: object
type: array
methods:
description: Methods is the list of HTTP methods.
items:
Expand All @@ -134,23 +136,25 @@ spec:
type: array
type: object
type: array
header:
properties:
exact:
type: string
invert:
type: boolean
name:
type: string
prefix:
type: string
present:
type: boolean
regex:
type: string
suffix:
type: string
type: object
headers:
items:
properties:
exact:
type: string
invert:
type: boolean
name:
type: string
prefix:
type: string
present:
type: boolean
regex:
type: string
suffix:
type: string
type: object
type: array
methods:
description: Methods is the list of HTTP methods. If no
methods are specified, this rule will apply to all methods.
Expand Down
Loading

0 comments on commit 59d524d

Please sign in to comment.