Bump c/common to v0.47.4

As the title says.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
This commit is contained in:
tomsweeneyredhat
2022-02-09 15:24:08 -05:00
parent 12836a5610
commit 1512740e3b
12 changed files with 57 additions and 23 deletions

2
go.mod
View File

@ -12,7 +12,7 @@ require (
github.com/containernetworking/cni v1.0.1
github.com/containernetworking/plugins v1.0.1
github.com/containers/buildah v1.24.1
github.com/containers/common v0.47.3
github.com/containers/common v0.47.4
github.com/containers/conmon v2.0.20+incompatible
github.com/containers/image/v5 v5.19.1
github.com/containers/ocicrypt v1.1.2

3
go.sum
View File

@ -325,8 +325,9 @@ github.com/containernetworking/plugins v1.0.1 h1:wwCfYbTCj5FC0EJgyzyjTXmqysOiJE9
github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE=
github.com/containers/buildah v1.24.1 h1:PlvU0hbUsm1x4H9kPcsmqjViqDGnBpSZT3QtZ00RtgI=
github.com/containers/buildah v1.24.1/go.mod h1:sE7AaoPQYwAB7dleOOKOpzOO3bA8lRUvZRiZcn/RYi0=
github.com/containers/common v0.47.3 h1:pRT7gkLrBSQe3075j5hoHYeeKpGTWBJHws+tS5xxfak=
github.com/containers/common v0.47.3/go.mod h1:/VAV4ibC27Lfyb9cxXM4uTYrJFa/7s+utNB052MJdzY=
github.com/containers/common v0.47.4 h1:kS202Z/bTQIM/pwyuJ+lF8143Uli6AB9Q9OVR0xa9CM=
github.com/containers/common v0.47.4/go.mod h1:HgX0mFXyB0Tbe2REEIp9x9CxET6iSzmHfwR6S/t2LZc=
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.19.1 h1:g4/+XIuh1kRoRn2MfLDhfHhkNOIO9JtqhSyo55tjpfE=

View File

@ -7,6 +7,7 @@ import (
"strings"
"time"
"github.com/containers/common/libimage/manifests"
"github.com/containers/common/pkg/config"
"github.com/containers/common/pkg/retry"
"github.com/containers/image/v5/copy"
@ -26,8 +27,10 @@ const (
)
// LookupReferenceFunc return an image reference based on the specified one.
// This can be used to pass custom blob caches to the copy operation.
type LookupReferenceFunc func(ref types.ImageReference) (types.ImageReference, error)
// The returned reference can return custom ImageSource or ImageDestination
// objects which intercept or filter blobs, manifests, and signatures as
// they are read and written.
type LookupReferenceFunc = manifests.LookupReferenceFunc
// CopyOptions allow for customizing image-copy operations.
type CopyOptions struct {

View File

@ -27,6 +27,12 @@ import (
const instancesData = "instances.json"
// LookupReferenceFunc return an image reference based on the specified one.
// The returned reference can return custom ImageSource or ImageDestination
// objects which intercept or filter blobs, manifests, and signatures as
// they are read and written.
type LookupReferenceFunc func(ref types.ImageReference) (types.ImageReference, error)
// ErrListImageUnknown is returned when we attempt to create an image reference
// for a List that has not yet been saved to an image.
var ErrListImageUnknown = stderrors.New("unable to determine which image holds the manifest list")
@ -57,6 +63,7 @@ type PushOptions struct {
SignBy string // fingerprint of GPG key to use to sign images
RemoveSignatures bool // true to discard signatures in images
ManifestType string // the format to use when saving the list - possible options are oci, v2s1, and v2s2
SourceFilter LookupReferenceFunc // filter the list source
}
// Create creates a new list containing information about the specified image,
@ -221,6 +228,11 @@ func (l *list) Push(ctx context.Context, dest types.ImageReference, options Push
if err != nil {
return nil, "", err
}
if options.SourceFilter != nil {
if src, err = options.SourceFilter(src); err != nil {
return nil, "", err
}
}
copyOptions := &cp.Options{
ImageListSelection: options.ImageListSelection,
Instances: options.Instances,

View File

@ -222,14 +222,33 @@ func (n *cniNetwork) createCNIConfigListFromNetwork(network *types.Network, writ
err error
)
if len(network.Subnets) > 0 {
defIpv4Route := false
defIpv6Route := false
for _, subnet := range network.Subnets {
route, err := newIPAMDefaultRoute(util.IsIPv6(subnet.Subnet.IP))
ipam := newIPAMLocalHostRange(subnet.Subnet, subnet.LeaseRange, subnet.Gateway)
ipamRanges = append(ipamRanges, []ipamLocalHostRangeConf{*ipam})
// only add default route for not internal networks
if !network.Internal {
ipv6 := util.IsIPv6(subnet.Subnet.IP)
if !ipv6 && defIpv4Route {
continue
}
if ipv6 && defIpv6Route {
continue
}
if ipv6 {
defIpv6Route = true
} else {
defIpv4Route = true
}
route, err := newIPAMDefaultRoute(ipv6)
if err != nil {
return nil, "", err
}
routes = append(routes, route)
ipam := newIPAMLocalHostRange(subnet.Subnet, subnet.LeaseRange, subnet.Gateway)
ipamRanges = append(ipamRanges, []ipamLocalHostRangeConf{*ipam})
}
}
ipamConf = newIPAMHostLocalConf(routes, ipamRanges)
} else {

View File

@ -82,7 +82,7 @@ func (n *cniNetwork) networkCreate(newNetwork *types.Network, defaultNet bool) (
return nil, errors.Wrapf(types.ErrInvalidArg, "unsupported driver %s", newNetwork.Driver)
}
err = internalutil.ValidateSubnets(newNetwork, usedNetworks)
err = internalutil.ValidateSubnets(newNetwork, !newNetwork.Internal, usedNetworks)
if err != nil {
return nil, err
}

View File

@ -65,11 +65,11 @@ func ValidateSubnet(s *types.Subnet, addGateway bool, usedNetworks []*net.IPNet)
}
// ValidateSubnets will validate the subnets for this network.
// It also sets the gateway if the gateway is empty and it sets
// It also sets the gateway if the gateway is empty and addGateway is set to true
// IPv6Enabled to true if at least one subnet is ipv6.
func ValidateSubnets(network *types.Network, usedNetworks []*net.IPNet) error {
func ValidateSubnets(network *types.Network, addGateway bool, usedNetworks []*net.IPNet) error {
for i := range network.Subnets {
err := ValidateSubnet(&network.Subnets[i], !network.Internal, usedNetworks)
err := ValidateSubnet(&network.Subnets[i], addGateway, usedNetworks)
if err != nil {
return err
}

View File

@ -115,16 +115,13 @@ func (n *netavarkNetwork) networkCreate(newNetwork *types.Network, defaultNet bo
return nil, errors.Wrapf(types.ErrInvalidArg, "unsupported driver %s", newNetwork.Driver)
}
err = internalutil.ValidateSubnets(newNetwork, usedNetworks)
// add gatway when not internal or dns enabled
addGateway := !newNetwork.Internal || newNetwork.DNSEnabled
err = internalutil.ValidateSubnets(newNetwork, addGateway, usedNetworks)
if err != nil {
return nil, err
}
// FIXME: If we have a working solution for internal networks with dns this check should be removed.
if newNetwork.DNSEnabled && newNetwork.Internal {
return nil, errors.New("cannot set internal and dns enabled")
}
newNetwork.Created = time.Now()
if !defaultNet {

View File

@ -231,7 +231,9 @@ func parseNetwork(network *types.Network) error {
return errors.Errorf("invalid network ID %q", network.ID)
}
return util.ValidateSubnets(network, nil)
// add gatway when not internal or dns enabled
addGateway := !network.Internal || network.DNSEnabled
return util.ValidateSubnets(network, addGateway, nil)
}
func (n *netavarkNetwork) createDefaultNetwork() (*types.Network, error) {

View File

@ -248,7 +248,7 @@ func getUserAndPass(opts *LoginOptions, password, userFromAuthFile string) (user
}
if password == "" {
fmt.Fprint(opts.Stdout, "Password: ")
pass, err := terminal.ReadPassword(0)
pass, err := terminal.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
return "", "", errors.Wrap(err, "reading password")
}

View File

@ -1,4 +1,4 @@
package version
// Version is the version of the build.
const Version = "0.47.3"
const Version = "0.47.4"

2
vendor/modules.txt vendored
View File

@ -109,7 +109,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.47.3
# github.com/containers/common v0.47.4
## explicit
github.com/containers/common/libimage
github.com/containers/common/libimage/manifests