Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,43 @@
}
},
"definitions": {
"ScgRoute": {
"description": "Spring Cloud Gateway route definition",
"type": "object",
"required": [
"id",
"uri"
],
"properties": {
"id": {
Copy link
Member

@TimLovellSmith TimLovellSmith Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to check, is this an azure resource id or not?

Having a writable 'id' property in an Azure rest api is unusual, except in the context of adding references to other resources. In which case often there are few other properties to configure.

It could be confusing compared to Azure resource ids.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would there be a good alternative name for this property?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And maybe I'll have more questions, like what 'scope' is it uniquely identifying things in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's not a Azure resource ID. It can be values like "route1".

The reason is that this spring cloud gateway is an open source middleware. We want to keep the naming convention with the open source configuration to let customers pick it up easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a sample configuration for oss scg:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, probably the best approach is just to be very explicit in the documentation / description of the property as to what its expected to contain / look like, and e.g. explain what SCG configuration property you're exposing.

"description": "Id of the route",
"type": "string"
},
"uri": {
"description": "Uri of the route",
Copy link
Member

@TimLovellSmith TimLovellSmith Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declare as "format": "uri" if its an uri, right

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be some non url values like "lb:customer-service", which means the gateway will ask the real ip/uri from a service discovery service. So I think string can better surve the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it maybe consist of other formated "uri"s that I'm not aware of, if the customer is using some other service discovery component to work with the gateway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Is "lb:customer-service" an URI? I guess the answer is maybe, 'lb' is not a well-known scheme. But... maybe its well known in SCG context? I have no idea! :-) (yet)

But more to the point, you now appear to be claiming that it is an URI (in the description) and yet also that its not an URI. Surely only one of these can be the truth?

"type": "string"
},
"predicates": {
"description": "Predicates of the route",
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"description": "Filters of the route",
"type": "array",
"items": {
"type": "string"
}
},
"order": {
"description": "Order of the route",
"type": "integer",
"format": "int64"
}
}
},
"JavaComponentConfigurationProperty": {
"description": "Configuration properties for a Java Component",
"type": "object",
Expand Down Expand Up @@ -418,6 +455,7 @@
"SpringBootAdmin",
"SpringCloudEureka",
"SpringCloudConfig",
"SpringCloudGateway",
"Nacos"
],
"type": "string",
Expand Down Expand Up @@ -477,6 +515,32 @@
}
}
},
"SpringCloudGatewayComponent": {
"description": "Spring Cloud Gateway properties.",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/JavaComponentProperties"
}
],
"properties": {
"ingress": {
"$ref": "#/definitions/JavaComponentIngress",
"description": "Java Component Ingress configurations."
},
"springCloudGatewayRoutes": {
"description": "Gateway route definition",
"type": "array",
"items": {
"$ref": "#/definitions/ScgRoute"
},
"x-ms-identifiers": [
"id"
]
}
},
"x-ms-discriminator-value": "SpringCloudGateway"
},
"SpringBootAdminComponent": {
"description": "Spring Boot Admin properties.",
"type": "object",
Expand Down Expand Up @@ -559,4 +623,3 @@
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,40 @@
"fqdn": "myjavacomponent.myenvironment.test.net"
}
}
},
{
"id": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/reddog",
"name": "reddog",
"type": "Microsoft.App/managedEnvironments/javaComponents",
"properties": {
"componentType": "SpringCloudGateway",
"provisioningState": "Succeeded",
"configurations": [
{
"propertyName": "spring.cloud.gateway.enabled",
"value": "true"
}
],
"springCloudGatewayRoutes": [
{
"id": "route1",
"uri": "https://otherjavacomponent.myenvironment.test.net",
"predicates": [
"Path=/v1/{path}",
"After=2024-01-20T17:42:47.789-07:00[America/Denver]"
],
"filters": [
"SetPath=/{path}"
]
}
],
"ingress": {
"fqdn": "myjavacomponent.myenvironment.test.net"
}
}
}
]
}
}
}
}