Remove error message of saving system setting to db

Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
stonezdj 2019-03-21 15:45:42 +08:00
parent 204c139dbd
commit e8ab7156bc

View File

@ -15,13 +15,14 @@
package driver package driver
import ( import (
"os"
"github.com/goharbor/harbor/src/common/config/encrypt" "github.com/goharbor/harbor/src/common/config/encrypt"
"github.com/goharbor/harbor/src/common/config/metadata" "github.com/goharbor/harbor/src/common/config/metadata"
"github.com/goharbor/harbor/src/common/dao" "github.com/goharbor/harbor/src/common/dao"
"github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/common/models"
"github.com/goharbor/harbor/src/common/utils" "github.com/goharbor/harbor/src/common/utils"
"github.com/goharbor/harbor/src/common/utils/log" "github.com/goharbor/harbor/src/common/utils/log"
"os"
) )
// Database - Used to load/save configuration in database // Database - Used to load/save configuration in database
@ -63,7 +64,7 @@ func (d *Database) Save(cfgs map[string]interface{}) error {
for key, value := range cfgs { for key, value := range cfgs {
if item, ok := metadata.Instance().GetByName(key); ok { if item, ok := metadata.Instance().GetByName(key); ok {
if os.Getenv("UTTEST") != "true" && item.Scope == metadata.SystemScope { if os.Getenv("UTTEST") != "true" && item.Scope == metadata.SystemScope {
log.Errorf("system setting can not updated, key %v", key) // skip to save system setting to db
continue continue
} }
strValue := utils.GetStrValueOfAnyType(value) strValue := utils.GetStrValueOfAnyType(value)