mirror of
https://github.com/containers/podman.git
synced 2025-09-27 00:34:32 +08:00
vendor c/common@main
Finalizes the linked BZ to fix passing down custom authfiles during auto updates. Also fixes the if-newer pull policy. [NO TESTS NEEDED] for now validated manually. There's a TODO to add a new system test that I did not find time for before PTO. BZ: bugzilla.redhat.com/show_bug.cgi?id=2000943 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
18
vendor/github.com/containers/common/libimage/image.go
generated
vendored
18
vendor/github.com/containers/common/libimage/image.go
generated
vendored
@ -715,10 +715,18 @@ func (i *Image) Size() (int64, error) {
|
||||
return i.runtime.store.ImageSize(i.ID())
|
||||
}
|
||||
|
||||
// HasDifferentDigestOptions allows for customizing the check if another
|
||||
// (remote) image has a different digest.
|
||||
type HasDifferentDigestOptions struct {
|
||||
// containers-auth.json(5) file to use when authenticating against
|
||||
// container registries.
|
||||
AuthFilePath string
|
||||
}
|
||||
|
||||
// HasDifferentDigest returns true if the image specified by `remoteRef` has a
|
||||
// different digest than the local one. This check can be useful to check for
|
||||
// updates on remote registries.
|
||||
func (i *Image) HasDifferentDigest(ctx context.Context, remoteRef types.ImageReference) (bool, error) {
|
||||
func (i *Image) HasDifferentDigest(ctx context.Context, remoteRef types.ImageReference, options *HasDifferentDigestOptions) (bool, error) {
|
||||
// We need to account for the arch that the image uses. It seems
|
||||
// common on ARM to tweak this option to pull the correct image. See
|
||||
// github.com/containers/podman/issues/6613.
|
||||
@ -738,6 +746,14 @@ func (i *Image) HasDifferentDigest(ctx context.Context, remoteRef types.ImageRef
|
||||
sys.VariantChoice = inspectInfo.Variant
|
||||
}
|
||||
|
||||
if options != nil && options.AuthFilePath != "" {
|
||||
sys.AuthFilePath = options.AuthFilePath
|
||||
}
|
||||
|
||||
return i.hasDifferentDigestWithSystemContext(ctx, remoteRef, sys)
|
||||
}
|
||||
|
||||
func (i *Image) hasDifferentDigestWithSystemContext(ctx context.Context, remoteRef types.ImageReference, sys *types.SystemContext) (bool, error) {
|
||||
remoteImg, err := remoteRef.NewImage(ctx, sys)
|
||||
if err != nil {
|
||||
return false, err
|
||||
|
2
vendor/github.com/containers/common/libimage/pull.go
generated
vendored
2
vendor/github.com/containers/common/libimage/pull.go
generated
vendored
@ -561,7 +561,7 @@ func (r *Runtime) copySingleImageFromRegistry(ctx context.Context, imageName str
|
||||
}
|
||||
|
||||
if pullPolicy == config.PullPolicyNewer && localImage != nil {
|
||||
isNewer, err := localImage.HasDifferentDigest(ctx, srcRef)
|
||||
isNewer, err := localImage.hasDifferentDigestWithSystemContext(ctx, srcRef, c.systemContext)
|
||||
if err != nil {
|
||||
pullErrors = append(pullErrors, err)
|
||||
continue
|
||||
|
6
vendor/github.com/containers/common/pkg/config/config.go
generated
vendored
6
vendor/github.com/containers/common/pkg/config/config.go
generated
vendored
@ -335,7 +335,7 @@ type EngineConfig struct {
|
||||
// ActiveService index to Destinations added v2.0.3
|
||||
ActiveService string `toml:"active_service,omitempty"`
|
||||
|
||||
// Destinations mapped by service Names
|
||||
// ServiceDestinations mapped by service Names
|
||||
ServiceDestinations map[string]Destination `toml:"service_destinations,omitempty"`
|
||||
|
||||
// RuntimePath is the path to OCI runtime binary for launching containers.
|
||||
@ -379,6 +379,10 @@ type EngineConfig struct {
|
||||
// containers/storage. As such this is not exposed via the config file.
|
||||
StateType RuntimeStateStore `toml:"-"`
|
||||
|
||||
// ServiceTimeout is the number of seconds to wait without a connection
|
||||
// before the `podman system service` times out and exits
|
||||
ServiceTimeout uint `toml:"service_timeout,omitempty"`
|
||||
|
||||
// StaticDir is the path to a persistent directory to store container
|
||||
// files.
|
||||
StaticDir string `toml:"static_dir,omitempty"`
|
||||
|
7
vendor/github.com/containers/common/pkg/config/containers.conf
generated
vendored
7
vendor/github.com/containers/common/pkg/config/containers.conf
generated
vendored
@ -422,7 +422,7 @@ default_sysctls = [
|
||||
# Default options to pass to the slirp4netns binary.
|
||||
# For example "allow_host_loopback=true"
|
||||
#
|
||||
#network_cmd_options = []
|
||||
#network_cmd_options = ["enable_ipv6=true",]
|
||||
|
||||
# Whether to use chroot instead of pivot_root in the runtime
|
||||
#
|
||||
@ -466,6 +466,11 @@ default_sysctls = [
|
||||
# container/storage tmp directory will be used.
|
||||
# image_copy_tmp_dir="/var/tmp"
|
||||
|
||||
# Number of seconds to wait without a connection
|
||||
# before the `podman system service` times out and exits
|
||||
#
|
||||
#service_timeout = 5
|
||||
|
||||
# Directory for persistent engine files (database, etc)
|
||||
# By default, this will be configured relative to where the containers/storage
|
||||
# stores containers
|
||||
|
5
vendor/github.com/containers/common/pkg/config/default.go
generated
vendored
5
vendor/github.com/containers/common/pkg/config/default.go
generated
vendored
@ -257,8 +257,11 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
|
||||
c.ImageBuildFormat = "oci"
|
||||
|
||||
c.CgroupManager = defaultCgroupManager()
|
||||
c.ServiceTimeout = uint(5)
|
||||
c.StopTimeout = uint(10)
|
||||
|
||||
c.NetworkCmdOptions = []string{
|
||||
"enable_ipv6=true",
|
||||
}
|
||||
c.Remote = isRemote()
|
||||
c.OCIRuntimes = map[string][]string{
|
||||
"crun": {
|
||||
|
Reference in New Issue
Block a user