aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/source/markdown/podman-manifest.1.md2
-rw-r--r--go.mod4
-rw-r--r--go.sum7
-rw-r--r--pkg/machine/fedora.go32
-rw-r--r--pkg/machine/pull.go7
-rw-r--r--vendor/github.com/containers/common/libimage/filters.go1
-rw-r--r--vendor/github.com/containers/common/libnetwork/util/filters.go5
-rw-r--r--vendor/github.com/containers/common/pkg/cgroups/systemd_linux.go6
-rw-r--r--vendor/github.com/containers/common/pkg/filters/filters.go18
-rw-r--r--vendor/github.com/opencontainers/runtime-tools/generate/generate.go19
-rw-r--r--vendor/github.com/opencontainers/runtime-tools/generate/seccomp/seccomp_default.go1
-rw-r--r--vendor/modules.txt4
12 files changed, 80 insertions, 26 deletions
diff --git a/docs/source/markdown/podman-manifest.1.md b/docs/source/markdown/podman-manifest.1.md
index 5ff44c1d5..cc716b2a0 100644
--- a/docs/source/markdown/podman-manifest.1.md
+++ b/docs/source/markdown/podman-manifest.1.md
@@ -22,7 +22,7 @@ The `podman manifest` command provides subcommands which can be used to:
| inspect | [podman-manifest-inspect(1)](podman-manifest-inspect.1.md) | Display a manifest list or image index. |
| push | [podman-manifest-push(1)](podman-manifest-push.1.md) | Push a manifest list or image index to a registry. |
| remove | [podman-manifest-remove(1)](podman-manifest-remove.1.md) | Remove an image from a manifest list or image index. |
-| rm | [podman-manifest-rme(1)](podman-manifest-rm.1.md) | Remove manifest list or image index from local storage. |
+| rm | [podman-manifest-rm(1)](podman-manifest-rm.1.md) | Remove manifest list or image index from local storage. |
## EXAMPLES
diff --git a/go.mod b/go.mod
index 023b9c025..26e96499d 100644
--- a/go.mod
+++ b/go.mod
@@ -12,7 +12,7 @@ require (
github.com/containernetworking/cni v1.1.1
github.com/containernetworking/plugins v1.1.1
github.com/containers/buildah v1.26.1-0.20220716095526-d31d27c357ab
- github.com/containers/common v0.48.1-0.20220715075726-2ac10faca05a
+ github.com/containers/common v0.48.1-0.20220718075257-ecddf87b3840
github.com/containers/conmon v2.0.20+incompatible
github.com/containers/image/v5 v5.21.2-0.20220714132403-2bb3f3e44c5c
github.com/containers/ocicrypt v1.1.5
@@ -49,7 +49,7 @@ require (
github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198
github.com/opencontainers/runc v1.1.3
github.com/opencontainers/runtime-spec v1.0.3-0.20211214071223-8958f93039ab
- github.com/opencontainers/runtime-tools v0.9.1-0.20220110225228-7e2d60f1e41f
+ github.com/opencontainers/runtime-tools v0.9.1-0.20220714195903-17b3287fafb7
github.com/opencontainers/selinux v1.10.1
github.com/pmezard/go-difflib v1.0.0
github.com/rootless-containers/rootlesskit v1.0.1
diff --git a/go.sum b/go.sum
index 8e0a9ad83..a13342cf8 100644
--- a/go.sum
+++ b/go.sum
@@ -392,8 +392,9 @@ github.com/containernetworking/plugins v1.1.1 h1:+AGfFigZ5TiQH00vhR8qPeSatj53eNG
github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8=
github.com/containers/buildah v1.26.1-0.20220716095526-d31d27c357ab h1:NeI0DOkTf3Tn4OpdjMhMubAfTPs2oCO5jUY5wnpv4qk=
github.com/containers/buildah v1.26.1-0.20220716095526-d31d27c357ab/go.mod h1:iVtQtU6a+pbETBqIzg0oAWW3gTR1ItrAihJpLFFppmA=
-github.com/containers/common v0.48.1-0.20220715075726-2ac10faca05a h1:kdcruVl641VTIm8C3O58WRYcBTbnWCsh6AJymk28ScM=
github.com/containers/common v0.48.1-0.20220715075726-2ac10faca05a/go.mod h1:1dA7JPGoSi83kjf5H4NIrGANyLOULyvFqV1bwvYFEek=
+github.com/containers/common v0.48.1-0.20220718075257-ecddf87b3840 h1:+5C5tnWO2a6M9QqKNUibMIn56LAuIDtuyb/xT6ZGU/4=
+github.com/containers/common v0.48.1-0.20220718075257-ecddf87b3840/go.mod h1:1dA7JPGoSi83kjf5H4NIrGANyLOULyvFqV1bwvYFEek=
github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6JXHGTUje2ZYobNrkg=
github.com/containers/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I=
github.com/containers/image/v5 v5.21.2-0.20220712113758-29aec5f7bbbf/go.mod h1:0+N0ZM9mgMmoZZc6uNcgnEsbX85Ne7b29cIW5lqWwVU=
@@ -1302,8 +1303,8 @@ github.com/opencontainers/runtime-spec v1.0.3-0.20211214071223-8958f93039ab/go.m
github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
github.com/opencontainers/runtime-tools v0.0.0-20190417131837-cd1349b7c47e/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
github.com/opencontainers/runtime-tools v0.9.0/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
-github.com/opencontainers/runtime-tools v0.9.1-0.20220110225228-7e2d60f1e41f h1:MMcsVl0FAVEahmXTy+uXoDTw3yJq7nGrK8ITs/kkreo=
-github.com/opencontainers/runtime-tools v0.9.1-0.20220110225228-7e2d60f1e41f/go.mod h1:/tgP02fPXGHkU3/qKK1Y0Db4yqNyGm03vLq/mzHzcS4=
+github.com/opencontainers/runtime-tools v0.9.1-0.20220714195903-17b3287fafb7 h1:Rf+QsQGxrYCia8mVyOPnoQZ+vJkZGL+ESWBDUM5s9cQ=
+github.com/opencontainers/runtime-tools v0.9.1-0.20220714195903-17b3287fafb7/go.mod h1:/tgP02fPXGHkU3/qKK1Y0Db4yqNyGm03vLq/mzHzcS4=
github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE=
github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo=
github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8=
diff --git a/pkg/machine/fedora.go b/pkg/machine/fedora.go
index 7c80fc5d3..7ac4692e3 100644
--- a/pkg/machine/fedora.go
+++ b/pkg/machine/fedora.go
@@ -6,7 +6,10 @@ package machine
import (
"errors"
"fmt"
+ "io"
"os"
+ "path"
+ "strings"
"net/http"
"net/url"
@@ -23,7 +26,7 @@ type FedoraDownload struct {
}
func NewFedoraDownloader(vmType, vmName, releaseStream string) (DistributionDownload, error) {
- downloadURL, size, err := getFedoraDownload(githubLatestReleaseURL)
+ downloadURL, version, size, err := getFedoraDownload(githubLatestReleaseURL)
if err != nil {
return nil, err
}
@@ -33,7 +36,7 @@ func NewFedoraDownloader(vmType, vmName, releaseStream string) (DistributionDown
return nil, err
}
- imageName := "rootfs.tar.xz"
+ imageName := fmt.Sprintf("fedora-podman-%s.tar.xz", version)
f := FedoraDownload{
Download: Download{
@@ -77,21 +80,36 @@ func (f FedoraDownload) CleanCache() error {
return removeImageAfterExpire(f.CacheDir, expire)
}
-func getFedoraDownload(releaseURL string) (*url.URL, int64, error) {
+func getFedoraDownload(releaseURL string) (*url.URL, string, int64, error) {
downloadURL, err := url.Parse(releaseURL)
if err != nil {
- return nil, -1, fmt.Errorf("invalid URL generated from discovered Fedora file: %s: %w", releaseURL, err)
+ return nil, "", -1, fmt.Errorf("invalid URL generated from discovered Fedora file: %s: %w", releaseURL, err)
}
resp, err := http.Head(releaseURL)
if err != nil {
- return nil, -1, fmt.Errorf("head request failed: %s: %w", releaseURL, err)
+ return nil, "", -1, fmt.Errorf("head request failed: %s: %w", releaseURL, err)
}
_ = resp.Body.Close()
+ contentLen := resp.ContentLength
if resp.StatusCode != http.StatusOK {
- return nil, -1, fmt.Errorf("head request failed: %s: %w", releaseURL, err)
+ return nil, "", -1, fmt.Errorf("head request failed: %s: %w", releaseURL, err)
}
- return downloadURL, resp.ContentLength, nil
+ verURL := *downloadURL
+ verURL.Path = path.Join(path.Dir(downloadURL.Path), "version")
+
+ resp, err = http.Get(verURL.String())
+ if err != nil {
+ return nil, "", -1, fmt.Errorf("get request failed: %s: %w", verURL.String(), err)
+ }
+
+ bytes, err := io.ReadAll(&io.LimitedReader{R: resp.Body, N: 1024})
+ if err != nil {
+ return nil, "", -1, fmt.Errorf("failed reading: %s: %w", verURL.String(), err)
+ }
+ _ = resp.Body.Close()
+
+ return downloadURL, strings.TrimSpace(string(bytes)), contentLen, nil
}
diff --git a/pkg/machine/pull.go b/pkg/machine/pull.go
index 08baa7df8..26b6adc67 100644
--- a/pkg/machine/pull.go
+++ b/pkg/machine/pull.go
@@ -113,7 +113,7 @@ func DownloadImage(d DistributionDownload) error {
return err
}
if !ok {
- if err := DownloadVMImage(d.Get().URL, d.Get().LocalPath); err != nil {
+ if err := DownloadVMImage(d.Get().URL, d.Get().ImageName, d.Get().LocalPath); err != nil {
return err
}
// Clean out old cached images, since we didn't find needed image in cache
@@ -128,7 +128,7 @@ func DownloadImage(d DistributionDownload) error {
// DownloadVMImage downloads a VM image from url to given path
// with download status
-func DownloadVMImage(downloadURL *url2.URL, localImagePath string) error {
+func DownloadVMImage(downloadURL *url2.URL, imageName string, localImagePath string) error {
out, err := os.Create(localImagePath)
if err != nil {
return err
@@ -153,8 +153,7 @@ func DownloadVMImage(downloadURL *url2.URL, localImagePath string) error {
return fmt.Errorf("downloading VM image %s: %s", downloadURL, resp.Status)
}
size := resp.ContentLength
- urlSplit := strings.Split(downloadURL.Path, "/")
- prefix := "Downloading VM image: " + urlSplit[len(urlSplit)-1]
+ prefix := "Downloading VM image: " + imageName
onComplete := prefix + ": done"
p := mpb.New(
diff --git a/vendor/github.com/containers/common/libimage/filters.go b/vendor/github.com/containers/common/libimage/filters.go
index 3968c5fdc..f387edf58 100644
--- a/vendor/github.com/containers/common/libimage/filters.go
+++ b/vendor/github.com/containers/common/libimage/filters.go
@@ -159,7 +159,6 @@ func (r *Runtime) compileImageFilters(ctx context.Context, options *ListImagesOp
case "label":
filter = filterLabel(ctx, value)
-
case "readonly":
readOnly, err := r.bool(duplicate, key, value)
if err != nil {
diff --git a/vendor/github.com/containers/common/libnetwork/util/filters.go b/vendor/github.com/containers/common/libnetwork/util/filters.go
index a8ef8a413..2f1e4a21f 100644
--- a/vendor/github.com/containers/common/libnetwork/util/filters.go
+++ b/vendor/github.com/containers/common/libnetwork/util/filters.go
@@ -65,7 +65,10 @@ func createPruneFilterFuncs(key string, filterValues []string) (types.FilterFunc
return func(net types.Network) bool {
return filters.MatchLabelFilters(filterValues, net.Labels)
}, nil
-
+ case "label!":
+ return func(net types.Network) bool {
+ return !filters.MatchLabelFilters(filterValues, net.Labels)
+ }, nil
case "until":
until, err := filters.ComputeUntilTimestamp(filterValues)
if err != nil {
diff --git a/vendor/github.com/containers/common/pkg/cgroups/systemd_linux.go b/vendor/github.com/containers/common/pkg/cgroups/systemd_linux.go
index e0f73b4e7..92b87fdaf 100644
--- a/vendor/github.com/containers/common/pkg/cgroups/systemd_linux.go
+++ b/vendor/github.com/containers/common/pkg/cgroups/systemd_linux.go
@@ -201,7 +201,11 @@ func resourcesToProps(res *configs.Resources, v2 bool) (map[string]uint64, map[s
// Blkio
if res.BlkioWeight > 0 {
- uMap["BlockIOWeight"] = uint64(res.BlkioWeight)
+ if v2 {
+ uMap["IOWeight"] = uint64(res.BlkioWeight)
+ } else {
+ uMap["BlockIOWeight"] = uint64(res.BlkioWeight)
+ }
}
// systemd requires the paths to be in the form /dev/{block, char}/major:minor
diff --git a/vendor/github.com/containers/common/pkg/filters/filters.go b/vendor/github.com/containers/common/pkg/filters/filters.go
index dee66107f..f8b0066e5 100644
--- a/vendor/github.com/containers/common/pkg/filters/filters.go
+++ b/vendor/github.com/containers/common/pkg/filters/filters.go
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
+ "path/filepath"
"strings"
"time"
@@ -111,11 +112,24 @@ outer:
filterValue = ""
}
for labelKey, labelValue := range labels {
- if labelKey == filterKey && (filterValue == "" || labelValue == filterValue) {
- continue outer
+ if filterValue == "" || labelValue == filterValue {
+ if labelKey == filterKey || matchPattern(filterKey, labelKey) {
+ continue outer
+ }
}
}
return false
}
return true
}
+
+func matchPattern(pattern string, value string) bool {
+ if strings.Contains(pattern, "*") {
+ filter := fmt.Sprintf("*%s*", pattern)
+ filter = strings.ReplaceAll(filter, string(filepath.Separator), "|")
+ newName := strings.ReplaceAll(value, string(filepath.Separator), "|")
+ match, _ := filepath.Match(filter, newName)
+ return match
+ }
+ return false
+}
diff --git a/vendor/github.com/opencontainers/runtime-tools/generate/generate.go b/vendor/github.com/opencontainers/runtime-tools/generate/generate.go
index be1f027bf..f4e77ee1e 100644
--- a/vendor/github.com/opencontainers/runtime-tools/generate/generate.go
+++ b/vendor/github.com/opencontainers/runtime-tools/generate/generate.go
@@ -42,7 +42,7 @@ type ExportOptions struct {
// New creates a configuration Generator with the default
// configuration for the target operating system.
func New(os string) (generator Generator, err error) {
- if os != "linux" && os != "solaris" && os != "windows" {
+ if os != "linux" && os != "solaris" && os != "windows" && os != "freebsd" {
return generator, fmt.Errorf("no defaults configured for %s", os)
}
@@ -72,7 +72,7 @@ func New(os string) (generator Generator, err error) {
}
}
- if os == "linux" || os == "solaris" {
+ if os == "linux" || os == "solaris" || os == "freebsd" {
config.Process.User = rspec.User{}
config.Process.Env = []string{
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
@@ -237,6 +237,21 @@ func New(os string) (generator Generator, err error) {
},
Seccomp: seccomp.DefaultProfile(&config),
}
+ } else if os == "freebsd" {
+ config.Mounts = []rspec.Mount{
+ {
+ Destination: "/dev",
+ Type: "devfs",
+ Source: "devfs",
+ Options: []string{"ruleset=4"},
+ },
+ {
+ Destination: "/dev/fd",
+ Type: "fdescfs",
+ Source: "fdesc",
+ Options: []string{},
+ },
+ }
}
envCache := map[string]int{}
diff --git a/vendor/github.com/opencontainers/runtime-tools/generate/seccomp/seccomp_default.go b/vendor/github.com/opencontainers/runtime-tools/generate/seccomp/seccomp_default.go
index 8a8dc3970..12bc44d6d 100644
--- a/vendor/github.com/opencontainers/runtime-tools/generate/seccomp/seccomp_default.go
+++ b/vendor/github.com/opencontainers/runtime-tools/generate/seccomp/seccomp_default.go
@@ -303,6 +303,7 @@ func DefaultProfile(rs *specs.Spec) *rspec.LinuxSeccomp {
"stat64",
"statfs",
"statfs64",
+ "statx",
"symlink",
"symlinkat",
"sync",
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 3da12dbd8..70a9f197b 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -114,7 +114,7 @@ github.com/containers/buildah/pkg/rusage
github.com/containers/buildah/pkg/sshagent
github.com/containers/buildah/pkg/util
github.com/containers/buildah/util
-# github.com/containers/common v0.48.1-0.20220715075726-2ac10faca05a
+# github.com/containers/common v0.48.1-0.20220718075257-ecddf87b3840
## explicit
github.com/containers/common/libimage
github.com/containers/common/libimage/define
@@ -599,7 +599,7 @@ github.com/opencontainers/runc/libcontainer/utils
# github.com/opencontainers/runtime-spec v1.0.3-0.20211214071223-8958f93039ab
## explicit
github.com/opencontainers/runtime-spec/specs-go
-# github.com/opencontainers/runtime-tools v0.9.1-0.20220110225228-7e2d60f1e41f
+# github.com/opencontainers/runtime-tools v0.9.1-0.20220714195903-17b3287fafb7
## explicit
github.com/opencontainers/runtime-tools/error
github.com/opencontainers/runtime-tools/filepath