mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-18 14:47:38 +01:00
Add readonly into systeminfo
This commit is contained in:
parent
14e24267c0
commit
01487b8221
@ -99,6 +99,7 @@ type GeneralInfo struct {
|
|||||||
NextScanAll int64 `json:"next_scan_all"`
|
NextScanAll int64 `json:"next_scan_all"`
|
||||||
ClairVulnStatus *models.ClairVulnerabilityStatus `json:"clair_vulnerability_status,omitempty"`
|
ClairVulnStatus *models.ClairVulnerabilityStatus `json:"clair_vulnerability_status,omitempty"`
|
||||||
RegistryStorageProviderName string `json:"registry_storage_provider_name"`
|
RegistryStorageProviderName string `json:"registry_storage_provider_name"`
|
||||||
|
ReadOnly bool `json:"read_only"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate for validating user if an admin.
|
// validate for validating user if an admin.
|
||||||
@ -177,6 +178,7 @@ func (sia *SystemInfoAPI) GetGeneralInfo() {
|
|||||||
HasCARoot: caStatErr == nil,
|
HasCARoot: caStatErr == nil,
|
||||||
HarborVersion: harborVersion,
|
HarborVersion: harborVersion,
|
||||||
RegistryStorageProviderName: cfg[common.RegistryStorageProviderName].(string),
|
RegistryStorageProviderName: cfg[common.RegistryStorageProviderName].(string),
|
||||||
|
ReadOnly: config.ReadOnly(),
|
||||||
}
|
}
|
||||||
if info.WithClair {
|
if info.WithClair {
|
||||||
info.ClairVulnStatus = getClairVulnStatus()
|
info.ClairVulnStatus = getClairVulnStatus()
|
||||||
|
@ -64,6 +64,7 @@ func TestGetGeneralInfo(t *testing.T) {
|
|||||||
assert.Equal(false, g.WithNotary, "with notary should be false")
|
assert.Equal(false, g.WithNotary, "with notary should be false")
|
||||||
assert.Equal(true, g.HasCARoot, "has ca root should be true")
|
assert.Equal(true, g.HasCARoot, "has ca root should be true")
|
||||||
assert.NotEmpty(g.HarborVersion, "harbor version should not be empty")
|
assert.NotEmpty(g.HarborVersion, "harbor version should not be empty")
|
||||||
|
assert.Equal(false, g.ReadOnly, "readonly should be false")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetCert(t *testing.T) {
|
func TestGetCert(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user