@@ -20,7 +20,7 @@ type RoutesV2 struct {
2020type RouteV2 struct {
2121 Domain string `json:"domain"`
2222 LagoonService string `json:"service"`
23- ComposeService string `json:"composeService"` // the
23+ ComposeService string `json:"composeService"`
2424 TLSAcme * bool `json:"tls-acme"`
2525 Migrate * bool `json:"migrate,omitempty"`
2626 Insecure * string `json:"insecure,omitempty"`
@@ -40,6 +40,31 @@ type RouteV2 struct {
4040 WildcardApex * bool `json:"wildcardApex,omitempty"`
4141 RequestVerification * bool `json:"disableRequestVerification,omitempty"`
4242 PathRoutes []PathRoute `json:"pathRoutes,omitempty"`
43+ Source string `json:"source,omitempty"`
44+ }
45+
46+ // handle `tlsAcme`/`monitoringPath` from the API and `tls-acme`/`monitoring-path` from .lagoon.yml
47+ // :ugh: legacy stuff
48+ // maybe one day we can produce warnings/deprecation of certain fields but today is not that day
49+ func (r * RouteV2 ) UnmarshalJSON (data []byte ) error {
50+ type TempRouteV2 RouteV2
51+ tr := & struct {
52+ TLSAcme_ * bool `json:"tlsAcme,omitempty"`
53+ MonitoringPath_ * string `json:"monitoringPath,omitempty"`
54+ * TempRouteV2
55+ }{
56+ TempRouteV2 : (* TempRouteV2 )(r ),
57+ }
58+ if err := json .Unmarshal (data , tr ); err != nil {
59+ return err
60+ }
61+ if tr .TLSAcme_ != nil {
62+ r .TLSAcme = tr .TLSAcme_
63+ }
64+ if tr .MonitoringPath_ != nil {
65+ r .MonitoringPath = * tr .MonitoringPath_
66+ }
67+ return nil
4368}
4469
4570// Ingress represents a Lagoon route.
0 commit comments