Switch to fixed common

Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
This commit is contained in:
James Hewitt
2024-11-29 13:34:43 +00:00
parent 48ae52c08b
commit 43825122d4
8 changed files with 39 additions and 7 deletions

2
go.mod
View File

@ -14,7 +14,7 @@ require (
github.com/checkpoint-restore/go-criu/v7 v7.2.0 github.com/checkpoint-restore/go-criu/v7 v7.2.0
github.com/containernetworking/plugins v1.5.1 github.com/containernetworking/plugins v1.5.1
github.com/containers/buildah v1.38.1-0.20241119213149-52437ef15d33 github.com/containers/buildah v1.38.1-0.20241119213149-52437ef15d33
github.com/containers/common v0.61.1-0.20241125172552-a801fac4edc0 github.com/containers/common v0.61.1-0.20241202111335-2d4a9a65dd81
github.com/containers/conmon v2.0.20+incompatible github.com/containers/conmon v2.0.20+incompatible
github.com/containers/gvisor-tap-vsock v0.8.0 github.com/containers/gvisor-tap-vsock v0.8.0
github.com/containers/image/v5 v5.33.0 github.com/containers/image/v5 v5.33.0

4
go.sum
View File

@ -81,8 +81,8 @@ github.com/containernetworking/plugins v1.5.1 h1:T5ji+LPYjjgW0QM+KyrigZbLsZ8jaX+
github.com/containernetworking/plugins v1.5.1/go.mod h1:MIQfgMayGuHYs0XdNudf31cLLAC+i242hNm6KuDGqCM= github.com/containernetworking/plugins v1.5.1/go.mod h1:MIQfgMayGuHYs0XdNudf31cLLAC+i242hNm6KuDGqCM=
github.com/containers/buildah v1.38.1-0.20241119213149-52437ef15d33 h1:Ih6KuyByK7ZGGzkS0M5rVBPLWIyeDvdL5klhsKBo8vA= github.com/containers/buildah v1.38.1-0.20241119213149-52437ef15d33 h1:Ih6KuyByK7ZGGzkS0M5rVBPLWIyeDvdL5klhsKBo8vA=
github.com/containers/buildah v1.38.1-0.20241119213149-52437ef15d33/go.mod h1:RxIuKhwTpRl3ma4d4BF6QzSSeg9zNNvo/xhYJOKeDQs= github.com/containers/buildah v1.38.1-0.20241119213149-52437ef15d33/go.mod h1:RxIuKhwTpRl3ma4d4BF6QzSSeg9zNNvo/xhYJOKeDQs=
github.com/containers/common v0.61.1-0.20241125172552-a801fac4edc0 h1:Vh8IytxprODmjd4sALcSVUzhT28vT537UWsfCXcahWk= github.com/containers/common v0.61.1-0.20241202111335-2d4a9a65dd81 h1:Nw7YRDWv0ZO/AINzOeyR2KnJyfcIz1Ek3Ube/akl4U4=
github.com/containers/common v0.61.1-0.20241125172552-a801fac4edc0/go.mod h1:3mUU2/PxkOwvL46fmaRVj0YfBDBxNPOMctIvBHWo4Ak= github.com/containers/common v0.61.1-0.20241202111335-2d4a9a65dd81/go.mod h1:ySiyZ85+F3xk7kcQvaZo0Ii67Hma7T4JEeILEQPWEKY=
github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6JXHGTUje2ZYobNrkg= 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/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I=
github.com/containers/gvisor-tap-vsock v0.8.0 h1:Z8ZEWb+Lio0d+lXexONdUWT4rm9lF91vH0g3ARnMy7o= github.com/containers/gvisor-tap-vsock v0.8.0 h1:Z8ZEWb+Lio0d+lXexONdUWT4rm9lF91vH0g3ARnMy7o=

View File

@ -12,6 +12,7 @@ import (
dockerDaemonTransport "github.com/containers/image/v5/docker/daemon" dockerDaemonTransport "github.com/containers/image/v5/docker/daemon"
"github.com/containers/image/v5/docker/reference" "github.com/containers/image/v5/docker/reference"
"github.com/containers/image/v5/manifest" "github.com/containers/image/v5/manifest"
compressiontypes "github.com/containers/image/v5/pkg/compression/types"
"github.com/containers/image/v5/transports/alltransports" "github.com/containers/image/v5/transports/alltransports"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -86,8 +87,16 @@ func (r *Runtime) Push(ctx context.Context, source, destination string, options
destRef = dockerRef destRef = dockerRef
} }
// docker-archive and only DockerV2Schema2MediaType support Gzip compression // docker-archive and DockerV2Schema2MediaType support only Gzip compression
if options.CompressionFormat != nil && // If the CompressionFormat has come from containers.conf (set as a default),
// but isn't supported for this push, we want to ignore it.
// If the CompressionFormat has come from the CLI (ForceCompressionFormat
// requires CompressionFormat to be set), we want to strip the invalid value
// so that the push attempt fails.
//
// Ideally this should all happen at a much higher layer, where the code can differentiate
// between a value coming from containers.conf vs. the CLI.
if options.CompressionFormat != nil && options.CompressionFormat.Name() != compressiontypes.GzipAlgorithmName &&
(destRef.Transport().Name() == dockerArchiveTransport.Transport.Name() || (destRef.Transport().Name() == dockerArchiveTransport.Transport.Name() ||
destRef.Transport().Name() == dockerDaemonTransport.Transport.Name() || destRef.Transport().Name() == dockerDaemonTransport.Transport.Name() ||
options.ManifestMIMEType == manifest.DockerV2Schema2MediaType) { options.ManifestMIMEType == manifest.DockerV2Schema2MediaType) {

View File

@ -277,7 +277,7 @@ type PerNetworkOptions struct {
type NetworkOptions struct { type NetworkOptions struct {
// ContainerID is the container id, used for iptables comments and ipam allocation. // ContainerID is the container id, used for iptables comments and ipam allocation.
ContainerID string `json:"container_id"` ContainerID string `json:"container_id"`
// ContainerName is the container name, used as dns name. // ContainerName is the container name.
ContainerName string `json:"container_name"` ContainerName string `json:"container_name"`
// PortMappings contains the port mappings for this container // PortMappings contains the port mappings for this container
PortMappings []PortMapping `json:"port_mappings,omitempty"` PortMappings []PortMapping `json:"port_mappings,omitempty"`
@ -287,6 +287,8 @@ type NetworkOptions struct {
// List of custom DNS server for podman's DNS resolver. // List of custom DNS server for podman's DNS resolver.
// Priority order will be kept as defined by user in the configuration. // Priority order will be kept as defined by user in the configuration.
DNSServers []string `json:"dns_servers,omitempty"` DNSServers []string `json:"dns_servers,omitempty"`
// ContainerHostname is the configured DNS hostname of the container.
ContainerHostname string `json:"container_hostname"`
} }
// PortMapping is one or more ports that will be mapped into the container. // PortMapping is one or more ports that will be mapped into the container.

View File

@ -96,6 +96,13 @@ type ContainersConfig struct {
// "memory.high=1073741824" sets the memory.high limit to 1GB. // "memory.high=1073741824" sets the memory.high limit to 1GB.
CgroupConf attributedstring.Slice `toml:"cgroup_conf,omitempty"` CgroupConf attributedstring.Slice `toml:"cgroup_conf,omitempty"`
// When no hostname is set for a container, use the container's name, with
// characters not valid for a hostname removed, as the hostname instead of
// the first 12 characters of the container's ID. Containers not running
// in a private UTS namespace will have their hostname set to the host's
// hostname regardless of this setting.
ContainerNameAsHostName bool `toml:"container_name_as_hostname,omitempty"`
// Capabilities to add to all containers. // Capabilities to add to all containers.
DefaultCapabilities attributedstring.Slice `toml:"default_capabilities,omitempty"` DefaultCapabilities attributedstring.Slice `toml:"default_capabilities,omitempty"`

View File

@ -58,6 +58,14 @@
# #
#cgroups = "enabled" #cgroups = "enabled"
# When no hostname is set for a container, use the container's name, with
# characters not valid for a hostname removed, as the hostname instead of
# the first 12 characters of the container's ID. Containers not running
# in a private UTS namespace will have their hostname set to the host's
# hostname regardless of this setting.
#
#container_name_as_hostname = false
# List of default capabilities for containers. If it is empty or commented out, # List of default capabilities for containers. If it is empty or commented out,
# the default capabilities defined in the container engine will be added. # the default capabilities defined in the container engine will be added.
# #

View File

@ -29,6 +29,12 @@
# #
#base_hosts_file = "" #base_hosts_file = ""
# When no hostname is set for a container, use the container's name, with
# characters not valid for a hostname removed, as the hostname instead of
# the first 12 characters of the container's ID.
#
#container_name_as_hostname = false
# The database backend of Podman. Supported values are "" (default), "boltdb" # The database backend of Podman. Supported values are "" (default), "boltdb"
# and "sqlite". An empty value means it will check whenever a boltdb already # and "sqlite". An empty value means it will check whenever a boltdb already
# exists and use it when it does, otherwise it will use sqlite as default # exists and use it when it does, otherwise it will use sqlite as default

2
vendor/modules.txt vendored
View File

@ -174,7 +174,7 @@ github.com/containers/buildah/pkg/sshagent
github.com/containers/buildah/pkg/util github.com/containers/buildah/pkg/util
github.com/containers/buildah/pkg/volumes github.com/containers/buildah/pkg/volumes
github.com/containers/buildah/util github.com/containers/buildah/util
# github.com/containers/common v0.61.1-0.20241125172552-a801fac4edc0 # github.com/containers/common v0.61.1-0.20241202111335-2d4a9a65dd81
## explicit; go 1.22.6 ## explicit; go 1.22.6
github.com/containers/common/internal github.com/containers/common/internal
github.com/containers/common/internal/attributedstring github.com/containers/common/internal/attributedstring