Skip to content

Commit

Permalink
Merge pull request #1522 from mrpalide/fix/hot-fix-on-arm-log-store-p…
Browse files Browse the repository at this point in the history
…anic

Fix/hot fix on arm log store panic
  • Loading branch information
mrpalide authored Mar 30, 2023
2 parents 465d4e9 + ab63895 commit 890dc88
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/app/appcommon/log_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewProcLogger(conf ProcConfig, mLog *logging.MasterLogger) (log *logging.Ma
// TimestampFromLog is an utility function for retrieving the timestamp from a log. This function should be modified
// if the time layout is changed
func TimestampFromLog(log string) string {
return log[1 : 1+len(timeLayout)]
return strings.Split(log[1:1+len(timeLayout)], "]")[0]
}

// LogStore stores logs from apps, for later consumption from the hypervisor
Expand Down Expand Up @@ -215,7 +215,7 @@ func (l *bBoltLogStore) Fire(entry *log.Entry) error {
}()

// time in RFC3339Nano is between the bytes 1 and 36. This will change if other time layout is in use
t := strings.Split(strings.Split(strings.Split(p, " ")[0], "]")[0], "[")[2]
t := strings.Split(str[1:1+len(timeLayout)], "]")[0]
err = db.Update(func(tx *bbolt.Tx) error {
b := tx.Bucket(l.bucket)
return b.Put([]byte(t), []byte(str))
Expand Down
2 changes: 1 addition & 1 deletion pkg/visor/visorconfig/values_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type Survey struct {

// SystemSurvey returns system survey
func SystemSurvey() (Survey, error) {
disks, err := ghw.Block()
disks, err := ghw.Block(ghw.WithDisableWarnings())
if err != nil {
return Survey{}, err
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/visor/visorconfig/values_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ type Survey struct {
func SystemSurvey() (Survey, error) {
var si sysinfo.SysInfo
si.GetSysInfo()
disks, err := ghw.Block()
disks, err := ghw.Block(ghw.WithDisableWarnings())
if err != nil {
return Survey{}, err
}
product, err := ghw.Product()
product, err := ghw.Product(ghw.WithDisableWarnings())
if err != nil {
return Survey{}, err
}
memory, err := ghw.Memory()
memory, err := ghw.Memory(ghw.WithDisableWarnings())
if err != nil {
return Survey{}, err
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/visor/visorconfig/values_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ type Survey struct {

// SystemSurvey returns system survey
func SystemSurvey() (Survey, error) {
disks, err := ghw.Block()
disks, err := ghw.Block(ghw.WithDisableWarnings())
if err != nil {
return Survey{}, err
}
product, err := ghw.Product()
product, err := ghw.Product(ghw.WithDisableWarnings())
if err != nil {
return Survey{}, err
}
memory, err := ghw.Memory()
memory, err := ghw.Memory(ghw.WithDisableWarnings())
if err != nil {
return Survey{}, err
}
Expand Down

0 comments on commit 890dc88

Please sign in to comment.