Remove adminserver in sourcecode

Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
stonezdj 2019-04-23 15:05:29 +08:00
parent 36d13e8243
commit d7798a12d2
4 changed files with 15 additions and 17 deletions

View File

@ -15,8 +15,6 @@
package secret
const (
// AdminserverUser is the name of adminserver user
AdminserverUser = "harbor-adminserver"
// JobserviceUser is the name of jobservice user
JobserviceUser = "harbor-jobservice"
// CoreUser is the name of ui user

View File

@ -13,7 +13,7 @@ import (
goldap "gopkg.in/ldap.v2"
)
var adminServerLdapTestConfig = map[string]interface{}{
var ldapTestConfig = map[string]interface{}{
common.ExtEndpoint: "host01.com",
common.AUTHMode: "ldap_auth",
common.DatabaseType: "postgresql",
@ -35,7 +35,7 @@ var adminServerLdapTestConfig = map[string]interface{}{
common.AdminInitialPassword: "password",
}
var adminServerDefaultConfigWithVerifyCert = map[string]interface{}{
var defaultConfigWithVerifyCert = map[string]interface{}{
common.ExtEndpoint: "https://host01.com",
common.AUTHMode: common.LDAPAuth,
common.DatabaseType: "postgresql",
@ -91,7 +91,7 @@ func TestMain(m *testing.M) {
log.Fatalf("failed to initialize configurations: %v", err)
}
uiConfig.Upload(adminServerLdapTestConfig)
uiConfig.Upload(ldapTestConfig)
os.Exit(m.Run())
@ -270,11 +270,11 @@ func TestSession_SearchGroup(t *testing.T) {
}
ldapConfig := models.LdapConf{
LdapURL: adminServerLdapTestConfig[common.LDAPURL].(string) + ":389",
LdapSearchDn: adminServerLdapTestConfig[common.LDAPSearchDN].(string),
LdapURL: ldapTestConfig[common.LDAPURL].(string) + ":389",
LdapSearchDn: ldapTestConfig[common.LDAPSearchDN].(string),
LdapScope: 2,
LdapSearchPassword: adminServerLdapTestConfig[common.LDAPSearchPwd].(string),
LdapBaseDn: adminServerLdapTestConfig[common.LDAPBaseDN].(string),
LdapSearchPassword: ldapTestConfig[common.LDAPSearchPwd].(string),
LdapBaseDn: ldapTestConfig[common.LDAPBaseDN].(string),
}
tests := []struct {
@ -311,11 +311,11 @@ func TestSession_SearchGroup(t *testing.T) {
func TestSession_SearchGroupByDN(t *testing.T) {
ldapConfig := models.LdapConf{
LdapURL: adminServerLdapTestConfig[common.LDAPURL].(string) + ":389",
LdapSearchDn: adminServerLdapTestConfig[common.LDAPSearchDN].(string),
LdapURL: ldapTestConfig[common.LDAPURL].(string) + ":389",
LdapSearchDn: ldapTestConfig[common.LDAPSearchDN].(string),
LdapScope: 2,
LdapSearchPassword: adminServerLdapTestConfig[common.LDAPSearchPwd].(string),
LdapBaseDn: adminServerLdapTestConfig[common.LDAPBaseDN].(string),
LdapSearchPassword: ldapTestConfig[common.LDAPSearchPwd].(string),
LdapBaseDn: ldapTestConfig[common.LDAPBaseDN].(string),
}
ldapGroupConfig := models.LdapGroupConf{
LdapGroupBaseDN: "ou=group,dc=example,dc=com",

View File

@ -26,7 +26,7 @@ import (
"strings"
)
var adminServerTestConfig = map[string]interface{}{
var testConfig = map[string]interface{}{
common.DefaultCoreEndpoint: "test",
}
@ -34,7 +34,7 @@ func TestMain(m *testing.M) {
test.InitDatabaseFromEnv()
config.Init()
config.Upload(adminServerTestConfig)
config.Upload(testConfig)
os.Exit(m.Run())
}

View File

@ -29,7 +29,7 @@ import (
coreConfig "github.com/goharbor/harbor/src/core/config"
)
var adminServerTestConfig = map[string]interface{}{
var testConfig = map[string]interface{}{
common.ExtEndpoint: "host01.com",
common.AUTHMode: "db_auth",
common.DatabaseType: "postgresql",
@ -68,7 +68,7 @@ func TestMain(m *testing.M) {
log.Fatalf("failed to initialize configurations: %v", err)
}
config.Upload(adminServerTestConfig)
config.Upload(testConfig)
retCode := m.Run()
os.Exit(retCode)
}