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
@@ -1,8 +1,21 @@
|
||||
package api
|
||||
|
||||
import "strings"
|
||||
|
||||
// CaddySpec is the Caddy reverse proxy configuration for a service.
|
||||
type CaddySpec struct {
|
||||
// Config contains the Caddy config (Caddyfile) content. It must not conflict with the Caddy configs
|
||||
// of other services.
|
||||
Config string
|
||||
}
|
||||
|
||||
func (c *CaddySpec) Equals(other *CaddySpec) bool {
|
||||
if c == nil {
|
||||
return other == nil || strings.TrimSpace(other.Config) == ""
|
||||
}
|
||||
if other == nil {
|
||||
return strings.TrimSpace(c.Config) == ""
|
||||
}
|
||||
|
||||
return strings.TrimSpace(c.Config) == strings.TrimSpace(other.Config)
|
||||
}
|
||||
Reference in new issue
Block a user