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