Bound concurrent image processing and upstream fetches (closes #64) #148
@@ -236,14 +236,12 @@ func New(_ fx.Lifecycle, params Params) (*Config, error) {
|
|||||||
// unparseable or invalid is an error: defaults apply only to omitted
|
// unparseable or invalid is an error: defaults apply only to omitted
|
||||||
// keys, never to invalid explicit values.
|
// keys, never to invalid explicit values.
|
||||||
func newFromSmartConfig(sc *smartconfig.Config) (*Config, error) {
|
func newFromSmartConfig(sc *smartconfig.Config) (*Config, error) {
|
||||||
if sc != nil {
|
err := validateKnownKeys(sc)
|
||||||
err := validateKnownKeys(sc)
|
if err != nil {
|
||||||
if err != nil {
|
return nil, err
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err := validateAllowlistHostsValue(sc)
|
err = validateAllowlistHostsValue(sc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -337,8 +335,13 @@ func newFromSmartConfig(sc *smartconfig.Config) (*Config, error) {
|
|||||||
// being silently ignored, and rejects keys that are explicitly set to
|
// being silently ignored, and rejects keys that are explicitly set to
|
||||||
// null: a null is a SET value, never an omission, so it must not
|
// null: a null is a SET value, never an omission, so it must not
|
||||||
// silently take the default. The env section is permitted because
|
// silently take the default. The env section is permitted because
|
||||||
// smartconfig consumes it for environment variable injection.
|
// smartconfig consumes it for environment variable injection. A nil sc
|
||||||
|
// means no config file, which has no keys to check.
|
||||||
func validateKnownKeys(sc *smartconfig.Config) error {
|
func validateKnownKeys(sc *smartconfig.Config) error {
|
||||||
|
if sc == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var unknown, nullKeys []string
|
var unknown, nullKeys []string
|
||||||
|
|
||||||
for key, value := range sc.Data() {
|
for key, value := range sc.Data() {
|
||||||
|
|||||||
Reference in New Issue
Block a user