"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libpod/container_internal.go" between
podman-3.2.2.tar.gz and podman-3.2.3.tar.gz

About: podman (previous name "libpod") provides a library for applications looking to use the Container Pod concept, popularized by Kubernetes. Podman manages pods, containers, container images, and container volumes.

container_internal.go  (podman-3.2.2):container_internal.go  (podman-3.2.3)
skipping to change at line 18 skipping to change at line 18
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"time" "time"
metadata "github.com/checkpoint-restore/checkpointctl/lib" metadata "github.com/checkpoint-restore/checkpointctl/lib"
"github.com/containers/buildah/copier" "github.com/containers/buildah/copier"
"github.com/containers/common/pkg/secrets" butil "github.com/containers/buildah/util"
"github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/libpod/events" "github.com/containers/podman/v3/libpod/events"
"github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/cgroups"
"github.com/containers/podman/v3/pkg/ctime" "github.com/containers/podman/v3/pkg/ctime"
"github.com/containers/podman/v3/pkg/hooks" "github.com/containers/podman/v3/pkg/hooks"
"github.com/containers/podman/v3/pkg/hooks/exec" "github.com/containers/podman/v3/pkg/hooks/exec"
"github.com/containers/podman/v3/pkg/rootless" "github.com/containers/podman/v3/pkg/rootless"
"github.com/containers/podman/v3/pkg/selinux" "github.com/containers/podman/v3/pkg/selinux"
"github.com/containers/podman/v3/pkg/util"
"github.com/containers/storage" "github.com/containers/storage"
"github.com/containers/storage/pkg/archive" "github.com/containers/storage/pkg/archive"
"github.com/containers/storage/pkg/idtools" "github.com/containers/storage/pkg/idtools"
"github.com/containers/storage/pkg/mount" "github.com/containers/storage/pkg/mount"
"github.com/coreos/go-systemd/v22/daemon" "github.com/coreos/go-systemd/v22/daemon"
securejoin "github.com/cyphar/filepath-securejoin" securejoin "github.com/cyphar/filepath-securejoin"
spec "github.com/opencontainers/runtime-spec/specs-go" spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/generate" "github.com/opencontainers/runtime-tools/generate"
"github.com/opencontainers/selinux/go-selinux/label" "github.com/opencontainers/selinux/go-selinux/label"
"github.com/pkg/errors" "github.com/pkg/errors"
skipping to change at line 2191 skipping to change at line 2192
} }
for _, n := range c.config.Spec.Linux.Namespaces { for _, n := range c.config.Spec.Linux.Namespaces {
if n.Type == namespace { if n.Type == namespace {
return true return true
} }
} }
return false return false
} }
// extractSecretToStorage copies a secret's data from the secrets manager to the container's static dir // extractSecretToStorage copies a secret's data from the secrets manager to the container's static dir
func (c *Container) extractSecretToCtrStorage(name string) error { func (c *Container) extractSecretToCtrStorage(secr *ContainerSecret) error {
manager, err := secrets.NewManager(c.runtime.GetSecretsStorageDir()) manager, err := c.runtime.SecretsManager()
if err != nil { if err != nil {
return err return err
} }
secr, data, err := manager.LookupSecretData(name) _, data, err := manager.LookupSecretData(secr.Name)
if err != nil { if err != nil {
return err return err
} }
secretFile := filepath.Join(c.config.SecretsPath, secr.Name) secretFile := filepath.Join(c.config.SecretsPath, secr.Name)
hostUID, hostGID, err := butil.GetHostIDs(util.IDtoolsToRuntimeSpec(c.con
fig.IDMappings.UIDMap), util.IDtoolsToRuntimeSpec(c.config.IDMappings.GIDMap), s
ecr.UID, secr.GID)
if err != nil {
return errors.Wrap(err, "unable to extract secret")
}
err = ioutil.WriteFile(secretFile, data, 0644) err = ioutil.WriteFile(secretFile, data, 0644)
if err != nil { if err != nil {
return errors.Wrapf(err, "unable to create %s", secretFile) return errors.Wrapf(err, "unable to create %s", secretFile)
} }
if err := os.Lchown(secretFile, int(hostUID), int(hostGID)); err != nil {
return err
}
if err := os.Chmod(secretFile, os.FileMode(secr.Mode)); err != nil {
return err
}
if err := label.Relabel(secretFile, c.config.MountLabel, false); err != n il { if err := label.Relabel(secretFile, c.config.MountLabel, false); err != n il {
return err return err
} }
return nil return nil
} }
 End of changes. 6 change blocks. 
4 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)