Bump Buildah to v1.8.1, ImageBuilder to v1.1.0

As the title suggests.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
This commit is contained in:
TomSweeneyRedHat
2019-05-02 12:27:43 -04:00
parent bd5d029889
commit 9e620ba89e
9 changed files with 45 additions and 26 deletions

View File

@ -267,7 +267,7 @@ func buildCmd(c *cliconfig.BuildValues) error {
MemorySwap: memorySwap, MemorySwap: memorySwap,
ShmSize: c.ShmSize, ShmSize: c.ShmSize,
Ulimit: c.Ulimit, Ulimit: c.Ulimit,
Volumes: c.Volume, Volumes: c.Volumes,
} }
options := imagebuildah.BuildOptions{ options := imagebuildah.BuildOptions{

View File

@ -94,11 +94,11 @@ k8s.io/apimachinery kubernetes-1.10.13-beta.0 https://github.com/kubernetes/apim
k8s.io/client-go kubernetes-1.10.13-beta.0 https://github.com/kubernetes/client-go k8s.io/client-go kubernetes-1.10.13-beta.0 https://github.com/kubernetes/client-go
github.com/mrunalp/fileutils 7d4729fb36185a7c1719923406c9d40e54fb93c7 github.com/mrunalp/fileutils 7d4729fb36185a7c1719923406c9d40e54fb93c7
github.com/varlink/go 64e07fabffa33e385817b41971cf2674f692f391 github.com/varlink/go 64e07fabffa33e385817b41971cf2674f692f391
github.com/containers/buildah 34e7eba408282e890e61395b6d97e58b88e14d25 github.com/containers/buildah v1.8.1
# TODO: Gotty has not been updated since 2012. Can we find replacement? # TODO: Gotty has not been updated since 2012. Can we find replacement?
github.com/Nvveen/Gotty cd527374f1e5bff4938207604a14f2e38a9cf512 github.com/Nvveen/Gotty cd527374f1e5bff4938207604a14f2e38a9cf512
github.com/fsouza/go-dockerclient v1.3.0 github.com/fsouza/go-dockerclient v1.3.0
github.com/openshift/imagebuilder 705fe9255c57f8505efb9723a9ac4082b67973bc github.com/openshift/imagebuilder v1.1.0
github.com/ulikunitz/xz v0.5.5 github.com/ulikunitz/xz v0.5.5
github.com/coreos/go-iptables v0.4.0 github.com/coreos/go-iptables v0.4.0
github.com/google/shlex c34317bd91bf98fab745d77b03933cf8769299fe github.com/google/shlex c34317bd91bf98fab745d77b03933cf8769299fe

View File

@ -26,7 +26,7 @@ const (
Package = "buildah" Package = "buildah"
// Version for the Package. Bump version in contrib/rpm/buildah.spec // Version for the Package. Bump version in contrib/rpm/buildah.spec
// too. // too.
Version = "1.9.0-dev" Version = "1.8.1"
// The value we use to identify what type of information, currently a // The value we use to identify what type of information, currently a
// serialized Builder structure, we are using as per-container state. // serialized Builder structure, we are using as per-container state.
// This should only be changed when we make incompatible changes to // This should only be changed when we make incompatible changes to

View File

@ -1558,6 +1558,9 @@ func (b *Executor) Build(ctx context.Context, stages imagebuilder.Stages) (image
// stages. // stages.
for i := range cleanupImages { for i := range cleanupImages {
removeID := cleanupImages[len(cleanupImages)-i-1] removeID := cleanupImages[len(cleanupImages)-i-1]
if removeID == imageID {
continue
}
if _, err := b.store.DeleteImage(removeID, true); err != nil { if _, err := b.store.DeleteImage(removeID, true); err != nil {
logrus.Debugf("failed to remove intermediate image %q: %v", removeID, err) logrus.Debugf("failed to remove intermediate image %q: %v", removeID, err)
if b.forceRmIntermediateCtrs || errors.Cause(err) != storage.ErrImageUsedByContainer { if b.forceRmIntermediateCtrs || errors.Cause(err) != storage.ErrImageUsedByContainer {
@ -1663,6 +1666,7 @@ func (b *Executor) Build(ctx context.Context, stages imagebuilder.Stages) (image
if !b.layers { if !b.layers {
cleanupImages = append(cleanupImages, imageID) cleanupImages = append(cleanupImages, imageID)
} }
imageID = ""
} }
} }
@ -1812,9 +1816,10 @@ func (b *Executor) deleteSuccessfulIntermediateCtrs() error {
} }
func (s *StageExecutor) EnsureContainerPath(path string) error { func (s *StageExecutor) EnsureContainerPath(path string) error {
_, err := os.Stat(filepath.Join(s.mountPoint, path)) targetPath := filepath.Join(s.mountPoint, path)
_, err := os.Lstat(targetPath)
if err != nil && os.IsNotExist(err) { if err != nil && os.IsNotExist(err) {
err = os.MkdirAll(filepath.Join(s.mountPoint, path), 0755) err = os.MkdirAll(targetPath, 0755)
} }
if err != nil { if err != nil {
return errors.Wrapf(err, "error ensuring container path %q", path) return errors.Wrapf(err, "error ensuring container path %q", path)

View File

@ -96,7 +96,7 @@ type FromAndBudResults struct {
SecurityOpt []string SecurityOpt []string
ShmSize string ShmSize string
Ulimit []string Ulimit []string
Volume []string Volumes []string
} }
// GetUserNSFlags returns the common flags for usernamespace // GetUserNSFlags returns the common flags for usernamespace
@ -190,7 +190,7 @@ func GetFromAndBudFlags(flags *FromAndBudResults, usernsResults *UserNSResults,
fs.StringArrayVar(&flags.SecurityOpt, "security-opt", []string{}, "security options (default [])") fs.StringArrayVar(&flags.SecurityOpt, "security-opt", []string{}, "security options (default [])")
fs.StringVar(&flags.ShmSize, "shm-size", "65536k", "size of '/dev/shm'. The format is `<number><unit>`.") fs.StringVar(&flags.ShmSize, "shm-size", "65536k", "size of '/dev/shm'. The format is `<number><unit>`.")
fs.StringSliceVar(&flags.Ulimit, "ulimit", []string{}, "ulimit options (default [])") fs.StringSliceVar(&flags.Ulimit, "ulimit", []string{}, "ulimit options (default [])")
fs.StringSliceVarP(&flags.Volume, "volume", "v", []string{}, "bind mount a volume into the container (default [])") fs.StringSliceVarP(&flags.Volumes, "volume", "v", []string{}, "bind mount a volume into the container (default [])")
// Add in the usernamespace and namespaceflags // Add in the usernamespace and namespaceflags
usernsFlags := GetUserNSFlags(usernsResults) usernsFlags := GetUserNSFlags(usernsResults)

View File

@ -149,27 +149,42 @@ func parseSecurityOpts(securityOpts []string, commonOpts *buildah.CommonBuildOpt
return nil return nil
} }
func ParseVolume(volume string) (specs.Mount, error) {
mount := specs.Mount{}
arr := strings.SplitN(volume, ":", 3)
if len(arr) < 2 {
return mount, errors.Errorf("incorrect volume format %q, should be host-dir:ctr-dir[:option]", volume)
}
if err := validateVolumeHostDir(arr[0]); err != nil {
return mount, err
}
if err := validateVolumeCtrDir(arr[1]); err != nil {
return mount, err
}
mountOptions := ""
if len(arr) > 2 {
mountOptions = arr[2]
if err := validateVolumeOpts(arr[2]); err != nil {
return mount, err
}
}
mountOpts := strings.Split(mountOptions, ",")
mount.Source = arr[0]
mount.Destination = arr[1]
mount.Type = "rbind"
mount.Options = mountOpts
return mount, nil
}
// ParseVolumes validates the host and container paths passed in to the --volume flag // ParseVolumes validates the host and container paths passed in to the --volume flag
func ParseVolumes(volumes []string) error { func ParseVolumes(volumes []string) error {
if len(volumes) == 0 { if len(volumes) == 0 {
return nil return nil
} }
for _, volume := range volumes { for _, volume := range volumes {
arr := strings.SplitN(volume, ":", 3) if _, err := ParseVolume(volume); err != nil {
if len(arr) < 2 {
return errors.Errorf("incorrect volume format %q, should be host-dir:ctr-dir[:option]", volume)
}
if err := validateVolumeHostDir(arr[0]); err != nil {
return err return err
} }
if err := validateVolumeCtrDir(arr[1]); err != nil {
return err
}
if len(arr) > 2 {
if err := validateVolumeOpts(arr[2]); err != nil {
return err
}
}
} }
return nil return nil
} }

View File

@ -142,7 +142,7 @@ func (b *Builder) Run(command []string, options RunOptions) error {
g = nil g = nil
logrus.Debugf("ensuring working directory %q exists", filepath.Join(mountPoint, spec.Process.Cwd)) logrus.Debugf("ensuring working directory %q exists", filepath.Join(mountPoint, spec.Process.Cwd))
if err = os.MkdirAll(filepath.Join(mountPoint, spec.Process.Cwd), 0755); err != nil { if err = os.MkdirAll(filepath.Join(mountPoint, spec.Process.Cwd), 0755); err != nil && !os.IsExist(err) {
return errors.Wrapf(err, "error ensuring working directory %q exists", spec.Process.Cwd) return errors.Wrapf(err, "error ensuring working directory %q exists", spec.Process.Cwd)
} }

View File

@ -197,7 +197,7 @@ func FindImage(store storage.Store, firstRegistry string, systemContext *types.S
break break
} }
if ref == nil || img == nil { if ref == nil || img == nil {
return nil, nil, errors.Wrapf(err, "error locating image with name %q", image) return nil, nil, errors.Wrapf(err, "error locating image with name %q (%v)", image, names)
} }
return ref, img, nil return ref, img, nil
} }

View File

@ -1,12 +1,11 @@
github.com/Azure/go-ansiterm d6e3b3328b783f23731bc4d058875b0371ff8109 github.com/Azure/go-ansiterm d6e3b3328b783f23731bc4d058875b0371ff8109
github.com/containerd/continuity 004b46473808b3e7a4a3049c20e4376c91eb966d github.com/containers/storage v1.2
github.com/docker/docker b68221c37ee597950364788204546f9c9d0e46a1 github.com/docker/docker b68221c37ee597950364788204546f9c9d0e46a1
github.com/docker/go-connections 97c2040d34dfae1d1b1275fa3a78dbdd2f41cf7e github.com/docker/go-connections 97c2040d34dfae1d1b1275fa3a78dbdd2f41cf7e
github.com/docker/go-units 2fb04c6466a548a03cb009c5569ee1ab1e35398e github.com/docker/go-units 2fb04c6466a548a03cb009c5569ee1ab1e35398e
github.com/fsouza/go-dockerclient openshift-4.0 https://github.com/openshift/go-dockerclient.git github.com/fsouza/go-dockerclient openshift-4.0 https://github.com/openshift/go-dockerclient.git
github.com/gogo/protobuf c5a62797aee0054613cc578653a16c6237fef080 github.com/gogo/protobuf c5a62797aee0054613cc578653a16c6237fef080
github.com/golang/glog 23def4e6c14b4da8ac2ed8007337bc5eb5007998 github.com/golang/glog 23def4e6c14b4da8ac2ed8007337bc5eb5007998
github.com/golang/protobuf v1.3.0
github.com/konsorten/go-windows-terminal-sequences f55edac94c9bbba5d6182a4be46d86a2c9b5b50e github.com/konsorten/go-windows-terminal-sequences f55edac94c9bbba5d6182a4be46d86a2c9b5b50e
github.com/Microsoft/go-winio 1a8911d1ed007260465c3bfbbc785ac6915a0bb8 github.com/Microsoft/go-winio 1a8911d1ed007260465c3bfbbc785ac6915a0bb8
github.com/Nvveen/Gotty cd527374f1e5bff4938207604a14f2e38a9cf512 github.com/Nvveen/Gotty cd527374f1e5bff4938207604a14f2e38a9cf512
@ -14,8 +13,8 @@ github.com/opencontainers/go-digest ac19fd6e7483ff933754af248d80be865e543d22
github.com/opencontainers/image-spec 243ea084a44451d27322fed02b682d99e2af3ba9 github.com/opencontainers/image-spec 243ea084a44451d27322fed02b682d99e2af3ba9
github.com/opencontainers/runc 923a8f8a9a07aceada5fc48c4d37e905d9b019b5 github.com/opencontainers/runc 923a8f8a9a07aceada5fc48c4d37e905d9b019b5
github.com/pkg/errors 27936f6d90f9c8e1145f11ed52ffffbfdb9e0af7 github.com/pkg/errors 27936f6d90f9c8e1145f11ed52ffffbfdb9e0af7
github.com/pquerna/ffjson d49c2bc1aa135aad0c6f4fc2056623ec78f5d5ac
github.com/sirupsen/logrus d7b6bf5e4d26448fd977d07d745a2a66097ddecb github.com/sirupsen/logrus d7b6bf5e4d26448fd977d07d745a2a66097ddecb
golang.org/x/crypto ff983b9c42bc9fbf91556e191cc8efb585c16908 golang.org/x/crypto ff983b9c42bc9fbf91556e191cc8efb585c16908
golang.org/x/net 45ffb0cd1ba084b73e26dee67e667e1be5acce83 golang.org/x/net 45ffb0cd1ba084b73e26dee67e667e1be5acce83
golang.org/x/sync 37e7f081c4d4c64e13b10787722085407fe5d15f
golang.org/x/sys 7fbe1cd0fcc20051e1fcb87fbabec4a1bacaaeba golang.org/x/sys 7fbe1cd0fcc20051e1fcb87fbabec4a1bacaaeba