Bump to Buildah v1.27.0

As the title says.

Vendor Buildah v1.27.0 into Podman in preparation for Buildah v4.2

[No New Tests Needed]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
This commit is contained in:
tomsweeneyredhat
2022-08-08 22:17:35 -04:00
parent 28607a9238
commit 7bd8864800
36 changed files with 753 additions and 244 deletions

View File

@@ -3,16 +3,14 @@ package buildah
import (
"bufio"
"bytes"
"errors"
"fmt"
"io/ioutil"
"os"
"runtime"
"strconv"
"strings"
"time"
"github.com/containerd/containerd/platforms"
putil "github.com/containers/buildah/pkg/util"
"github.com/containers/buildah/util"
"github.com/containers/storage"
"github.com/containers/storage/pkg/system"
@@ -83,22 +81,16 @@ func hostInfo() map[string]interface{} {
"version": hostDistributionInfo["Version"],
}
kv, err := readKernelVersion()
kv, err := putil.ReadKernelVersion()
if err != nil {
logrus.Error(err, "error reading kernel version")
}
info["kernel"] = kv
up, err := readUptime()
upDuration, err := putil.ReadUptime()
if err != nil {
logrus.Error(err, "error reading up time")
}
// Convert uptime in seconds to a human-readable format
upSeconds := up + "s"
upDuration, err := time.ParseDuration(upSeconds)
if err != nil {
logrus.Error(err, "error parsing system uptime")
}
hoursFound := false
var timeBuffer bytes.Buffer
@@ -170,30 +162,6 @@ func storeInfo(store storage.Store) (map[string]interface{}, error) {
return info, nil
}
func readKernelVersion() (string, error) {
buf, err := ioutil.ReadFile("/proc/version")
if err != nil {
return "", err
}
f := bytes.Fields(buf)
if len(f) < 2 {
return string(bytes.TrimSpace(buf)), nil
}
return string(f[2]), nil
}
func readUptime() (string, error) {
buf, err := ioutil.ReadFile("/proc/uptime")
if err != nil {
return "", err
}
f := bytes.Fields(buf)
if len(f) < 1 {
return "", errors.New("invalid uptime")
}
return string(f[0]), nil
}
// getHostDistributionInfo returns a map containing the host's distribution and version
func getHostDistributionInfo() map[string]string {
dist := make(map[string]string)