Skip to content
Merged
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
12 changes: 8 additions & 4 deletions libs/backend-apisix-standalone/src/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ export const toADC = (input: typing.APISIXStandalone) => {
pass_host: upstream.pass_host,
upstream_host: upstream.upstream_host,

// Empty Lua tables will be encoded as "{}" rather than "[]" by cjson,
// so this must be handled separately to prevent unexpected diff results.
nodes: !isEmpty(upstream.nodes) ? upstream.nodes : [],

checks: upstream.checks,
discovery_type: upstream.discovery_type,
service_name: upstream.service_name,
discovery_args: upstream.discovery_args,

...(upstream.nodes
? {
// Empty Lua tables will be encoded as "{}" rather than "[]" by cjson,
// so this must be handled separately to prevent unexpected diff results.
nodes: !isEmpty(upstream.nodes) ? upstream.nodes : [],
}
: {}),
});
return {
services:
Expand Down
Loading