fix: keep Node SSR config optional during rollout
This commit is contained in:
@@ -245,6 +245,13 @@ func validateExactDocumentKeys(document []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
nodeSsrValue, found := root["nodeSsr"]
|
||||||
|
if !found {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if _, ok := nodeSsrValue.(map[string]any); !ok {
|
||||||
|
return errors.New("nodeSsr must be a table")
|
||||||
|
}
|
||||||
nodeSsr, err := exactTable(root, "", "nodeSsr")
|
nodeSsr, err := exactTable(root, "", "nodeSsr")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -362,6 +369,9 @@ func (c Config) Validate() error {
|
|||||||
default:
|
default:
|
||||||
return fmt.Errorf("backend.type must be %q or %q", BackendTypeNative, BackendTypeContainer)
|
return fmt.Errorf("backend.type must be %q or %q", BackendTypeNative, BackendTypeContainer)
|
||||||
}
|
}
|
||||||
|
if c.NodeSsr.Type == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if c.NodeSsr.Type != BackendTypeContainer {
|
if c.NodeSsr.Type != BackendTypeContainer {
|
||||||
return fmt.Errorf("nodeSsr.type must be %q", BackendTypeContainer)
|
return fmt.Errorf("nodeSsr.type must be %q", BackendTypeContainer)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user