Skip to content

Commit

Permalink
ppc64le: kata-env fails due to missing vendor field
Browse files Browse the repository at this point in the history
There is no vendor field in /proc/cpuinfo contents
on ppc64le. Make sure the check is only for
arm and amd64.

Fixes: kata-containers#864

Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
  • Loading branch information
nitkon committed Oct 29, 2018
1 parent 6d17e27 commit 51d4f40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
9 changes: 1 addition & 8 deletions cli/kata-check.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,7 @@ func getCPUInfo(cpuInfoFile string) (string, error) {
return "", err
}

cpus := strings.SplitAfter(text, "\n\n")

trimmed := strings.TrimSpace(cpus[0])
if trimmed == "" {
return "", fmt.Errorf("Cannot determine CPU details")
}

return trimmed, nil
return text, nil
}

// findAnchoredString searches haystack for needle and returns true if found
Expand Down
4 changes: 2 additions & 2 deletions cli/kata-check_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (

const (
cpuFlagsTag = genericCPUFlagsTag
archCPUVendorField = genericCPUVendorField
archCPUModelField = genericCPUModelField
archCPUVendorField = ""
archCPUModelField = "model"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func genericGetCPUDetails() (vendor, model string, err error) {
}
}

if vendor == "" {
if archCPUVendorField != "" && vendor == "" {
return "", "", fmt.Errorf("cannot find vendor field in file %v", procCPUInfo)
}

Expand Down

0 comments on commit 51d4f40

Please sign in to comment.