mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-28 21:37:31 +02:00
remove file exist.
This commit is contained in:
parent
8268cf66bd
commit
5a764d30ea
@ -21,7 +21,7 @@ type SystemInfoAPI struct {
|
||||
}
|
||||
|
||||
const defaultRootCert = "/harbor_storage/ca_download/ca.crt"
|
||||
const harborVersionFile = "/harbor/VERSION"
|
||||
const harborVersionFile = "/harbor/VERSION1"
|
||||
|
||||
//SystemInfo models for system info.
|
||||
type SystemInfo struct {
|
||||
@ -134,18 +134,10 @@ func (sia *SystemInfoAPI) GetGeneralInfo() {
|
||||
|
||||
// GetVersion gets harbor version.
|
||||
func (sia *SystemInfoAPI) getVersion() string {
|
||||
if _, err := os.Stat(harborVersionFile); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
log.Errorf("Version File doesn't exist.")
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
version, err := ioutil.ReadFile(harborVersionFile)
|
||||
if err != nil {
|
||||
log.Errorf("Error occured getting harbor version: %v", err)
|
||||
return ""
|
||||
}
|
||||
|
||||
return string(version[:])
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user