diff --git a/make/kubernetes/adminserver/adminserver.deploy.yaml b/make/kubernetes/adminserver/adminserver.deploy.yaml index ccc0e6187..66a92076f 100644 --- a/make/kubernetes/adminserver/adminserver.deploy.yaml +++ b/make/kubernetes/adminserver/adminserver.deploy.yaml @@ -191,11 +191,6 @@ spec: configMapKeyRef: name: harbor-adminserver-config key: TOKEN_EXPIRATION - - name: CFG_EXPIRATION - valueFrom: - configMapKeyRef: - name: harbor-adminserver-config - key: CFG_EXPIRATION - name: GODEBUG valueFrom: configMapKeyRef: diff --git a/make/kubernetes/templates/adminserver.cm.yaml b/make/kubernetes/templates/adminserver.cm.yaml index e1d2b75d5..cd5b5f1f4 100644 --- a/make/kubernetes/templates/adminserver.cm.yaml +++ b/make/kubernetes/templates/adminserver.cm.yaml @@ -36,7 +36,6 @@ data: CORE_SECRET: "{{core_secret}}" JOBSERVICE_SECRET: "{{jobservice_secret}}" TOKEN_EXPIRATION: "30" - CFG_EXPIRATION: "5" GODEBUG: "netdns=cgo" ADMIRAL_URL: NA WITH_NOTARY: "False" diff --git a/make/photon/prepare/templates/core/env.jinja b/make/photon/prepare/templates/core/env.jinja index 63523b1b5..44470dbdb 100644 --- a/make/photon/prepare/templates/core/env.jinja +++ b/make/photon/prepare/templates/core/env.jinja @@ -21,7 +21,6 @@ HARBOR_ADMIN_PASSWORD={{harbor_admin_password}} MAX_JOB_WORKERS={{max_job_workers}} CORE_SECRET={{core_secret}} JOBSERVICE_SECRET={{jobservice_secret}} -CFG_EXPIRATION=5 ADMIRAL_URL={{admiral_url}} WITH_NOTARY={{with_notary}} WITH_CLAIR={{with_clair}} diff --git a/src/common/config/metadata/metadata_test.go b/src/common/config/metadata/metadata_test.go index 006ec4ec8..a21660656 100644 --- a/src/common/config/metadata/metadata_test.go +++ b/src/common/config/metadata/metadata_test.go @@ -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: "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: 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}, } curInst := Instance() curInst.initFromArray(testArray) - if len(metaDataInstance.metaMap) != 5 { + if len(metaDataInstance.metaMap) != 4 { t.Errorf("Can not initial metadata, size %v", len(metaDataInstance.metaMap)) } item, ok := curInst.GetByName(common.AdminInitialPassword) diff --git a/src/common/config/metadata/metadatalist.go b/src/common/config/metadata/metadatalist.go index 4f17533e3..202f426b7 100644 --- a/src/common/config/metadata/metadatalist.go +++ b/src/common/config/metadata/metadatalist.go @@ -63,7 +63,6 @@ var ( {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.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.ClairDB, Scope: SystemScope, Group: ClairGroup, EnvKey: "CLAIR_DB", DefaultValue: "postgres", ItemType: &StringType{}, Editable: false}, diff --git a/src/common/const.go b/src/common/const.go index c77d75469..532e7960f 100644 --- a/src/common/const.go +++ b/src/common/const.go @@ -82,7 +82,6 @@ const ( ProjectCreationRestriction = "project_creation_restriction" MaxJobWorkers = "max_job_workers" TokenExpiration = "token_expiration" - CfgExpiration = "cfg_expiration" AdminInitialPassword = "admin_initial_password" AdmiralEndpoint = "admiral_url" WithNotary = "with_notary" diff --git a/src/common/utils/ldap/ldap_test.go b/src/common/utils/ldap/ldap_test.go index 3d9a73328..ed80fd17a 100644 --- a/src/common/utils/ldap/ldap_test.go +++ b/src/common/utils/ldap/ldap_test.go @@ -31,7 +31,6 @@ var ldapTestConfig = map[string]interface{}{ common.LDAPFilter: "", common.LDAPScope: 3, common.LDAPTimeout: 30, - common.CfgExpiration: 5, common.AdminInitialPassword: "password", } @@ -66,7 +65,6 @@ var defaultConfigWithVerifyCert = map[string]interface{}{ common.ProjectCreationRestriction: common.ProCrtRestrAdmOnly, common.MaxJobWorkers: 3, common.TokenExpiration: 30, - common.CfgExpiration: 5, common.AdminInitialPassword: "password", common.AdmiralEndpoint: "http://www.vmware.com", common.WithNotary: false, diff --git a/src/common/utils/notary/helper_test.go b/src/common/utils/notary/helper_test.go index ce92272fa..d3c11e63b 100644 --- a/src/common/utils/notary/helper_test.go +++ b/src/common/utils/notary/helper_test.go @@ -40,7 +40,6 @@ func TestMain(m *testing.M) { var defaultConfig = map[string]interface{}{ common.ExtEndpoint: "https://" + endpoint, common.WithNotary: true, - common.CfgExpiration: 5, common.TokenExpiration: 30, } diff --git a/src/common/utils/test/config.go b/src/common/utils/test/config.go index b57111e4a..2ea050d07 100644 --- a/src/common/utils/test/config.go +++ b/src/common/utils/test/config.go @@ -53,7 +53,6 @@ var defaultConfig = map[string]interface{}{ common.ProjectCreationRestriction: common.ProCrtRestrAdmOnly, common.MaxJobWorkers: 3, common.TokenExpiration: 30, - common.CfgExpiration: 5, common.AdminInitialPassword: "password", common.AdmiralEndpoint: "", common.WithNotary: false, diff --git a/src/common/utils/test/test.go b/src/common/utils/test/test.go index 71350d320..28046e5db 100644 --- a/src/common/utils/test/test.go +++ b/src/common/utils/test/test.go @@ -115,7 +115,6 @@ func GetUnitTestConfig() map[string]interface{} { common.LDAPVerifyCert: true, common.UAAVerifyCert: true, common.ClairDBHost: "postgresql", - common.CfgExpiration: 5, common.AdminInitialPassword: "Harbor12345", common.LDAPGroupSearchFilter: "objectclass=groupOfNames", common.LDAPGroupBaseDN: "dc=example,dc=com", diff --git a/src/core/auth/db/db_test.go b/src/core/auth/db/db_test.go index 776362ca6..ec3ffd2b4 100644 --- a/src/core/auth/db/db_test.go +++ b/src/core/auth/db/db_test.go @@ -46,7 +46,6 @@ var testConfig = map[string]interface{}{ common.LDAPFilter: "", common.LDAPScope: 3, common.LDAPTimeout: 30, - common.CfgExpiration: 5, common.AdminInitialPassword: "password", } diff --git a/src/core/auth/ldap/ldap_test.go b/src/core/auth/ldap/ldap_test.go index 566fd93f9..5eb852fbe 100644 --- a/src/core/auth/ldap/ldap_test.go +++ b/src/core/auth/ldap/ldap_test.go @@ -50,7 +50,6 @@ var ldapTestConfig = map[string]interface{}{ common.LDAPFilter: "", common.LDAPScope: 2, common.LDAPTimeout: 30, - common.CfgExpiration: 5, common.AdminInitialPassword: "password", common.LDAPGroupSearchFilter: "objectclass=groupOfNames", common.LDAPGroupBaseDN: "dc=example,dc=com", diff --git a/src/core/controllers/controllers_test.go b/src/core/controllers/controllers_test.go index 34358e6a5..1381a26d3 100644 --- a/src/core/controllers/controllers_test.go +++ b/src/core/controllers/controllers_test.go @@ -66,13 +66,11 @@ func TestUserResettable(t *testing.T) { assert := assert.New(t) DBAuthConfig := map[string]interface{}{ common.AUTHMode: common.DBAuth, - common.CfgExpiration: 5, common.TokenExpiration: 30, } LDAPAuthConfig := map[string]interface{}{ common.AUTHMode: common.LDAPAuth, - common.CfgExpiration: 5, common.TokenExpiration: 30, } config.InitWithSettings(LDAPAuthConfig) diff --git a/src/core/proxy/interceptor_test.go b/src/core/proxy/interceptor_test.go index be445316d..ab73f27bf 100644 --- a/src/core/proxy/interceptor_test.go +++ b/src/core/proxy/interceptor_test.go @@ -28,7 +28,6 @@ func TestMain(m *testing.M) { var defaultConfig = map[string]interface{}{ common.ExtEndpoint: "https://" + endpoint, common.WithNotary: true, - common.CfgExpiration: 5, common.TokenExpiration: 30, } config.InitWithSettings(defaultConfig) @@ -146,7 +145,6 @@ func TestPMSPolicyChecker(t *testing.T) { var defaultConfigAdmiral = map[string]interface{}{ common.ExtEndpoint: "https://" + endpoint, common.WithNotary: true, - common.CfgExpiration: 5, common.TokenExpiration: 30, common.DatabaseType: "postgresql", common.PostGreSQLHOST: "127.0.0.1", diff --git a/src/portal/lib/src/config/config.ts b/src/portal/lib/src/config/config.ts index 75f36669d..2a376d71c 100644 --- a/src/portal/lib/src/config/config.ts +++ b/src/portal/lib/src/config/config.ts @@ -85,7 +85,6 @@ export class Configuration { verify_remote_cert: BoolValueItem; robot_token_duration: NumberValueItem; token_expiration: NumberValueItem; - cfg_expiration: NumberValueItem; scan_all_policy: ComplexValueItem; read_only: BoolValueItem; http_authproxy_endpoint?: StringValueItem;