mirror of
https://github.com/goharbor/harbor.git
synced 2025-03-11 22:20:00 +01:00
Remove unused configure item cfg_expiration (#7744)
Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
parent
9cc203d15b
commit
774a9f8d75
@ -191,11 +191,6 @@ spec:
|
|||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: harbor-adminserver-config
|
name: harbor-adminserver-config
|
||||||
key: TOKEN_EXPIRATION
|
key: TOKEN_EXPIRATION
|
||||||
- name: CFG_EXPIRATION
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: harbor-adminserver-config
|
|
||||||
key: CFG_EXPIRATION
|
|
||||||
- name: GODEBUG
|
- name: GODEBUG
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
|
@ -36,7 +36,6 @@ data:
|
|||||||
CORE_SECRET: "{{core_secret}}"
|
CORE_SECRET: "{{core_secret}}"
|
||||||
JOBSERVICE_SECRET: "{{jobservice_secret}}"
|
JOBSERVICE_SECRET: "{{jobservice_secret}}"
|
||||||
TOKEN_EXPIRATION: "30"
|
TOKEN_EXPIRATION: "30"
|
||||||
CFG_EXPIRATION: "5"
|
|
||||||
GODEBUG: "netdns=cgo"
|
GODEBUG: "netdns=cgo"
|
||||||
ADMIRAL_URL: NA
|
ADMIRAL_URL: NA
|
||||||
WITH_NOTARY: "False"
|
WITH_NOTARY: "False"
|
||||||
|
@ -21,7 +21,6 @@ HARBOR_ADMIN_PASSWORD={{harbor_admin_password}}
|
|||||||
MAX_JOB_WORKERS={{max_job_workers}}
|
MAX_JOB_WORKERS={{max_job_workers}}
|
||||||
CORE_SECRET={{core_secret}}
|
CORE_SECRET={{core_secret}}
|
||||||
JOBSERVICE_SECRET={{jobservice_secret}}
|
JOBSERVICE_SECRET={{jobservice_secret}}
|
||||||
CFG_EXPIRATION=5
|
|
||||||
ADMIRAL_URL={{admiral_url}}
|
ADMIRAL_URL={{admiral_url}}
|
||||||
WITH_NOTARY={{with_notary}}
|
WITH_NOTARY={{with_notary}}
|
||||||
WITH_CLAIR={{with_clair}}
|
WITH_CLAIR={{with_clair}}
|
||||||
|
@ -24,13 +24,12 @@ func TestCfgMetaData_InitFromArray(t *testing.T) {
|
|||||||
{Scope: SystemScope, Group: BasicGroup, EnvKey: "HARBOR_ADMIN_PASSWORD", DefaultValue: "", Name: common.AdminInitialPassword, ItemType: &PasswordType{}, Editable: true},
|
{Scope: SystemScope, Group: BasicGroup, EnvKey: "HARBOR_ADMIN_PASSWORD", DefaultValue: "", Name: common.AdminInitialPassword, ItemType: &PasswordType{}, Editable: true},
|
||||||
{Scope: SystemScope, Group: BasicGroup, EnvKey: "ADMIRAL_URL", DefaultValue: "NA", Name: common.AdmiralEndpoint, ItemType: &StringType{}, Editable: false},
|
{Scope: SystemScope, Group: BasicGroup, EnvKey: "ADMIRAL_URL", DefaultValue: "NA", Name: common.AdmiralEndpoint, ItemType: &StringType{}, Editable: false},
|
||||||
{Scope: UserScope, Group: BasicGroup, EnvKey: "AUTH_MODE", DefaultValue: "db_auth", Name: common.AUTHMode, ItemType: &StringType{}, Editable: false},
|
{Scope: UserScope, Group: BasicGroup, EnvKey: "AUTH_MODE", DefaultValue: "db_auth", Name: common.AUTHMode, ItemType: &StringType{}, Editable: false},
|
||||||
{Scope: SystemScope, Group: BasicGroup, EnvKey: "CFG_EXPIRATION", DefaultValue: "5", Name: common.CfgExpiration, ItemType: &StringType{}, Editable: false},
|
|
||||||
{Scope: SystemScope, Group: BasicGroup, EnvKey: "CHART_REPOSITORY_URL", DefaultValue: "http://chartmuseum:9999", Name: common.ChartRepoURL, ItemType: &StringType{}, Editable: false},
|
{Scope: SystemScope, Group: BasicGroup, EnvKey: "CHART_REPOSITORY_URL", DefaultValue: "http://chartmuseum:9999", Name: common.ChartRepoURL, ItemType: &StringType{}, Editable: false},
|
||||||
}
|
}
|
||||||
curInst := Instance()
|
curInst := Instance()
|
||||||
curInst.initFromArray(testArray)
|
curInst.initFromArray(testArray)
|
||||||
|
|
||||||
if len(metaDataInstance.metaMap) != 5 {
|
if len(metaDataInstance.metaMap) != 4 {
|
||||||
t.Errorf("Can not initial metadata, size %v", len(metaDataInstance.metaMap))
|
t.Errorf("Can not initial metadata, size %v", len(metaDataInstance.metaMap))
|
||||||
}
|
}
|
||||||
item, ok := curInst.GetByName(common.AdminInitialPassword)
|
item, ok := curInst.GetByName(common.AdminInitialPassword)
|
||||||
|
@ -63,7 +63,6 @@ var (
|
|||||||
{Name: common.AdminInitialPassword, Scope: SystemScope, Group: BasicGroup, EnvKey: "HARBOR_ADMIN_PASSWORD", DefaultValue: "", ItemType: &PasswordType{}, Editable: true},
|
{Name: common.AdminInitialPassword, Scope: SystemScope, Group: BasicGroup, EnvKey: "HARBOR_ADMIN_PASSWORD", DefaultValue: "", ItemType: &PasswordType{}, Editable: true},
|
||||||
{Name: common.AdmiralEndpoint, Scope: SystemScope, Group: BasicGroup, EnvKey: "ADMIRAL_URL", DefaultValue: "", ItemType: &StringType{}, Editable: false},
|
{Name: common.AdmiralEndpoint, Scope: SystemScope, Group: BasicGroup, EnvKey: "ADMIRAL_URL", DefaultValue: "", ItemType: &StringType{}, Editable: false},
|
||||||
{Name: common.AUTHMode, Scope: UserScope, Group: BasicGroup, EnvKey: "AUTH_MODE", DefaultValue: "db_auth", ItemType: &AuthModeType{}, Editable: false},
|
{Name: common.AUTHMode, Scope: UserScope, Group: BasicGroup, EnvKey: "AUTH_MODE", DefaultValue: "db_auth", ItemType: &AuthModeType{}, Editable: false},
|
||||||
{Name: common.CfgExpiration, Scope: SystemScope, Group: BasicGroup, EnvKey: "CFG_EXPIRATION", DefaultValue: "5", ItemType: &IntType{}, Editable: false},
|
|
||||||
{Name: common.ChartRepoURL, Scope: SystemScope, Group: BasicGroup, EnvKey: "CHART_REPOSITORY_URL", DefaultValue: "http://chartmuseum:9999", ItemType: &StringType{}, Editable: false},
|
{Name: common.ChartRepoURL, Scope: SystemScope, Group: BasicGroup, EnvKey: "CHART_REPOSITORY_URL", DefaultValue: "http://chartmuseum:9999", ItemType: &StringType{}, Editable: false},
|
||||||
|
|
||||||
{Name: common.ClairDB, Scope: SystemScope, Group: ClairGroup, EnvKey: "CLAIR_DB", DefaultValue: "postgres", ItemType: &StringType{}, Editable: false},
|
{Name: common.ClairDB, Scope: SystemScope, Group: ClairGroup, EnvKey: "CLAIR_DB", DefaultValue: "postgres", ItemType: &StringType{}, Editable: false},
|
||||||
|
@ -82,7 +82,6 @@ const (
|
|||||||
ProjectCreationRestriction = "project_creation_restriction"
|
ProjectCreationRestriction = "project_creation_restriction"
|
||||||
MaxJobWorkers = "max_job_workers"
|
MaxJobWorkers = "max_job_workers"
|
||||||
TokenExpiration = "token_expiration"
|
TokenExpiration = "token_expiration"
|
||||||
CfgExpiration = "cfg_expiration"
|
|
||||||
AdminInitialPassword = "admin_initial_password"
|
AdminInitialPassword = "admin_initial_password"
|
||||||
AdmiralEndpoint = "admiral_url"
|
AdmiralEndpoint = "admiral_url"
|
||||||
WithNotary = "with_notary"
|
WithNotary = "with_notary"
|
||||||
|
@ -31,7 +31,6 @@ var ldapTestConfig = map[string]interface{}{
|
|||||||
common.LDAPFilter: "",
|
common.LDAPFilter: "",
|
||||||
common.LDAPScope: 3,
|
common.LDAPScope: 3,
|
||||||
common.LDAPTimeout: 30,
|
common.LDAPTimeout: 30,
|
||||||
common.CfgExpiration: 5,
|
|
||||||
common.AdminInitialPassword: "password",
|
common.AdminInitialPassword: "password",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +65,6 @@ var defaultConfigWithVerifyCert = map[string]interface{}{
|
|||||||
common.ProjectCreationRestriction: common.ProCrtRestrAdmOnly,
|
common.ProjectCreationRestriction: common.ProCrtRestrAdmOnly,
|
||||||
common.MaxJobWorkers: 3,
|
common.MaxJobWorkers: 3,
|
||||||
common.TokenExpiration: 30,
|
common.TokenExpiration: 30,
|
||||||
common.CfgExpiration: 5,
|
|
||||||
common.AdminInitialPassword: "password",
|
common.AdminInitialPassword: "password",
|
||||||
common.AdmiralEndpoint: "http://www.vmware.com",
|
common.AdmiralEndpoint: "http://www.vmware.com",
|
||||||
common.WithNotary: false,
|
common.WithNotary: false,
|
||||||
|
@ -40,7 +40,6 @@ func TestMain(m *testing.M) {
|
|||||||
var defaultConfig = map[string]interface{}{
|
var defaultConfig = map[string]interface{}{
|
||||||
common.ExtEndpoint: "https://" + endpoint,
|
common.ExtEndpoint: "https://" + endpoint,
|
||||||
common.WithNotary: true,
|
common.WithNotary: true,
|
||||||
common.CfgExpiration: 5,
|
|
||||||
common.TokenExpiration: 30,
|
common.TokenExpiration: 30,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,6 @@ var defaultConfig = map[string]interface{}{
|
|||||||
common.ProjectCreationRestriction: common.ProCrtRestrAdmOnly,
|
common.ProjectCreationRestriction: common.ProCrtRestrAdmOnly,
|
||||||
common.MaxJobWorkers: 3,
|
common.MaxJobWorkers: 3,
|
||||||
common.TokenExpiration: 30,
|
common.TokenExpiration: 30,
|
||||||
common.CfgExpiration: 5,
|
|
||||||
common.AdminInitialPassword: "password",
|
common.AdminInitialPassword: "password",
|
||||||
common.AdmiralEndpoint: "",
|
common.AdmiralEndpoint: "",
|
||||||
common.WithNotary: false,
|
common.WithNotary: false,
|
||||||
|
@ -115,7 +115,6 @@ func GetUnitTestConfig() map[string]interface{} {
|
|||||||
common.LDAPVerifyCert: true,
|
common.LDAPVerifyCert: true,
|
||||||
common.UAAVerifyCert: true,
|
common.UAAVerifyCert: true,
|
||||||
common.ClairDBHost: "postgresql",
|
common.ClairDBHost: "postgresql",
|
||||||
common.CfgExpiration: 5,
|
|
||||||
common.AdminInitialPassword: "Harbor12345",
|
common.AdminInitialPassword: "Harbor12345",
|
||||||
common.LDAPGroupSearchFilter: "objectclass=groupOfNames",
|
common.LDAPGroupSearchFilter: "objectclass=groupOfNames",
|
||||||
common.LDAPGroupBaseDN: "dc=example,dc=com",
|
common.LDAPGroupBaseDN: "dc=example,dc=com",
|
||||||
|
@ -46,7 +46,6 @@ var testConfig = map[string]interface{}{
|
|||||||
common.LDAPFilter: "",
|
common.LDAPFilter: "",
|
||||||
common.LDAPScope: 3,
|
common.LDAPScope: 3,
|
||||||
common.LDAPTimeout: 30,
|
common.LDAPTimeout: 30,
|
||||||
common.CfgExpiration: 5,
|
|
||||||
common.AdminInitialPassword: "password",
|
common.AdminInitialPassword: "password",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,6 @@ var ldapTestConfig = map[string]interface{}{
|
|||||||
common.LDAPFilter: "",
|
common.LDAPFilter: "",
|
||||||
common.LDAPScope: 2,
|
common.LDAPScope: 2,
|
||||||
common.LDAPTimeout: 30,
|
common.LDAPTimeout: 30,
|
||||||
common.CfgExpiration: 5,
|
|
||||||
common.AdminInitialPassword: "password",
|
common.AdminInitialPassword: "password",
|
||||||
common.LDAPGroupSearchFilter: "objectclass=groupOfNames",
|
common.LDAPGroupSearchFilter: "objectclass=groupOfNames",
|
||||||
common.LDAPGroupBaseDN: "dc=example,dc=com",
|
common.LDAPGroupBaseDN: "dc=example,dc=com",
|
||||||
|
@ -66,13 +66,11 @@ func TestUserResettable(t *testing.T) {
|
|||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
DBAuthConfig := map[string]interface{}{
|
DBAuthConfig := map[string]interface{}{
|
||||||
common.AUTHMode: common.DBAuth,
|
common.AUTHMode: common.DBAuth,
|
||||||
common.CfgExpiration: 5,
|
|
||||||
common.TokenExpiration: 30,
|
common.TokenExpiration: 30,
|
||||||
}
|
}
|
||||||
|
|
||||||
LDAPAuthConfig := map[string]interface{}{
|
LDAPAuthConfig := map[string]interface{}{
|
||||||
common.AUTHMode: common.LDAPAuth,
|
common.AUTHMode: common.LDAPAuth,
|
||||||
common.CfgExpiration: 5,
|
|
||||||
common.TokenExpiration: 30,
|
common.TokenExpiration: 30,
|
||||||
}
|
}
|
||||||
config.InitWithSettings(LDAPAuthConfig)
|
config.InitWithSettings(LDAPAuthConfig)
|
||||||
|
@ -28,7 +28,6 @@ func TestMain(m *testing.M) {
|
|||||||
var defaultConfig = map[string]interface{}{
|
var defaultConfig = map[string]interface{}{
|
||||||
common.ExtEndpoint: "https://" + endpoint,
|
common.ExtEndpoint: "https://" + endpoint,
|
||||||
common.WithNotary: true,
|
common.WithNotary: true,
|
||||||
common.CfgExpiration: 5,
|
|
||||||
common.TokenExpiration: 30,
|
common.TokenExpiration: 30,
|
||||||
}
|
}
|
||||||
config.InitWithSettings(defaultConfig)
|
config.InitWithSettings(defaultConfig)
|
||||||
@ -146,7 +145,6 @@ func TestPMSPolicyChecker(t *testing.T) {
|
|||||||
var defaultConfigAdmiral = map[string]interface{}{
|
var defaultConfigAdmiral = map[string]interface{}{
|
||||||
common.ExtEndpoint: "https://" + endpoint,
|
common.ExtEndpoint: "https://" + endpoint,
|
||||||
common.WithNotary: true,
|
common.WithNotary: true,
|
||||||
common.CfgExpiration: 5,
|
|
||||||
common.TokenExpiration: 30,
|
common.TokenExpiration: 30,
|
||||||
common.DatabaseType: "postgresql",
|
common.DatabaseType: "postgresql",
|
||||||
common.PostGreSQLHOST: "127.0.0.1",
|
common.PostGreSQLHOST: "127.0.0.1",
|
||||||
|
@ -85,7 +85,6 @@ export class Configuration {
|
|||||||
verify_remote_cert: BoolValueItem;
|
verify_remote_cert: BoolValueItem;
|
||||||
robot_token_duration: NumberValueItem;
|
robot_token_duration: NumberValueItem;
|
||||||
token_expiration: NumberValueItem;
|
token_expiration: NumberValueItem;
|
||||||
cfg_expiration: NumberValueItem;
|
|
||||||
scan_all_policy: ComplexValueItem;
|
scan_all_policy: ComplexValueItem;
|
||||||
read_only: BoolValueItem;
|
read_only: BoolValueItem;
|
||||||
http_authproxy_endpoint?: StringValueItem;
|
http_authproxy_endpoint?: StringValueItem;
|
||||||
|
Loading…
Reference in New Issue
Block a user