From 59d524d46388f28f89f44ebb56af27f2dfb68c12 Mon Sep 17 00:00:00 2001 From: Anita Akaeze Date: Mon, 5 Feb 2024 15:13:24 -0800 Subject: [PATCH] Add json tags to api-gateway types (#3550) --- charts/consul/templates/crd-apigateways.yaml | 124 ++++++++++++++---- .../templates/crd-trafficpermissions.yaml | 72 +++++----- .../api/mesh/v2beta1/api_gateway_types.go | 8 +- ...nsul.hashicorp.com_trafficpermissions.yaml | 72 +++++----- ...mesh.consul.hashicorp.com_apigateways.yaml | 124 ++++++++++++++---- 5 files changed, 276 insertions(+), 124 deletions(-) diff --git a/charts/consul/templates/crd-apigateways.yaml b/charts/consul/templates/crd-apigateways.yaml index 755fb05b64..e68a384b25 100644 --- a/charts/consul/templates/crd-apigateways.yaml +++ b/charts/consul/templates/crd-apigateways.yaml @@ -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 diff --git a/charts/consul/templates/crd-trafficpermissions.yaml b/charts/consul/templates/crd-trafficpermissions.yaml index 27ab6f5e3d..87727f4fbf 100644 --- a/charts/consul/templates/crd-trafficpermissions.yaml +++ b/charts/consul/templates/crd-trafficpermissions.yaml @@ -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: @@ -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. diff --git a/control-plane/api/mesh/v2beta1/api_gateway_types.go b/control-plane/api/mesh/v2beta1/api_gateway_types.go index 60b94019d3..254cc8b793 100644 --- a/control-plane/api/mesh/v2beta1/api_gateway_types.go +++ b/control-plane/api/mesh/v2beta1/api_gateway_types.go @@ -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"` } diff --git a/control-plane/config/crd/bases/auth.consul.hashicorp.com_trafficpermissions.yaml b/control-plane/config/crd/bases/auth.consul.hashicorp.com_trafficpermissions.yaml index 3a7699dce4..ca29923851 100644 --- a/control-plane/config/crd/bases/auth.consul.hashicorp.com_trafficpermissions.yaml +++ b/control-plane/config/crd/bases/auth.consul.hashicorp.com_trafficpermissions.yaml @@ -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: @@ -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. diff --git a/control-plane/config/crd/bases/mesh.consul.hashicorp.com_apigateways.yaml b/control-plane/config/crd/bases/mesh.consul.hashicorp.com_apigateways.yaml index 44713c234f..eb18d564de 100644 --- a/control-plane/config/crd/bases/mesh.consul.hashicorp.com_apigateways.yaml +++ b/control-plane/config/crd/bases/mesh.consul.hashicorp.com_apigateways.yaml @@ -192,41 +192,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