mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-18 12:51:27 +01:00
Remove adminserver in sourcecode
Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
parent
36d13e8243
commit
d7798a12d2
@ -15,8 +15,6 @@
|
|||||||
package secret
|
package secret
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// AdminserverUser is the name of adminserver user
|
|
||||||
AdminserverUser = "harbor-adminserver"
|
|
||||||
// JobserviceUser is the name of jobservice user
|
// JobserviceUser is the name of jobservice user
|
||||||
JobserviceUser = "harbor-jobservice"
|
JobserviceUser = "harbor-jobservice"
|
||||||
// CoreUser is the name of ui user
|
// CoreUser is the name of ui user
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
goldap "gopkg.in/ldap.v2"
|
goldap "gopkg.in/ldap.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var adminServerLdapTestConfig = map[string]interface{}{
|
var ldapTestConfig = map[string]interface{}{
|
||||||
common.ExtEndpoint: "host01.com",
|
common.ExtEndpoint: "host01.com",
|
||||||
common.AUTHMode: "ldap_auth",
|
common.AUTHMode: "ldap_auth",
|
||||||
common.DatabaseType: "postgresql",
|
common.DatabaseType: "postgresql",
|
||||||
@ -35,7 +35,7 @@ var adminServerLdapTestConfig = map[string]interface{}{
|
|||||||
common.AdminInitialPassword: "password",
|
common.AdminInitialPassword: "password",
|
||||||
}
|
}
|
||||||
|
|
||||||
var adminServerDefaultConfigWithVerifyCert = map[string]interface{}{
|
var defaultConfigWithVerifyCert = map[string]interface{}{
|
||||||
common.ExtEndpoint: "https://host01.com",
|
common.ExtEndpoint: "https://host01.com",
|
||||||
common.AUTHMode: common.LDAPAuth,
|
common.AUTHMode: common.LDAPAuth,
|
||||||
common.DatabaseType: "postgresql",
|
common.DatabaseType: "postgresql",
|
||||||
@ -91,7 +91,7 @@ func TestMain(m *testing.M) {
|
|||||||
log.Fatalf("failed to initialize configurations: %v", err)
|
log.Fatalf("failed to initialize configurations: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
uiConfig.Upload(adminServerLdapTestConfig)
|
uiConfig.Upload(ldapTestConfig)
|
||||||
|
|
||||||
os.Exit(m.Run())
|
os.Exit(m.Run())
|
||||||
|
|
||||||
@ -270,11 +270,11 @@ func TestSession_SearchGroup(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ldapConfig := models.LdapConf{
|
ldapConfig := models.LdapConf{
|
||||||
LdapURL: adminServerLdapTestConfig[common.LDAPURL].(string) + ":389",
|
LdapURL: ldapTestConfig[common.LDAPURL].(string) + ":389",
|
||||||
LdapSearchDn: adminServerLdapTestConfig[common.LDAPSearchDN].(string),
|
LdapSearchDn: ldapTestConfig[common.LDAPSearchDN].(string),
|
||||||
LdapScope: 2,
|
LdapScope: 2,
|
||||||
LdapSearchPassword: adminServerLdapTestConfig[common.LDAPSearchPwd].(string),
|
LdapSearchPassword: ldapTestConfig[common.LDAPSearchPwd].(string),
|
||||||
LdapBaseDn: adminServerLdapTestConfig[common.LDAPBaseDN].(string),
|
LdapBaseDn: ldapTestConfig[common.LDAPBaseDN].(string),
|
||||||
}
|
}
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
@ -311,11 +311,11 @@ func TestSession_SearchGroup(t *testing.T) {
|
|||||||
|
|
||||||
func TestSession_SearchGroupByDN(t *testing.T) {
|
func TestSession_SearchGroupByDN(t *testing.T) {
|
||||||
ldapConfig := models.LdapConf{
|
ldapConfig := models.LdapConf{
|
||||||
LdapURL: adminServerLdapTestConfig[common.LDAPURL].(string) + ":389",
|
LdapURL: ldapTestConfig[common.LDAPURL].(string) + ":389",
|
||||||
LdapSearchDn: adminServerLdapTestConfig[common.LDAPSearchDN].(string),
|
LdapSearchDn: ldapTestConfig[common.LDAPSearchDN].(string),
|
||||||
LdapScope: 2,
|
LdapScope: 2,
|
||||||
LdapSearchPassword: adminServerLdapTestConfig[common.LDAPSearchPwd].(string),
|
LdapSearchPassword: ldapTestConfig[common.LDAPSearchPwd].(string),
|
||||||
LdapBaseDn: adminServerLdapTestConfig[common.LDAPBaseDN].(string),
|
LdapBaseDn: ldapTestConfig[common.LDAPBaseDN].(string),
|
||||||
}
|
}
|
||||||
ldapGroupConfig := models.LdapGroupConf{
|
ldapGroupConfig := models.LdapGroupConf{
|
||||||
LdapGroupBaseDN: "ou=group,dc=example,dc=com",
|
LdapGroupBaseDN: "ou=group,dc=example,dc=com",
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var adminServerTestConfig = map[string]interface{}{
|
var testConfig = map[string]interface{}{
|
||||||
common.DefaultCoreEndpoint: "test",
|
common.DefaultCoreEndpoint: "test",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ func TestMain(m *testing.M) {
|
|||||||
|
|
||||||
test.InitDatabaseFromEnv()
|
test.InitDatabaseFromEnv()
|
||||||
config.Init()
|
config.Init()
|
||||||
config.Upload(adminServerTestConfig)
|
config.Upload(testConfig)
|
||||||
os.Exit(m.Run())
|
os.Exit(m.Run())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ import (
|
|||||||
coreConfig "github.com/goharbor/harbor/src/core/config"
|
coreConfig "github.com/goharbor/harbor/src/core/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
var adminServerTestConfig = map[string]interface{}{
|
var testConfig = map[string]interface{}{
|
||||||
common.ExtEndpoint: "host01.com",
|
common.ExtEndpoint: "host01.com",
|
||||||
common.AUTHMode: "db_auth",
|
common.AUTHMode: "db_auth",
|
||||||
common.DatabaseType: "postgresql",
|
common.DatabaseType: "postgresql",
|
||||||
@ -68,7 +68,7 @@ func TestMain(m *testing.M) {
|
|||||||
log.Fatalf("failed to initialize configurations: %v", err)
|
log.Fatalf("failed to initialize configurations: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
config.Upload(adminServerTestConfig)
|
config.Upload(testConfig)
|
||||||
retCode := m.Run()
|
retCode := m.Run()
|
||||||
os.Exit(retCode)
|
os.Exit(retCode)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user