mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Datastore tests (#551)
* common datastore tests * fix Datastore.UpdateApp * remove extra datastore tests * datastore test fixes
This commit is contained in:
committed by
Travis Reeder
parent
56e43ac772
commit
3fd3da87f3
@@ -53,6 +53,22 @@ func (a *App) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// UpdateConfig adds entries from patch to a.Config, and removes entries with empty values.
|
||||
func (a *App) UpdateConfig(patch Config) {
|
||||
if patch != nil {
|
||||
if a.Config == nil {
|
||||
a.Config = make(Config)
|
||||
}
|
||||
for k, v := range patch {
|
||||
if v == "" {
|
||||
delete(a.Config, k)
|
||||
} else {
|
||||
a.Config[k] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type AppFilter struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user