mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
chore: trim spaces for x-caddy, diff Caddy configs when comparing service specs
This commit is contained in:
1 parent
12c07812a2
commit
dd7bc6c982
5 files changed
+101
-11
No files matched your search
@@ -27,8 +27,25 @@ services:
|
||||
`,
|
||||
wantConfig: `example.com {
|
||||
reverse_proxy web:80
|
||||
}
|
||||
}`,
|
||||
},
|
||||
{
|
||||
name: "x-caddy as string with extra spaces",
|
||||
composeYAML: `
|
||||
services:
|
||||
web:
|
||||
image: nginx
|
||||
x-caddy: |+
|
||||
|
||||
example.com {
|
||||
reverse_proxy web:80
|
||||
}
|
||||
|
||||
|
||||
`,
|
||||
wantConfig: `example.com {
|
||||
reverse_proxy web:80
|
||||
}`,
|
||||
},
|
||||
{
|
||||
name: "x-caddy as object with config field",
|
||||
@@ -44,8 +61,26 @@ services:
|
||||
`,
|
||||
wantConfig: `example.com {
|
||||
reverse_proxy web:80
|
||||
}
|
||||
}`,
|
||||
},
|
||||
{
|
||||
name: "x-caddy as object with config field and extra spaces",
|
||||
composeYAML: `
|
||||
services:
|
||||
web:
|
||||
image: nginx
|
||||
x-caddy:
|
||||
config: |+
|
||||
|
||||
example.com {
|
||||
reverse_proxy web:80
|
||||
}
|
||||
|
||||
|
||||
`,
|
||||
wantConfig: `example.com {
|
||||
reverse_proxy web:80
|
||||
}`,
|
||||
},
|
||||
{
|
||||
name: "x-caddy with path to Caddyfile",
|
||||
@@ -57,8 +92,7 @@ services:
|
||||
`,
|
||||
wantConfig: `test.example.com {
|
||||
reverse_proxy test:8000
|
||||
}
|
||||
`,
|
||||
}`,
|
||||
},
|
||||
{
|
||||
name: "x-caddy with empty object",
|
||||
|
||||
Reference in new issue
Block a user